Reference

C++

Python

DotNET

Java Documentation

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.0
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, long time, long branches, long failures, long solutions, boolean smart_time_check, boolean cumulative) {
43  this(mainJNI.new_RegularLimit(Solver.getCPtr(s), s, 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 SWIGTYPE_p_absl__Duration duration_limit() {
77  return new SWIGTYPE_p_absl__Duration(mainJNI.RegularLimit_duration_limit(swigCPtr, this), true);
78  }
79 
80  public long wall_time() {
81  return mainJNI.RegularLimit_wall_time(swigCPtr, this);
82  }
83 
84  public long branches() {
85  return mainJNI.RegularLimit_branches(swigCPtr, this);
86  }
87 
88  public long failures() {
89  return mainJNI.RegularLimit_failures(swigCPtr, this);
90  }
91 
92  public long solutions() {
93  return mainJNI.RegularLimit_solutions(swigCPtr, this);
94  }
95 
97  return mainJNI.RegularLimit_IsUncheckedSolutionLimitReached(swigCPtr, this);
98  }
99 
100  public int progressPercent() {
101  return mainJNI.RegularLimit_progressPercent(swigCPtr, this);
102  }
103 
104  public String toString() {
105  return mainJNI.RegularLimit_toString(swigCPtr, this);
106  }
107 
108  public SWIGTYPE_p_absl__Time AbsoluteSolverDeadline() {
109  return new SWIGTYPE_p_absl__Time(mainJNI.RegularLimit_AbsoluteSolverDeadline(swigCPtr, this), true);
110  }
111 
112  public void accept(ModelVisitor visitor) {
113  mainJNI.RegularLimit_accept(swigCPtr, this, ModelVisitor.getCPtr(visitor), visitor);
114  }
115 
116 }
void UpdateLimits(long time, long branches, long failures, long solutions)
Solver Class A solver represents the main computation engine.
Definition: Solver.java:57
SearchLimit(long cPtr, boolean cMemoryOwn)
RegularLimit(Solver s, long time, long branches, long failures, long solutions, boolean smart_time_check, boolean cumulative)
Base class of all search limits.
RegularLimit(long cPtr, boolean cMemoryOwn)
Usual limit based on wall_time, number of explored branches and number of failures in the search tree...