public class SetStrategy extends AbstractStrategy<SetVar>
Modifier and Type | Field and Description |
---|---|
protected DecisionOperator<SetVar> |
operator
A decision operator
|
protected SetValueSelector |
valSelector
How a value is selected
|
protected VariableSelector<SetVar> |
varSelector
How a variable is selected
|
vars
Constructor and Description |
---|
SetStrategy(SetVar[] scope,
VariableSelector<SetVar> varS,
SetValueSelector valS,
boolean enforceFirst)
Generic strategy to branch on set variables
|
Modifier and Type | Method and Description |
---|---|
Decision<SetVar> |
computeDecision(SetVar s)
Computes a decision to be applied to variable var
This method should be implemented in order to use search patterns
|
Decision<SetVar> |
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 |
getVariables, makeIntDecision, toString
protected VariableSelector<SetVar> varSelector
protected SetValueSelector valSelector
protected DecisionOperator<SetVar> operator
public SetStrategy(SetVar[] scope, VariableSelector<SetVar> varS, SetValueSelector valS, boolean enforceFirst)
scope
- SetVar array to branch onvarS
- variable selection strategyvalS
- integer selection strategyenforceFirst
- branching order true = enforce first; false = remove firstpublic 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<SetVar>
public Decision<SetVar> getDecision()
AbstractStrategy
null
.getDecision
in class AbstractStrategy<SetVar>
public Decision<SetVar> computeDecision(SetVar s)
AbstractStrategy
computeDecision
in class AbstractStrategy<SetVar>
s
- a variableCopyright © 2018. All rights reserved.