Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
SearchMonitor.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
14public class SearchMonitor extends BaseObject {
15 private transient long swigCPtr;
16
17 protected SearchMonitor(long cPtr, boolean cMemoryOwn) {
18 super(mainJNI.SearchMonitor_SWIGUpcast(cPtr), cMemoryOwn);
19 swigCPtr = cPtr;
20 }
21
22 protected static long getCPtr(SearchMonitor obj) {
23 return (obj == null) ? 0 : obj.swigCPtr;
24 }
25
26 protected static long swigRelease(SearchMonitor obj) {
27 long ptr = 0;
28 if (obj != null) {
29 if (!obj.swigCMemOwn)
30 throw new RuntimeException("Cannot release ownership as memory is not owned");
31 ptr = obj.swigCPtr;
32 obj.swigCMemOwn = false;
33 obj.delete();
34 }
35 return ptr;
36 }
37
38 @SuppressWarnings({"deprecation", "removal"})
39 protected void finalize() {
40 delete();
41 }
42
43 public synchronized void delete() {
44 if (swigCPtr != 0) {
45 if (swigCMemOwn) {
46 swigCMemOwn = false;
47 mainJNI.delete_SearchMonitor(swigCPtr);
48 }
49 swigCPtr = 0;
50 }
51 super.delete();
52 }
53
54 protected void swigDirectorDisconnect() {
55 swigCMemOwn = false;
56 delete();
57 }
58
59 public void swigReleaseOwnership() {
60 swigCMemOwn = false;
61 mainJNI.SearchMonitor_change_ownership(this, swigCPtr, false);
62 }
63
64 public void swigTakeOwnership() {
65 swigCMemOwn = true;
66 mainJNI.SearchMonitor_change_ownership(this, swigCPtr, true);
67 }
68
70
72 this(mainJNI.new_SearchMonitor(Solver.getCPtr(s), s), true);
73 mainJNI.SearchMonitor_director_connect(this, swigCPtr, true, true);
74 }
75
79 public void enterSearch() {
80 if (getClass() == SearchMonitor.class) mainJNI.SearchMonitor_enterSearch(swigCPtr, this); else mainJNI.SearchMonitor_enterSearchSwigExplicitSearchMonitor(swigCPtr, this);
81 }
82
86 public void restartSearch() {
87 if (getClass() == SearchMonitor.class) mainJNI.SearchMonitor_restartSearch(swigCPtr, this); else mainJNI.SearchMonitor_restartSearchSwigExplicitSearchMonitor(swigCPtr, this);
88 }
89
93 public void exitSearch() {
94 if (getClass() == SearchMonitor.class) mainJNI.SearchMonitor_exitSearch(swigCPtr, this); else mainJNI.SearchMonitor_exitSearchSwigExplicitSearchMonitor(swigCPtr, this);
95 }
96
101 try {
102 if (getClass() == SearchMonitor.class) mainJNI.SearchMonitor_beginNextDecision(swigCPtr, this, DecisionBuilder.getCPtr(b), b); else mainJNI.SearchMonitor_beginNextDecisionSwigExplicitSearchMonitor(swigCPtr, this, DecisionBuilder.getCPtr(b), b);
103 } finally {
105 }
106 }
107
112 try {
113 if (getClass() == SearchMonitor.class) mainJNI.SearchMonitor_endNextDecision(swigCPtr, this, DecisionBuilder.getCPtr(b), b, Decision.getCPtr(d), d); else mainJNI.SearchMonitor_endNextDecisionSwigExplicitSearchMonitor(swigCPtr, this, DecisionBuilder.getCPtr(b), b, Decision.getCPtr(d), d);
114 } finally {
116 }
117 }
118
122 public void applyDecision(Decision d) {
123 if (getClass() == SearchMonitor.class) mainJNI.SearchMonitor_applyDecision(swigCPtr, this, Decision.getCPtr(d), d); else mainJNI.SearchMonitor_applyDecisionSwigExplicitSearchMonitor(swigCPtr, this, Decision.getCPtr(d), d);
124 }
125
129 public void refuteDecision(Decision d) {
130 if (getClass() == SearchMonitor.class) mainJNI.SearchMonitor_refuteDecision(swigCPtr, this, Decision.getCPtr(d), d); else mainJNI.SearchMonitor_refuteDecisionSwigExplicitSearchMonitor(swigCPtr, this, Decision.getCPtr(d), d);
131 }
132
137 public void afterDecision(Decision d, boolean apply) {
138 if (getClass() == SearchMonitor.class) mainJNI.SearchMonitor_afterDecision(swigCPtr, this, Decision.getCPtr(d), d, apply); else mainJNI.SearchMonitor_afterDecisionSwigExplicitSearchMonitor(swigCPtr, this, Decision.getCPtr(d), d, apply);
139 }
140
144 public void beginFail() {
145 if (getClass() == SearchMonitor.class) mainJNI.SearchMonitor_beginFail(swigCPtr, this); else mainJNI.SearchMonitor_beginFailSwigExplicitSearchMonitor(swigCPtr, this);
146 }
147
151 public void endFail() {
152 if (getClass() == SearchMonitor.class) mainJNI.SearchMonitor_endFail(swigCPtr, this); else mainJNI.SearchMonitor_endFailSwigExplicitSearchMonitor(swigCPtr, this);
153 }
154
159 if (getClass() == SearchMonitor.class) mainJNI.SearchMonitor_beginInitialPropagation(swigCPtr, this); else mainJNI.SearchMonitor_beginInitialPropagationSwigExplicitSearchMonitor(swigCPtr, this);
160 }
161
165 public void endInitialPropagation() {
166 if (getClass() == SearchMonitor.class) mainJNI.SearchMonitor_endInitialPropagation(swigCPtr, this); else mainJNI.SearchMonitor_endInitialPropagationSwigExplicitSearchMonitor(swigCPtr, this);
167 }
168
174 public boolean acceptSolution() {
175 return (getClass() == SearchMonitor.class) ? mainJNI.SearchMonitor_acceptSolution(swigCPtr, this) : mainJNI.SearchMonitor_acceptSolutionSwigExplicitSearchMonitor(swigCPtr, this);
176 }
177
183 public boolean atSolution() {
184 return (getClass() == SearchMonitor.class) ? mainJNI.SearchMonitor_atSolution(swigCPtr, this) : mainJNI.SearchMonitor_atSolutionSwigExplicitSearchMonitor(swigCPtr, this);
185 }
186
190 public void noMoreSolutions() {
191 if (getClass() == SearchMonitor.class) mainJNI.SearchMonitor_noMoreSolutions(swigCPtr, this); else mainJNI.SearchMonitor_noMoreSolutionsSwigExplicitSearchMonitor(swigCPtr, this);
192 }
193
198 public boolean localOptimum() {
199 return (getClass() == SearchMonitor.class) ? mainJNI.SearchMonitor_localOptimum(swigCPtr, this) : mainJNI.SearchMonitor_localOptimumSwigExplicitSearchMonitor(swigCPtr, this);
200 }
201
205 public boolean acceptDelta(Assignment delta, Assignment deltadelta) {
206 return (getClass() == SearchMonitor.class) ? mainJNI.SearchMonitor_acceptDelta(swigCPtr, this, Assignment.getCPtr(delta), delta, Assignment.getCPtr(deltadelta), deltadelta) : mainJNI.SearchMonitor_acceptDeltaSwigExplicitSearchMonitor(swigCPtr, this, Assignment.getCPtr(delta), delta, Assignment.getCPtr(deltadelta), deltadelta);
207 }
208
212 public void acceptNeighbor() {
213 if (getClass() == SearchMonitor.class) mainJNI.SearchMonitor_acceptNeighbor(swigCPtr, this); else mainJNI.SearchMonitor_acceptNeighborSwigExplicitSearchMonitor(swigCPtr, this);
214 }
215
220 if (getClass() == SearchMonitor.class) mainJNI.SearchMonitor_AcceptUncheckedNeighbor(swigCPtr, this); else mainJNI.SearchMonitor_AcceptUncheckedNeighborSwigExplicitSearchMonitor(swigCPtr, this);
221 }
222
228 return (getClass() == SearchMonitor.class) ? mainJNI.SearchMonitor_IsUncheckedSolutionLimitReached(swigCPtr, this) : mainJNI.SearchMonitor_IsUncheckedSolutionLimitReachedSwigExplicitSearchMonitor(swigCPtr, this);
229 }
230
234 public void periodicCheck() {
235 if (getClass() == SearchMonitor.class) mainJNI.SearchMonitor_periodicCheck(swigCPtr, this); else mainJNI.SearchMonitor_periodicCheckSwigExplicitSearchMonitor(swigCPtr, this);
236 }
237
242 public int progressPercent() {
243 return (getClass() == SearchMonitor.class) ? mainJNI.SearchMonitor_progressPercent(swigCPtr, this) : mainJNI.SearchMonitor_progressPercentSwigExplicitSearchMonitor(swigCPtr, this);
244 }
245
249 public void accept(ModelVisitor visitor) {
250 if (getClass() == SearchMonitor.class) mainJNI.SearchMonitor_accept(swigCPtr, this, ModelVisitor.getCPtr(visitor), visitor); else mainJNI.SearchMonitor_acceptSwigExplicitSearchMonitor(swigCPtr, this, ModelVisitor.getCPtr(visitor), visitor);
251 }
252
258 public void install() {
259 if (getClass() == SearchMonitor.class) mainJNI.SearchMonitor_install(swigCPtr, this); else mainJNI.SearchMonitor_installSwigExplicitSearchMonitor(swigCPtr, this);
260 }
261
262 public Solver solver() {
263 long cPtr = mainJNI.SearchMonitor_solver(swigCPtr, this);
264 return (cPtr == 0) ? null : new Solver(cPtr, false);
265 }
266
267 public final static int kNoProgress = mainJNI.SearchMonitor_kNoProgress_get();
268}
boolean acceptDelta(Assignment delta, Assignment deltadelta)
void endNextDecision(DecisionBuilder b, Decision d)