Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
DefaultPhaseParameters.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
11// Used to keep alive java references to objects passed to the C++ layer.
12import java.util.HashSet;
13
20 private transient long swigCPtr;
21 protected transient boolean swigCMemOwn;
22
23 protected DefaultPhaseParameters(long cPtr, boolean cMemoryOwn) {
24 swigCMemOwn = cMemoryOwn;
25 swigCPtr = cPtr;
26 }
27
28 protected static long getCPtr(DefaultPhaseParameters obj) {
29 return (obj == null) ? 0 : obj.swigCPtr;
30 }
31
32 protected static long swigRelease(DefaultPhaseParameters obj) {
33 long ptr = 0;
34 if (obj != null) {
35 if (!obj.swigCMemOwn)
36 throw new RuntimeException("Cannot release ownership as memory is not owned");
37 ptr = obj.swigCPtr;
38 obj.swigCMemOwn = false;
39 obj.delete();
40 }
41 return ptr;
42 }
43
44 @SuppressWarnings({"deprecation", "removal"})
45 protected void finalize() {
46 delete();
47 }
48
49 public synchronized void delete() {
50 if (swigCPtr != 0) {
51 if (swigCMemOwn) {
52 swigCMemOwn = false;
53 mainJNI.delete_DefaultPhaseParameters(swigCPtr);
54 }
55 swigCPtr = 0;
56 }
57 }
58
59 // Ensure that the GC doesn't collect any DecisionBuilder set from Java
60 // as the underlying C++ class stores a shallow copy
61 private HashSet<DecisionBuilder> keepAliveDecisionBuilders;
63 if (keepAliveDecisionBuilders == null) {
64 keepAliveDecisionBuilders = new HashSet<DecisionBuilder>();
65 }
66 keepAliveDecisionBuilders.add(db);
67 }
68
73 public void setVarSelectionSchema(int value) {
74 mainJNI.DefaultPhaseParameters_varSelectionSchema_set(swigCPtr, this, value);
75 }
76
81 public int getVarSelectionSchema() {
82 return mainJNI.DefaultPhaseParameters_varSelectionSchema_get(swigCPtr, this);
83 }
84
88 public void setValueSelectionSchema(int value) {
89 mainJNI.DefaultPhaseParameters_valueSelectionSchema_set(swigCPtr, this, value);
90 }
91
96 return mainJNI.DefaultPhaseParameters_valueSelectionSchema_get(swigCPtr, this);
97 }
98
103 public void setInitializationSplits(int value) {
104 mainJNI.DefaultPhaseParameters_initializationSplits_set(swigCPtr, this, value);
105 }
106
112 return mainJNI.DefaultPhaseParameters_initializationSplits_get(swigCPtr, this);
113 }
114
120 public void setRunAllHeuristics(boolean value) {
121 mainJNI.DefaultPhaseParameters_runAllHeuristics_set(swigCPtr, this, value);
122 }
123
129 public boolean getRunAllHeuristics() {
130 return mainJNI.DefaultPhaseParameters_runAllHeuristics_get(swigCPtr, this);
131 }
132
138 public void setHeuristicPeriod(int value) {
139 mainJNI.DefaultPhaseParameters_heuristicPeriod_set(swigCPtr, this, value);
140 }
141
147 public int getHeuristicPeriod() {
148 return mainJNI.DefaultPhaseParameters_heuristicPeriod_get(swigCPtr, this);
149 }
150
154 public void setHeuristicNumFailuresLimit(int value) {
155 mainJNI.DefaultPhaseParameters_heuristicNumFailuresLimit_set(swigCPtr, this, value);
156 }
157
162 return mainJNI.DefaultPhaseParameters_heuristicNumFailuresLimit_get(swigCPtr, this);
163 }
164
169 public void setPersistentImpact(boolean value) {
170 mainJNI.DefaultPhaseParameters_persistentImpact_set(swigCPtr, this, value);
171 }
172
177 public boolean getPersistentImpact() {
178 return mainJNI.DefaultPhaseParameters_persistentImpact_get(swigCPtr, this);
179 }
180
184 public void setRandomSeed(int value) {
185 mainJNI.DefaultPhaseParameters_randomSeed_set(swigCPtr, this, value);
186 }
187
191 public int getRandomSeed() {
192 return mainJNI.DefaultPhaseParameters_randomSeed_get(swigCPtr, this);
193 }
194
199 public void setDisplayLevel(int value) {
200 mainJNI.DefaultPhaseParameters_displayLevel_set(swigCPtr, this, value);
201 }
202
207 public int getDisplayLevel() {
208 return mainJNI.DefaultPhaseParameters_displayLevel_get(swigCPtr, this);
209 }
210
214 public void setUseLastConflict(boolean value) {
215 mainJNI.DefaultPhaseParameters_useLastConflict_set(swigCPtr, this, value);
216 }
217
221 public boolean getUseLastConflict() {
222 return mainJNI.DefaultPhaseParameters_useLastConflict_get(swigCPtr, this);
223 }
224
229 try {
230 mainJNI.DefaultPhaseParameters_decisionBuilder_set(swigCPtr, this, DecisionBuilder.getCPtr(value), value);
231 } finally {
233 }
234 }
235
240 long cPtr = mainJNI.DefaultPhaseParameters_decisionBuilder_get(swigCPtr, this);
241 return (cPtr == 0) ? null : new DecisionBuilder(cPtr, false);
242 }
243
245 this(mainJNI.new_DefaultPhaseParameters(), true);
246 }
247
248 // VariableSelection
249 public final static int CHOOSE_MAX_SUM_IMPACT = mainJNI.DefaultPhaseParameters_CHOOSE_MAX_SUM_IMPACT_get();
250 public final static int CHOOSE_MAX_AVERAGE_IMPACT = mainJNI.DefaultPhaseParameters_CHOOSE_MAX_AVERAGE_IMPACT_get();
251 public final static int CHOOSE_MAX_VALUE_IMPACT = mainJNI.DefaultPhaseParameters_CHOOSE_MAX_VALUE_IMPACT_get();
252
253 // ValueSelection
254 public final static int SELECT_MIN_IMPACT = mainJNI.DefaultPhaseParameters_SELECT_MIN_IMPACT_get();
255 public final static int SELECT_MAX_IMPACT = mainJNI.DefaultPhaseParameters_SELECT_MAX_IMPACT_get();
256
257 // DisplayLevel
258 public final static int NONE = mainJNI.DefaultPhaseParameters_NONE_get();
259 public final static int NORMAL = mainJNI.DefaultPhaseParameters_NORMAL_get();
260 public final static int VERBOSE = mainJNI.DefaultPhaseParameters_VERBOSE_get();
261
262}