- java.lang.Object
-
- org.chocosolver.solver.constraints.Constraint
-
- org.chocosolver.solver.constraints.ReificationConstraint
-
public class ReificationConstraint extends Constraint
Implication constraint: boolean b => constraint c Also known as half reification- Since:
- 02/2013
- Author:
- Jean-Guillaume Fages
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.chocosolver.solver.constraints.Constraint
Constraint.Status
-
-
Field Summary
Fields Modifier and Type Field Description protected BoolVar
bool
protected Constraint
falseCons
protected Constraint
trueCons
-
Fields inherited from class org.chocosolver.solver.constraints.Constraint
boolReif, propagators
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ReificationConstraint(BoolVar bVar, Constraint consIfBoolTrue, Constraint consIfBoolFalse)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activate(int idx)
ESat
isSatisfied()
Test if thisConstraint
object is satisfied, regarding itsPropagators
and itsVariable
current domains.String
toString()
-
Methods inherited from class org.chocosolver.solver.constraints.Constraint
checkNewStatus, computeMaxPriority, declareAs, getCidxInModel, getName, getOpposite, getPropagator, getPropagators, getStatus, ignore, isReified, makeOpposite, merge, post, reify, reifyWith, setName, setOpposite
-
-
-
-
Field Detail
-
bool
protected final BoolVar bool
-
trueCons
protected final Constraint trueCons
-
falseCons
protected final Constraint falseCons
-
-
Constructor Detail
-
ReificationConstraint
protected ReificationConstraint(BoolVar bVar, Constraint consIfBoolTrue, Constraint consIfBoolFalse)
-
-
Method Detail
-
activate
public void activate(int idx) throws ContradictionException
- Throws:
ContradictionException
-
isSatisfied
public ESat isSatisfied()
Description copied from class:Constraint
Test if thisConstraint
object is satisfied, regarding itsPropagators
and itsVariable
current domains. This method is called on each solution as a checker when assertions are enabled (-ea in VM parameters) It is also called for constraint reification (to state whether or not a constraint is satisfied) The method calls entailment checks ofthis
propagators- Overrides:
isSatisfied
in classConstraint
- Returns:
ESat.FALSE
if the constraint cannot be satisfied (from domain consideration),ESat.TRUE
if whatever future decisions are, the constraint will be satisfied for sure (without propagating domain modifications)ESat.UNDIFINED
otherwise (more decisions/filtering must be made before concluding about constraint satisfaction)
-
toString
public String toString()
- Overrides:
toString
in classConstraint
-
-