Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
RegularLimit.java
Go to the documentation of this file.
1/* ----------------------------------------------------------------------------
2 * This file was automatically generated by SWIG (https://www.swig.org).
3 * Version 4.2.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
9package com.google.ortools.constraintsolver;
10
15public 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 protected static long swigRelease(RegularLimit obj) {
28 long ptr = 0;
29 if (obj != null) {
30 if (!obj.swigCMemOwn)
31 throw new RuntimeException("Cannot release ownership as memory is not owned");
32 ptr = obj.swigCPtr;
33 obj.swigCMemOwn = false;
34 obj.delete();
35 }
36 return ptr;
37 }
38
39 @SuppressWarnings({"deprecation", "removal"})
40 protected void finalize() {
41 delete();
42 }
43
44 public synchronized void delete() {
45 if (swigCPtr != 0) {
46 if (swigCMemOwn) {
47 swigCMemOwn = false;
48 mainJNI.delete_RegularLimit(swigCPtr);
49 }
50 swigCPtr = 0;
51 }
52 super.delete();
53 }
54
55 public RegularLimit(Solver s, SWIGTYPE_p_absl__Duration time, long branches, long failures, long solutions, boolean smart_time_check, boolean cumulative) {
56 this(mainJNI.new_RegularLimit(Solver.getCPtr(s), s, SWIGTYPE_p_absl__Duration.getCPtr(time), branches, failures, solutions, smart_time_check, cumulative), true);
57 }
58
59 public void copy(SearchLimit limit) {
60 mainJNI.RegularLimit_copy(swigCPtr, this, SearchLimit.getCPtr(limit), limit);
61 }
62
64 long cPtr = mainJNI.RegularLimit_makeClone(swigCPtr, this);
65 return (cPtr == 0) ? null : new SearchLimit(cPtr, false);
66 }
67
69 long cPtr = mainJNI.RegularLimit_MakeIdenticalClone(swigCPtr, this);
70 return (cPtr == 0) ? null : new RegularLimit(cPtr, false);
71 }
72
73 public boolean CheckWithOffset(SWIGTYPE_p_absl__Duration offset) {
74 return mainJNI.RegularLimit_CheckWithOffset(swigCPtr, this, SWIGTYPE_p_absl__Duration.getCPtr(offset));
75 }
76
77 public void init() {
78 mainJNI.RegularLimit_init(swigCPtr, this);
79 }
80
81 public void exitSearch() {
82 mainJNI.RegularLimit_exitSearch(swigCPtr, this);
83 }
84
85 public void UpdateLimits(SWIGTYPE_p_absl__Duration time, long branches, long failures, long solutions) {
86 mainJNI.RegularLimit_UpdateLimits(swigCPtr, this, SWIGTYPE_p_absl__Duration.getCPtr(time), branches, failures, solutions);
87 }
88
89 public long wall_time() {
90 return mainJNI.RegularLimit_wall_time(swigCPtr, this);
91 }
92
93 public long branches() {
94 return mainJNI.RegularLimit_branches(swigCPtr, this);
95 }
96
97 public long failures() {
98 return mainJNI.RegularLimit_failures(swigCPtr, this);
99 }
100
101 public long solutions() {
102 return mainJNI.RegularLimit_solutions(swigCPtr, this);
103 }
104
106 return mainJNI.RegularLimit_IsUncheckedSolutionLimitReached(swigCPtr, this);
107 }
108
109 public int progressPercent() {
110 return mainJNI.RegularLimit_progressPercent(swigCPtr, this);
111 }
112
113 public String toString() {
114 return mainJNI.RegularLimit_toString(swigCPtr, this);
115 }
116
117 public void install() {
118 mainJNI.RegularLimit_install(swigCPtr, this);
119 }
120
121 public void accept(ModelVisitor visitor) {
122 mainJNI.RegularLimit_accept(swigCPtr, this, ModelVisitor.getCPtr(visitor), visitor);
123 }
124
125}
RegularLimit(long cPtr, boolean cMemoryOwn)
void UpdateLimits(SWIGTYPE_p_absl__Duration time, long branches, long failures, long solutions)
boolean CheckWithOffset(SWIGTYPE_p_absl__Duration offset)
RegularLimit(Solver s, SWIGTYPE_p_absl__Duration time, long branches, long failures, long solutions, boolean smart_time_check, boolean cumulative)
SearchLimit(long cPtr, boolean cMemoryOwn)