public class ImpactBased extends AbstractStrategy<IntVar> implements IMonitorDownBranch, IMonitorContradiction, ICause
vars| Constructor and Description |
|---|
ImpactBased(IntVar[] vars,
boolean initOnly) |
ImpactBased(IntVar[] ivariables,
int alpha,
int split,
int nodeImpact,
long seed,
boolean initOnly)
Create an Impact-based search strategy with Node Impact strategy.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterDownBranch(boolean left)
Action to perform after going down in the tree search
|
void |
beforeDownBranch(boolean left)
Action to perform before going down in the tree search
|
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
|
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 |
onContradiction(ContradictionException cex) |
void |
setTimeLimit(long timeLimit) |
getVariables, makeIntDecision, toStringpublic ImpactBased(IntVar[] ivariables, int alpha, int split, int nodeImpact, long seed, boolean initOnly)
ivariables - variables of the problem (should be integers)alpha - aging parametersplit - split parameter for subdomains computationnodeImpact - force update of impacts every nodeImpact nodes. Set value to 0 to avoid using it.seed - a seed for randominitOnly - only apply the initialisation phase, do not update impact thereafterpublic ImpactBased(IntVar[] vars, boolean initOnly)
public Decision<IntVar> computeDecision(IntVar variable)
AbstractStrategycomputeDecision in class AbstractStrategy<IntVar>variable - a variablepublic Decision<IntVar> getDecision()
AbstractStrategynull.getDecision in class AbstractStrategy<IntVar>public void setTimeLimit(long timeLimit)
public boolean init()
AbstractStrategythis to be used in a search loop
The initialization can detect inconsistency, in that case, it returns falseinit in class AbstractStrategy<IntVar>public void onContradiction(ContradictionException cex)
onContradiction in interface IMonitorContradictionpublic void beforeDownBranch(boolean left)
IMonitorDownBranchbeforeDownBranch in interface IMonitorDownBranchleft - set to true to specify that this is a left branchpublic void afterDownBranch(boolean left)
IMonitorDownBranchafterDownBranch in interface IMonitorDownBranchleft - set to true to specify that this is a left branchCopyright © 2017. All rights reserved.