Class ActivityBased
- java.lang.Object
-
- org.chocosolver.solver.search.strategy.strategy.AbstractStrategy<IntVar>
-
- org.chocosolver.solver.search.strategy.selectors.variables.ActivityBased
-
- All Implemented Interfaces:
Comparator<IntVar>,ICause,IMonitorDownBranch,IMonitorRestart,ISearchMonitor,IVariableMonitor<IntVar>
public class ActivityBased extends AbstractStrategy<IntVar> implements IMonitorDownBranch, IMonitorRestart, IVariableMonitor<IntVar>, Comparator<IntVar>
Implementation of the search described in: "Activity-Based Search for Black-Box Constraint Propagramming Solver", Laurent Michel and Pascal Van Hentenryck, CPAIOR12.- Since:
- 07/06/12
- Author:
- Charles Prud'homme
-
-
Constructor Summary
Constructors Constructor Description ActivityBased(Model model, IntVar[] vars, double g, double d, int a, int samplingIterationForced, long seed)ActivityBased(IntVar[] vars)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterDownBranch(boolean left)Action to perform after going down in the tree searchvoidafterRestart()Actions to execute after restarting the searchvoidbeforeDownBranch(boolean left)Action to perform before going down in the tree searchvoidbeforeRestart()Actions to execute before restarting the searchintcompare(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 patternsdoublegetActivity(IntVar var)Decision<IntVar>getDecision()Provides access to the current decision in the strategy.booleaninit()Preparethisto be used in a search loop The initialization can detect inconsistency, in that case, it returns falsevoidonUpdate(IntVar var, IEventType evt)Operations to execute after updating the domain variable-
Methods inherited from class org.chocosolver.solver.search.strategy.strategy.AbstractStrategy
getVariables, makeIntDecision, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Method Detail
-
init
public boolean init()
Description copied from class:AbstractStrategyPreparethisto be used in a search loop The initialization can detect inconsistency, in that case, it returns false- Overrides:
initin classAbstractStrategy<IntVar>
-
computeDecision
public Decision<IntVar> computeDecision(IntVar variable)
Description copied from class:AbstractStrategyComputes a decision to be applied to variable var This method should be implemented in order to use search patterns- Overrides:
computeDecisionin classAbstractStrategy<IntVar>- Parameters:
variable- a variable- Returns:
- a decision to be applied to variable var
-
getDecision
public Decision<IntVar> getDecision()
Description copied from class:AbstractStrategyProvides access to the current decision in the strategy. If there are no more decision to provide, it returnsnull.- Specified by:
getDecisionin classAbstractStrategy<IntVar>- Returns:
- the current decision
-
compare
public int compare(IntVar o1, IntVar o2)
- Specified by:
comparein interfaceComparator<IntVar>
-
getActivity
public double getActivity(IntVar var)
-
onUpdate
public void onUpdate(IntVar var, IEventType evt)
Description copied from interface:IVariableMonitorOperations to execute after updating the domain variable- Specified by:
onUpdatein interfaceIVariableMonitor<IntVar>- Parameters:
var- variable concernedevt- modification event
-
beforeDownBranch
public void beforeDownBranch(boolean left)
Description copied from interface:IMonitorDownBranchAction to perform before going down in the tree search- Specified by:
beforeDownBranchin interfaceIMonitorDownBranch- Parameters:
left- set to true to specify that this is a left branch
-
afterDownBranch
public void afterDownBranch(boolean left)
Description copied from interface:IMonitorDownBranchAction to perform after going down in the tree search- Specified by:
afterDownBranchin interfaceIMonitorDownBranch- Parameters:
left- set to true to specify that this is a left branch
-
beforeRestart
public void beforeRestart()
Description copied from interface:IMonitorRestartActions to execute before restarting the search- Specified by:
beforeRestartin interfaceIMonitorRestart
-
afterRestart
public void afterRestart()
Description copied from interface:IMonitorRestartActions to execute after restarting the search- Specified by:
afterRestartin interfaceIMonitorRestart
-
-