public class ActivityBased extends AbstractStrategy<IntVar> implements IMonitorDownBranch, IMonitorRestart, IVariableMonitor<IntVar>, Comparator<IntVar>
Constructor and Description |
---|
ActivityBased(IntVar[] vars) |
ActivityBased(Model model,
IntVar[] vars,
double g,
double d,
int a,
int samplingIterationForced,
long seed) |
Modifier and Type | Method and Description |
---|---|
void |
afterDownBranch(boolean left)
Action to perform after going down in the tree search
|
void |
afterRestart()
Actions to execute after restarting the search
|
void |
beforeDownBranch(boolean left)
Action to perform before going down in the tree search
|
void |
beforeRestart()
Actions to execute before restarting the search
|
int |
compare(IntVar o1,
IntVar o2) |
Decision<IntVar> |
computeDecision(IntVar variable)
Computes a decision to be applied to variable var
This method should be implemented in order to use search patterns
|
double |
getActivity(IntVar var) |
Decision<IntVar> |
getDecision()
Provides access to the current decision in the strategy.
|
boolean |
init()
Prepare
this to be used in a search loop
The initialization can detect inconsistency, in that case, it returns false |
void |
onUpdate(IntVar var,
IEventType evt)
Operations to execute after updating the domain variable
|
getVariables, makeIntDecision, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public ActivityBased(Model model, IntVar[] vars, double g, double d, int a, int samplingIterationForced, long seed)
public ActivityBased(IntVar[] vars)
public boolean init()
AbstractStrategy
this
to be used in a search loop
The initialization can detect inconsistency, in that case, it returns falseinit
in class AbstractStrategy<IntVar>
public Decision<IntVar> computeDecision(IntVar variable)
AbstractStrategy
computeDecision
in class AbstractStrategy<IntVar>
variable
- a variablepublic Decision<IntVar> getDecision()
AbstractStrategy
null
.getDecision
in class AbstractStrategy<IntVar>
public int compare(IntVar o1, IntVar o2)
compare
in interface Comparator<IntVar>
public double getActivity(IntVar var)
public void onUpdate(IntVar var, IEventType evt)
IVariableMonitor
onUpdate
in interface IVariableMonitor<IntVar>
var
- variable concernedevt
- modification eventpublic void beforeDownBranch(boolean left)
IMonitorDownBranch
beforeDownBranch
in interface IMonitorDownBranch
left
- set to true to specify that this is a left branchpublic void afterDownBranch(boolean left)
IMonitorDownBranch
afterDownBranch
in interface IMonitorDownBranch
left
- set to true to specify that this is a left branchpublic void beforeRestart()
IMonitorRestart
beforeRestart
in interface IMonitorRestart
public void afterRestart()
IMonitorRestart
afterRestart
in interface IMonitorRestart
Copyright © 2018. All rights reserved.