public class ActivityBased extends AbstractStrategy<IntVar> implements IMonitorDownBranch, IMonitorRestart, IVariableMonitor<IntVar>, Comparator<IntVar>
Modifier and Type | Field and Description |
---|---|
boolean |
sampling |
LOGGER
Constructor and Description |
---|
ActivityBased(Solver solver,
IntVar[] vars,
double g,
double d,
int a,
int samplingIterationForced,
long seed) |
Modifier and Type | Method and Description |
---|---|
void |
afterDownLeftBranch() |
void |
afterDownRightBranch() |
void |
afterRestart() |
void |
beforeDownLeftBranch() |
void |
beforeDownRightBranch() |
void |
beforeRestart() |
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
|
void |
duplicate(Solver solver,
gnu.trove.map.hash.THashMap<Object,Object> identitymap)
Duplicate
this (which naturally adds it into solver ). |
double |
getActivity(IntVar var) |
Decision<IntVar> |
getDecision()
Provides access to the current decision in the strategy.
|
void |
init()
Prepare
this to be used in a search loop |
void |
onUpdate(IntVar var,
IEventType evt)
Operations to execute after updating the domain variable
|
boolean |
why(RuleStore ruleStore,
IntVar var,
IEventType evt,
int value)
Add new rules to the rule store
|
getVariables, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
equals
public void init()
AbstractStrategy
this
to be used in a search loopinit
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 duplicate(Solver solver, gnu.trove.map.hash.THashMap<Object,Object> identitymap)
IVariableMonitor
this
(which naturally adds it into solver
).
IMonitor should be duplicated only if it is about modeling and not solving (ie: search).duplicate
in interface IVariableMonitor<IntVar>
solver
- target solveridentitymap
- a map to guarantee uniqueness of objectspublic void beforeDownLeftBranch()
beforeDownLeftBranch
in interface IMonitorDownBranch
public void beforeDownRightBranch()
beforeDownRightBranch
in interface IMonitorDownBranch
public void afterDownLeftBranch()
afterDownLeftBranch
in interface IMonitorDownBranch
public void afterDownRightBranch()
afterDownRightBranch
in interface IMonitorDownBranch
public void beforeRestart()
beforeRestart
in interface IMonitorRestart
public void afterRestart()
afterRestart
in interface IMonitorRestart
public boolean why(RuleStore ruleStore, IntVar var, IEventType evt, int value)
ICause
Copyright © 2015. All rights reserved.