OR-Tools  7.1
RegularLimit.java
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 3.0.12
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 
11 public class RegularLimit extends SearchLimit {
12  private transient long swigCPtr;
13 
14  protected RegularLimit(long cPtr, boolean cMemoryOwn) {
15  super(mainJNI.RegularLimit_SWIGUpcast(cPtr), cMemoryOwn);
16  swigCPtr = cPtr;
17  }
18 
19  protected static long getCPtr(RegularLimit obj) {
20  return (obj == null) ? 0 : obj.swigCPtr;
21  }
22 
23  protected void finalize() {
24  delete();
25  }
26 
27  public synchronized void delete() {
28  if (swigCPtr != 0) {
29  if (swigCMemOwn) {
30  swigCMemOwn = false;
31  mainJNI.delete_RegularLimit(swigCPtr);
32  }
33  swigCPtr = 0;
34  }
35  super.delete();
36  }
37 
38  public RegularLimit(Solver s, long time, long branches, long failures, long solutions, boolean smart_time_check, boolean cumulative) {
39  this(mainJNI.new_RegularLimit(Solver.getCPtr(s), s, time, branches, failures, solutions, smart_time_check, cumulative), true);
40  }
41 
42  public void copy(SearchLimit limit) {
43  mainJNI.RegularLimit_copy(swigCPtr, this, SearchLimit.getCPtr(limit), limit);
44  }
45 
47  long cPtr = mainJNI.RegularLimit_makeClone(swigCPtr, this);
48  return (cPtr == 0) ? null : new SearchLimit(cPtr, false);
49  }
50 
52  long cPtr = mainJNI.RegularLimit_MakeIdenticalClone(swigCPtr, this);
53  return (cPtr == 0) ? null : new RegularLimit(cPtr, false);
54  }
55 
56  public boolean check() {
57  return mainJNI.RegularLimit_check(swigCPtr, this);
58  }
59 
60  public void init() {
61  mainJNI.RegularLimit_init(swigCPtr, this);
62  }
63 
64  public void exitSearch() {
65  mainJNI.RegularLimit_exitSearch(swigCPtr, this);
66  }
67 
68  public void UpdateLimits(long time, long branches, long failures, long solutions) {
69  mainJNI.RegularLimit_UpdateLimits(swigCPtr, this, time, branches, failures, solutions);
70  }
71 
72  public SWIGTYPE_p_absl__Duration duration_limit() {
73  return new SWIGTYPE_p_absl__Duration(mainJNI.RegularLimit_duration_limit(swigCPtr, this), true);
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 SWIGTYPE_p_absl__Time AbsoluteSolverDeadline() {
105  return new SWIGTYPE_p_absl__Time(mainJNI.RegularLimit_AbsoluteSolverDeadline(swigCPtr, this), true);
106  }
107 
108  public void accept(ModelVisitor visitor) {
109  mainJNI.RegularLimit_accept(swigCPtr, this, ModelVisitor.getCPtr(visitor), visitor);
110  }
111 
112 }
void UpdateLimits(long time, long branches, long failures, long solutions)
static long getCPtr(Solver obj)
Definition: Solver.java:63
SearchLimit(long cPtr, boolean cMemoryOwn)
RegularLimit(long cPtr, boolean cMemoryOwn)
RegularLimit(Solver s, long time, long branches, long failures, long solutions, boolean smart_time_check, boolean cumulative)