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.2
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 
15 public class RegularLimit extends SearchLimit {
16  private transient long swigCPtr;
17 
18  protected RegularLimit(long cPtr, boolean cMemoryOwn) {
19  super(mainJNI.RegularLimit_SWIGUpcast(cPtr), cMemoryOwn);
20  swigCPtr = cPtr;
21  }
22 
23  protected static long getCPtr(RegularLimit obj) {
24  return (obj == null) ? 0 : obj.swigCPtr;
25  }
26 
27  @SuppressWarnings("deprecation")
28  protected void finalize() {
29  delete();
30  }
31 
32  public synchronized void delete() {
33  if (swigCPtr != 0) {
34  if (swigCMemOwn) {
35  swigCMemOwn = false;
36  mainJNI.delete_RegularLimit(swigCPtr);
37  }
38  swigCPtr = 0;
39  }
40  super.delete();
41  }
42 
43  public RegularLimit(Solver s, SWIGTYPE_p_absl__Duration time, long branches, long failures, long solutions, boolean smart_time_check, boolean cumulative) {
44  this(mainJNI.new_RegularLimit(Solver.getCPtr(s), s, SWIGTYPE_p_absl__Duration.getCPtr(time), branches, failures, solutions, smart_time_check, cumulative), true);
45  }
46 
47  public void copy(SearchLimit limit) {
48  mainJNI.RegularLimit_copy(swigCPtr, this, SearchLimit.getCPtr(limit), limit);
49  }
50 
52  long cPtr = mainJNI.RegularLimit_makeClone(swigCPtr, this);
53  return (cPtr == 0) ? null : new SearchLimit(cPtr, false);
54  }
55 
57  long cPtr = mainJNI.RegularLimit_MakeIdenticalClone(swigCPtr, this);
58  return (cPtr == 0) ? null : new RegularLimit(cPtr, false);
59  }
60 
61  public boolean check() {
62  return mainJNI.RegularLimit_check(swigCPtr, this);
63  }
64 
65  public void init() {
66  mainJNI.RegularLimit_init(swigCPtr, this);
67  }
68 
69  public void exitSearch() {
70  mainJNI.RegularLimit_exitSearch(swigCPtr, this);
71  }
72 
73  public void UpdateLimits(SWIGTYPE_p_absl__Duration time, long branches, long failures, long solutions) {
74  mainJNI.RegularLimit_UpdateLimits(swigCPtr, this, SWIGTYPE_p_absl__Duration.getCPtr(time), branches, failures, solutions);
75  }
76 
77  public long wall_time() {
78  return mainJNI.RegularLimit_wall_time(swigCPtr, this);
79  }
80 
81  public long branches() {
82  return mainJNI.RegularLimit_branches(swigCPtr, this);
83  }
84 
85  public long failures() {
86  return mainJNI.RegularLimit_failures(swigCPtr, this);
87  }
88 
89  public long solutions() {
90  return mainJNI.RegularLimit_solutions(swigCPtr, this);
91  }
92 
94  return mainJNI.RegularLimit_IsUncheckedSolutionLimitReached(swigCPtr, this);
95  }
96 
97  public int progressPercent() {
98  return mainJNI.RegularLimit_progressPercent(swigCPtr, this);
99  }
100 
101  public String toString() {
102  return mainJNI.RegularLimit_toString(swigCPtr, this);
103  }
104 
105  public void accept(ModelVisitor visitor) {
106  mainJNI.RegularLimit_accept(swigCPtr, this, ModelVisitor.getCPtr(visitor), visitor);
107  }
108 
109 }
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 tre...
long failures()
long branches()
boolean check()
This method is called to check the status of the limit.
void exitSearch()
End of the search.
void UpdateLimits(SWIGTYPE_p_absl__Duration time, long branches, long failures, long solutions)
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)
long solutions()
Solver Class A solver represents the main computation engine.
Definition: Solver.java:73
Base class of all search limits.