Java Reference

Java Reference

RegularLimit.java
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 4.0.1
4  *
5  * Do not make changes to this file unless you know what you are doing--modify
6  * the SWIG interface file instead.
7  * ----------------------------------------------------------------------------- */
8 
9 package com.google.ortools.constraintsolver;
10 
14 public class RegularLimit extends SearchLimit {
15  private transient long swigCPtr;
16 
17  protected RegularLimit(long cPtr, boolean cMemoryOwn) {
18  super(mainJNI.RegularLimit_SWIGUpcast(cPtr), cMemoryOwn);
19  swigCPtr = cPtr;
20  }
21 
22  protected static long getCPtr(RegularLimit obj) {
23  return (obj == null) ? 0 : obj.swigCPtr;
24  }
25 
26  @SuppressWarnings("deprecation")
27  protected void finalize() {
28  delete();
29  }
30 
31  public synchronized void delete() {
32  if (swigCPtr != 0) {
33  if (swigCMemOwn) {
34  swigCMemOwn = false;
35  mainJNI.delete_RegularLimit(swigCPtr);
36  }
37  swigCPtr = 0;
38  }
39  super.delete();
40  }
41 
42  public RegularLimit(Solver s, SWIGTYPE_p_absl__Duration time, long branches, long failures, long solutions, boolean smart_time_check, boolean cumulative) {
43  this(mainJNI.new_RegularLimit(Solver.getCPtr(s), s, SWIGTYPE_p_absl__Duration.getCPtr(time), branches, failures, solutions, smart_time_check, cumulative), true);
44  }
45 
46  public void copy(SearchLimit limit) {
47  mainJNI.RegularLimit_copy(swigCPtr, this, SearchLimit.getCPtr(limit), limit);
48  }
49 
51  long cPtr = mainJNI.RegularLimit_makeClone(swigCPtr, this);
52  return (cPtr == 0) ? null : new SearchLimit(cPtr, false);
53  }
54 
56  long cPtr = mainJNI.RegularLimit_MakeIdenticalClone(swigCPtr, this);
57  return (cPtr == 0) ? null : new RegularLimit(cPtr, false);
58  }
59 
60  public boolean check() {
61  return mainJNI.RegularLimit_check(swigCPtr, this);
62  }
63 
64  public void init() {
65  mainJNI.RegularLimit_init(swigCPtr, this);
66  }
67 
68  public void exitSearch() {
69  mainJNI.RegularLimit_exitSearch(swigCPtr, this);
70  }
71 
72  public void UpdateLimits(long time, long branches, long failures, long solutions) {
73  mainJNI.RegularLimit_UpdateLimits(swigCPtr, this, time, branches, failures, solutions);
74  }
75 
76  public long wall_time() {
77  return mainJNI.RegularLimit_wall_time(swigCPtr, this);
78  }
79 
80  public long branches() {
81  return mainJNI.RegularLimit_branches(swigCPtr, this);
82  }
83 
84  public long failures() {
85  return mainJNI.RegularLimit_failures(swigCPtr, this);
86  }
87 
88  public long solutions() {
89  return mainJNI.RegularLimit_solutions(swigCPtr, this);
90  }
91 
93  return mainJNI.RegularLimit_IsUncheckedSolutionLimitReached(swigCPtr, this);
94  }
95 
96  public int progressPercent() {
97  return mainJNI.RegularLimit_progressPercent(swigCPtr, this);
98  }
99 
100  public String toString() {
101  return mainJNI.RegularLimit_toString(swigCPtr, this);
102  }
103 
104  public void accept(ModelVisitor visitor) {
105  mainJNI.RegularLimit_accept(swigCPtr, this, ModelVisitor.getCPtr(visitor), visitor);
106  }
107 
108 }
SearchLimit makeClone()
Allocates a clone of the limit.
void copy(SearchLimit limit)
Copy a limit.
long wall_time()
Model visitor.
RegularLimit MakeIdenticalClone()
int progressPercent()
Returns a percentage representing the propress of the search before reaching limits.
SearchLimit(long cPtr, boolean cMemoryOwn)
void accept(ModelVisitor visitor)
Accepts the given model visitor.
boolean IsUncheckedSolutionLimitReached()
Returns true if the limit of solutions has been reached including unchecked solutions.
String toString()
Usual limit based on wall_time, number of explored branches and number of failures in the search tree...
long failures()
long branches()
boolean check()
This method is called to check the status of the limit.
void exitSearch()
End of the search.
RegularLimit(long cPtr, boolean cMemoryOwn)
void init()
This method is called when the search limit is initialized.
RegularLimit(Solver s, SWIGTYPE_p_absl__Duration time, long branches, long failures, long solutions, boolean smart_time_check, boolean cumulative)
void UpdateLimits(long time, long branches, long failures, long solutions)
long solutions()
Solver Class A solver represents the main computation engine.
Definition: Solver.java:57
Base class of all search limits.