Class IntDecision
- java.lang.Object
-
- org.chocosolver.solver.search.strategy.decision.Decision<IntVar>
-
- org.chocosolver.solver.search.strategy.decision.IntDecision
-
- All Implemented Interfaces:
Serializable,ICause
public class IntDecision extends Decision<IntVar>
A decision based on aIntVar- Since:
- 2 juil. 2010
- Author:
- Charles Prud'homme
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.chocosolver.solver.search.strategy.decision.Decision
branch, max_branching, var
-
-
Constructor Summary
Constructors Constructor Description IntDecision(PoolManager<IntDecision> poolManager)Create an decision based on anIntVar
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapply()Apply the current decisionIntDecisionduplicate()IntDecisionflip()voidfree()Free the decision, ie, it can be reusedIntegergetDecisionValue()Return the value object involves in the decisionDecisionOperator<IntVar>getDecOp()booleanisEquivalentTo(Decision dec)voidreverse()Reverse the decision operatorvoidset(IntVar v, int value, DecisionOperator<IntVar> assignment)Instantiate this decision with the parametersStringtoString()booleanwhy(RuleStore ruleStore, IntVar var, IEventType evt, int value)Add new rules to the rule store-
Methods inherited from class org.chocosolver.solver.search.strategy.decision.Decision
buildNext, getArity, getDecisionVariable, getPosition, hasNext, rewind, set, setPosition, setRefutable, triesLeft
-
-
-
-
Constructor Detail
-
IntDecision
public IntDecision(PoolManager<IntDecision> poolManager)
Create an decision based on anIntVar- Parameters:
poolManager- decision pool manager, to recycle decisions
-
-
Method Detail
-
getDecisionValue
public Integer getDecisionValue()
Description copied from class:DecisionReturn the value object involves in the decision- Specified by:
getDecisionValuein classDecision<IntVar>- Returns:
- a value object
-
apply
public void apply() throws ContradictionExceptionDescription copied from class:DecisionApply the current decision- Specified by:
applyin classDecision<IntVar>- Throws:
ContradictionException- if the application of this decision fails
-
set
public void set(IntVar v, int value, DecisionOperator<IntVar> assignment)
Instantiate this decision with the parameters- Parameters:
v- a variablevalue- a valueassignment- a decision operator
-
reverse
public void reverse()
Description copied from class:DecisionReverse the decision operator
-
free
public void free()
Description copied from class:DecisionFree the decision, ie, it can be reused
-
duplicate
public IntDecision duplicate()
-
isEquivalentTo
public boolean isEquivalentTo(Decision dec)
- Overrides:
isEquivalentToin classDecision<IntVar>- Parameters:
dec- a decision- Returns:
- true if the two decisions are equivalent (same variable, same operator, same value)
-
getDecOp
public DecisionOperator<IntVar> getDecOp()
- Returns:
- the current decision operator
-
flip
public IntDecision flip()
- Returns:
- a copy of this decision wherein the he decision operator is reversed
-
why
public boolean why(RuleStore ruleStore, IntVar var, IEventType evt, int value)
Description copied from interface:ICauseAdd new rules to the rule store- Parameters:
ruleStore- the rule storevar- the modified variableevt- the undergoing eventvalue- the value (for REMOVE only)- Returns:
- true if at least one rule has been added to the rule store
-
-