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.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 
9 package com.google.ortools.constraintsolver;
10 
11 // Used to keep alive java references to objects passed to the C++ layer.
12 import java.util.HashSet;
13 
17 public class DefaultPhaseParameters {
18  private transient long swigCPtr;
19  protected transient boolean swigCMemOwn;
20 
21  protected DefaultPhaseParameters(long cPtr, boolean cMemoryOwn) {
22  swigCMemOwn = cMemoryOwn;
23  swigCPtr = cPtr;
24  }
25 
26  protected static long getCPtr(DefaultPhaseParameters obj) {
27  return (obj == null) ? 0 : obj.swigCPtr;
28  }
29 
30  @SuppressWarnings("deprecation")
31  protected void finalize() {
32  delete();
33  }
34 
35  public synchronized void delete() {
36  if (swigCPtr != 0) {
37  if (swigCMemOwn) {
38  swigCMemOwn = false;
39  mainJNI.delete_DefaultPhaseParameters(swigCPtr);
40  }
41  swigCPtr = 0;
42  }
43  }
44 
45  // Ensure that the GC doesn't collect any DecisionBuilder set from Java
46  // as the underlying C++ class stores a shallow copy
47  private HashSet<DecisionBuilder> keepAliveDecisionBuilders;
49  if (keepAliveDecisionBuilders == null) {
50  keepAliveDecisionBuilders = new HashSet<DecisionBuilder>();
51  }
52  keepAliveDecisionBuilders.add(db);
53  }
54 
58  public void setVarSelectionSchema(int value) {
59  mainJNI.DefaultPhaseParameters_varSelectionSchema_set(swigCPtr, this, value);
60  }
61 
65  public int getVarSelectionSchema() {
66  return mainJNI.DefaultPhaseParameters_varSelectionSchema_get(swigCPtr, this);
67  }
68 
72  public void setValueSelectionSchema(int value) {
73  mainJNI.DefaultPhaseParameters_valueSelectionSchema_set(swigCPtr, this, value);
74  }
75 
79  public int getValueSelectionSchema() {
80  return mainJNI.DefaultPhaseParameters_valueSelectionSchema_get(swigCPtr, this);
81  }
82 
86  public void setInitializationSplits(int value) {
87  mainJNI.DefaultPhaseParameters_initializationSplits_set(swigCPtr, this, value);
88  }
89 
93  public int getInitializationSplits() {
94  return mainJNI.DefaultPhaseParameters_initializationSplits_get(swigCPtr, this);
95  }
96 
100  public void setRunAllHeuristics(boolean value) {
101  mainJNI.DefaultPhaseParameters_runAllHeuristics_set(swigCPtr, this, value);
102  }
103 
107  public boolean getRunAllHeuristics() {
108  return mainJNI.DefaultPhaseParameters_runAllHeuristics_get(swigCPtr, this);
109  }
110 
114  public void setHeuristicPeriod(int value) {
115  mainJNI.DefaultPhaseParameters_heuristicPeriod_set(swigCPtr, this, value);
116  }
117 
121  public int getHeuristicPeriod() {
122  return mainJNI.DefaultPhaseParameters_heuristicPeriod_get(swigCPtr, this);
123  }
124 
128  public void setHeuristicNumFailuresLimit(int value) {
129  mainJNI.DefaultPhaseParameters_heuristicNumFailuresLimit_set(swigCPtr, this, value);
130  }
131 
136  return mainJNI.DefaultPhaseParameters_heuristicNumFailuresLimit_get(swigCPtr, this);
137  }
138 
142  public void setPersistentImpact(boolean value) {
143  mainJNI.DefaultPhaseParameters_persistentImpact_set(swigCPtr, this, value);
144  }
145 
149  public boolean getPersistentImpact() {
150  return mainJNI.DefaultPhaseParameters_persistentImpact_get(swigCPtr, this);
151  }
152 
156  public void setRandomSeed(int value) {
157  mainJNI.DefaultPhaseParameters_randomSeed_set(swigCPtr, this, value);
158  }
159 
163  public int getRandomSeed() {
164  return mainJNI.DefaultPhaseParameters_randomSeed_get(swigCPtr, this);
165  }
166 
170  public void setDisplayLevel(int value) {
171  mainJNI.DefaultPhaseParameters_displayLevel_set(swigCPtr, this, value);
172  }
173 
177  public int getDisplayLevel() {
178  return mainJNI.DefaultPhaseParameters_displayLevel_get(swigCPtr, this);
179  }
180 
184  public void setUseLastConflict(boolean value) {
185  mainJNI.DefaultPhaseParameters_useLastConflict_set(swigCPtr, this, value);
186  }
187 
191  public boolean getUseLastConflict() {
192  return mainJNI.DefaultPhaseParameters_useLastConflict_get(swigCPtr, this);
193  }
194 
198  public void setDecisionBuilder(DecisionBuilder value) {
199  try {
200  mainJNI.DefaultPhaseParameters_decisionBuilder_set(swigCPtr, this, DecisionBuilder.getCPtr(value), value);
201  } finally {
203  }
204  }
205 
210  long cPtr = mainJNI.DefaultPhaseParameters_decisionBuilder_get(swigCPtr, this);
211  return (cPtr == 0) ? null : new DecisionBuilder(cPtr, false);
212  }
213 
215  this(mainJNI.new_DefaultPhaseParameters(), true);
216  }
217 
218  // VariableSelection
219  public final static int CHOOSE_MAX_SUM_IMPACT = mainJNI.DefaultPhaseParameters_CHOOSE_MAX_SUM_IMPACT_get();
220  public final static int CHOOSE_MAX_AVERAGE_IMPACT = mainJNI.DefaultPhaseParameters_CHOOSE_MAX_AVERAGE_IMPACT_get();
221  public final static int CHOOSE_MAX_VALUE_IMPACT = mainJNI.DefaultPhaseParameters_CHOOSE_MAX_VALUE_IMPACT_get();
222 
223  // ValueSelection
224  public final static int SELECT_MIN_IMPACT = mainJNI.DefaultPhaseParameters_SELECT_MIN_IMPACT_get();
225  public final static int SELECT_MAX_IMPACT = mainJNI.DefaultPhaseParameters_SELECT_MAX_IMPACT_get();
226 
227  // DisplayLevel
228  public final static int NONE = mainJNI.DefaultPhaseParameters_NONE_get();
229  public final static int NORMAL = mainJNI.DefaultPhaseParameters_NORMAL_get();
230  public final static int VERBOSE = mainJNI.DefaultPhaseParameters_VERBOSE_get();
231 
232 }
int getRandomSeed()
Seed used to initialize the random part in some heuristics.
int getValueSelectionSchema()
This parameter describes which value to select for a given var.
boolean getPersistentImpact()
Whether to keep the impact from the first search for other searches, or to recompute the impact for e...
void setHeuristicNumFailuresLimit(int value)
The failure limit for each heuristic that we run.
int getHeuristicNumFailuresLimit()
The failure limit for each heuristic that we run.
void setValueSelectionSchema(int value)
This parameter describes which value to select for a given var.
boolean getRunAllHeuristics()
The default phase will run heuristics periodically.
boolean getUseLastConflict()
Should we use last conflict method.
This struct holds all parameters for the default search.
A DecisionBuilder is responsible for creating the search tree.
void setPersistentImpact(boolean value)
Whether to keep the impact from the first search for other searches, or to recompute the impact for e...
void setInitializationSplits(int value)
Maximum number of intervals that the initialization of impacts will scan per variable.
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.
void setUseLastConflict(boolean value)
Should we use last conflict method.
void setRunAllHeuristics(boolean value)
The default phase will run heuristics periodically.
DecisionBuilder getDecisionBuilder()
When defined, this overrides the default impact based decision builder.
int getDisplayLevel()
This represents the amount of information displayed by the default search.
void setDecisionBuilder(DecisionBuilder value)
When defined, this overrides the default impact based decision builder.
int getHeuristicPeriod()
The distance in nodes between each run of the heuristics.
void setDisplayLevel(int value)
This represents the amount of information displayed by the default search.
void setVarSelectionSchema(int value)
This parameter describes how the next variable to instantiate will be chosen.
void setHeuristicPeriod(int value)
The distance in nodes between each run of the heuristics.
int getVarSelectionSchema()
This parameter describes how the next variable to instantiate will be chosen.