public class IntStrategy extends AbstractStrategy<IntVar>
LOGGER, vars
Constructor and Description |
---|
IntStrategy(IntVar[] scope,
VariableSelector<IntVar> varSelector,
IntValueSelector valSelector)
Creates a search strategy which selects a variable X and a value V to perform
the decision X = V
BEWARE: if the variable domain is not enumerated, the value V should be a domain bound.
|
IntStrategy(IntVar[] scope,
VariableSelector<IntVar> varSelector,
IntValueSelector valSelector,
DecisionOperator<IntVar> decOperator)
Creates a search strategy which selects a variable X and a value V to perform
the decision X decOperator V
This can be X <= V for instance.
|
Modifier and Type | Method and Description |
---|---|
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 |
getDecision()
Provides access to the current decision in the strategy.
|
void |
init()
Prepare
this to be used in a search loop |
getVariables, toString
public IntStrategy(IntVar[] scope, VariableSelector<IntVar> varSelector, IntValueSelector valSelector)
scope
- defines which variables to branch onvarSelector
- defines how to select the next variable to branch onvalSelector
- defines how to select the value involved in the branching decisionpublic IntStrategy(IntVar[] scope, VariableSelector<IntVar> varSelector, IntValueSelector valSelector, DecisionOperator<IntVar> decOperator)
scope
- defines which variables to branch onvarSelector
- defines how to select the next variable to branch onvalSelector
- defines how to select the value involved in the branching decisiondecOperator
- defines what to do in a branching decisionpublic 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 getDecision()
AbstractStrategy
null
.getDecision
in class AbstractStrategy<IntVar>
Copyright © 2015. All rights reserved.