Java Reference

Java Reference

DefaultPhaseParameters.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.2
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 @SuppressWarnings("deprecation")
33 protected void finalize() {
34 delete();
35 }
36
37 public synchronized void delete() {
38 if (swigCPtr != 0) {
39 if (swigCMemOwn) {
40 swigCMemOwn = false;
41 mainJNI.delete_DefaultPhaseParameters(swigCPtr);
42 }
43 swigCPtr = 0;
44 }
45 }
46
47 // Ensure that the GC doesn't collect any DecisionBuilder set from Java
48 // as the underlying C++ class stores a shallow copy
49 private HashSet<DecisionBuilder> keepAliveDecisionBuilders;
51 if (keepAliveDecisionBuilders == null) {
52 keepAliveDecisionBuilders = new HashSet<DecisionBuilder>();
53 }
54 keepAliveDecisionBuilders.add(db);
55 }
56
61 public void setVarSelectionSchema(int value) {
62 mainJNI.DefaultPhaseParameters_varSelectionSchema_set(swigCPtr, this, value);
63 }
64
69 public int getVarSelectionSchema() {
70 return mainJNI.DefaultPhaseParameters_varSelectionSchema_get(swigCPtr, this);
71 }
72
76 public void setValueSelectionSchema(int value) {
77 mainJNI.DefaultPhaseParameters_valueSelectionSchema_set(swigCPtr, this, value);
78 }
79
84 return mainJNI.DefaultPhaseParameters_valueSelectionSchema_get(swigCPtr, this);
85 }
86
91 public void setInitializationSplits(int value) {
92 mainJNI.DefaultPhaseParameters_initializationSplits_set(swigCPtr, this, value);
93 }
94
100 return mainJNI.DefaultPhaseParameters_initializationSplits_get(swigCPtr, this);
101 }
102
108 public void setRunAllHeuristics(boolean value) {
109 mainJNI.DefaultPhaseParameters_runAllHeuristics_set(swigCPtr, this, value);
110 }
111
117 public boolean getRunAllHeuristics() {
118 return mainJNI.DefaultPhaseParameters_runAllHeuristics_get(swigCPtr, this);
119 }
120
126 public void setHeuristicPeriod(int value) {
127 mainJNI.DefaultPhaseParameters_heuristicPeriod_set(swigCPtr, this, value);
128 }
129
135 public int getHeuristicPeriod() {
136 return mainJNI.DefaultPhaseParameters_heuristicPeriod_get(swigCPtr, this);
137 }
138
142 public void setHeuristicNumFailuresLimit(int value) {
143 mainJNI.DefaultPhaseParameters_heuristicNumFailuresLimit_set(swigCPtr, this, value);
144 }
145
150 return mainJNI.DefaultPhaseParameters_heuristicNumFailuresLimit_get(swigCPtr, this);
151 }
152
157 public void setPersistentImpact(boolean value) {
158 mainJNI.DefaultPhaseParameters_persistentImpact_set(swigCPtr, this, value);
159 }
160
165 public boolean getPersistentImpact() {
166 return mainJNI.DefaultPhaseParameters_persistentImpact_get(swigCPtr, this);
167 }
168
172 public void setRandomSeed(int value) {
173 mainJNI.DefaultPhaseParameters_randomSeed_set(swigCPtr, this, value);
174 }
175
179 public int getRandomSeed() {
180 return mainJNI.DefaultPhaseParameters_randomSeed_get(swigCPtr, this);
181 }
182
187 public void setDisplayLevel(int value) {
188 mainJNI.DefaultPhaseParameters_displayLevel_set(swigCPtr, this, value);
189 }
190
195 public int getDisplayLevel() {
196 return mainJNI.DefaultPhaseParameters_displayLevel_get(swigCPtr, this);
197 }
198
202 public void setUseLastConflict(boolean value) {
203 mainJNI.DefaultPhaseParameters_useLastConflict_set(swigCPtr, this, value);
204 }
205
209 public boolean getUseLastConflict() {
210 return mainJNI.DefaultPhaseParameters_useLastConflict_get(swigCPtr, this);
211 }
212
217 try {
218 mainJNI.DefaultPhaseParameters_decisionBuilder_set(swigCPtr, this, DecisionBuilder.getCPtr(value), value);
219 } finally {
221 }
222 }
223
228 long cPtr = mainJNI.DefaultPhaseParameters_decisionBuilder_get(swigCPtr, this);
229 return (cPtr == 0) ? null : new DecisionBuilder(cPtr, false);
230 }
231
233 this(mainJNI.new_DefaultPhaseParameters(), true);
234 }
235
236 // VariableSelection
237 public final static int CHOOSE_MAX_SUM_IMPACT = mainJNI.DefaultPhaseParameters_CHOOSE_MAX_SUM_IMPACT_get();
238 public final static int CHOOSE_MAX_AVERAGE_IMPACT = mainJNI.DefaultPhaseParameters_CHOOSE_MAX_AVERAGE_IMPACT_get();
239 public final static int CHOOSE_MAX_VALUE_IMPACT = mainJNI.DefaultPhaseParameters_CHOOSE_MAX_VALUE_IMPACT_get();
240
241 // ValueSelection
242 public final static int SELECT_MIN_IMPACT = mainJNI.DefaultPhaseParameters_SELECT_MIN_IMPACT_get();
243 public final static int SELECT_MAX_IMPACT = mainJNI.DefaultPhaseParameters_SELECT_MAX_IMPACT_get();
244
245 // DisplayLevel
246 public final static int NONE = mainJNI.DefaultPhaseParameters_NONE_get();
247 public final static int NORMAL = mainJNI.DefaultPhaseParameters_NORMAL_get();
248 public final static int VERBOSE = mainJNI.DefaultPhaseParameters_VERBOSE_get();
249
250}
A DecisionBuilder is responsible for creating the search tree.
This struct holds all parameters for the default search.
int getRandomSeed()
Seed used to initialize the random part in some heuristics.
void setVarSelectionSchema(int value)
This parameter describes how the next variable to instantiate will be chosen.
int getDisplayLevel()
This represents the amount of information displayed by the default search.
void setPersistentImpact(boolean value)
Whether to keep the impact from the first search for other searches, or to recompute the impact for ...
DecisionBuilder getDecisionBuilder()
When defined, this overrides the default impact based decision builder.
int getHeuristicPeriod()
The distance in nodes between each run of the heuristics.
void setUseLastConflict(boolean value)
Should we use last conflict method.
void setRandomSeed(int value)
Seed used to initialize the random part in some heuristics.
int getInitializationSplits()
Maximum number of intervals that the initialization of impacts will scan per variable.
boolean getPersistentImpact()
Whether to keep the impact from the first search for other searches, or to recompute the impact for ...
void setValueSelectionSchema(int value)
This parameter describes which value to select for a given var.
boolean getUseLastConflict()
Should we use last conflict method.
void setRunAllHeuristics(boolean value)
The default phase will run heuristics periodically.
void setHeuristicNumFailuresLimit(int value)
The failure limit for each heuristic that we run.
void setInitializationSplits(int value)
Maximum number of intervals that the initialization of impacts will scan per variable.
void setDisplayLevel(int value)
This represents the amount of information displayed by the default search.
void setHeuristicPeriod(int value)
The distance in nodes between each run of the heuristics.
void setDecisionBuilder(DecisionBuilder value)
When defined, this overrides the default impact based decision builder.
boolean getRunAllHeuristics()
The default phase will run heuristics periodically.
int getVarSelectionSchema()
This parameter describes how the next variable to instantiate will be chosen.
int getValueSelectionSchema()
This parameter describes which value to select for a given var.
int getHeuristicNumFailuresLimit()
The failure limit for each heuristic that we run.