public class IntStrategy extends AbstractStrategy<IntVar>
| Modifier and Type | Field and Description |
|---|---|
protected IntValueSelector |
valueSelector
How a value is selected
|
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.
|
DecisionOperator<IntVar> |
getDecisionOperator() |
IntValueSelector |
getValSelector() |
VariableSelector<IntVar> |
getVarSelector() |
boolean |
init()
Prepare
this to be used in a search loop
The initialization can detect inconsistency, in that case, it returns false |
getVariables, makeIntDecision, toStringprotected IntValueSelector valueSelector
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 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 Decision<IntVar> computeDecision(IntVar variable)
AbstractStrategycomputeDecision in class AbstractStrategy<IntVar>variable - a variablepublic Decision getDecision()
AbstractStrategynull.getDecision in class AbstractStrategy<IntVar>public VariableSelector<IntVar> getVarSelector()
public IntValueSelector getValSelector()
public DecisionOperator<IntVar> getDecisionOperator()
Copyright © 2017. All rights reserved.