public abstract class AbstractStrategy<V extends Variable> extends Object
computeDecision(Variable)
which returns the next decision to apply.Modifier | Constructor and Description |
---|---|
protected |
AbstractStrategy(V... variables) |
Modifier and Type | Method and Description |
---|---|
protected Decision<V> |
computeDecision(V var)
Computes a decision to be applied to variable var
This method should be implemented in order to use search patterns
|
abstract Decision<V> |
getDecision()
Provides access to the current decision in the strategy.
|
V[] |
getVariables() |
boolean |
init()
Prepare
this to be used in a search loop
The initialization can detect inconsistency, in that case, it returns false |
protected IntDecision |
makeIntDecision(IntVar var,
int val)
Creates an assignment decision object for integer variables
Just a simple shortcut for :
solver.getDecisionPath().makeIntDecision(var,DecisionOperatorFactory.makeIntEq(),val);
|
void |
remove()
Remove the current strategy.
|
String |
toString()
Creates a
String object containing a pretty print of the current variables. |
@SafeVarargs protected AbstractStrategy(V... variables)
public boolean init()
this
to be used in a search loop
The initialization can detect inconsistency, in that case, it returns falsepublic void remove()
public abstract Decision<V> getDecision()
null
.public String toString()
String
object containing a pretty print of the current variables.protected Decision<V> computeDecision(V var)
var
- a variablepublic V[] getVariables()
protected final IntDecision makeIntDecision(IntVar var, int val)
var
- variable to branch onval
- value to branch onCopyright © 2018. All rights reserved.