choco.bool
Interface BoolConstraint

All Superinterfaces:
java.lang.Cloneable, CompositeConstraint, Constraint, Entity, java.util.EventListener, IntConstraint, IntVarEventListener, Propagator, VarEventListener
All Known Implementing Classes:
AbstractBinBoolConstraint, AbstractBinBoolConstraintWithCounterOpposite, AbstractLargeBoolConstraint, AbstractLargeBoolConstraintWithCounterOpposite, BinConjunction, BinDisjunction, Cardinality, Equiv, Guard, LargeConjunction, LargeDisjunction

public interface BoolConstraint
extends CompositeConstraint, IntConstraint

Boolean constraints are composite constraints who maintain for each sub-constraint: a status {unknown, true, false} indicating whether the subconstraint has been proven true or false a targetStatus {unknown, true, false} indicating whether the subconstraint should be true (in which case it is propagated) or false (in which case its opposite is propagated)


Method Summary
 java.lang.Boolean getStatus(int constIdx)
          returns the current status of one of its subconstraints
 java.lang.Boolean getTargetStatus(int constIdx)
          returns the current target status of one of its subconstraints
 void setStatus(int constIdx, boolean st)
          updates the status of one of its subconstraints
 void setSubConstraintStatus(Constraint subConstraint, boolean status, int varOffset)
          records that the status of a subConstraint is now true
 void setTargetStatus(int constIdx, boolean st)
          updates the target status of one of its subconstraints
 
Methods inherited from interface choco.bool.CompositeConstraint
getGlobalVarIndex, getNbSubConstraints, getSubConstraint, getSubConstraintIdx
 
Methods inherited from interface choco.integer.var.IntVarEventListener
awakeOnInf, awakeOnInst, awakeOnRem, awakeOnSup, getConstraintIdx, setConstraintIndex
 
Methods inherited from interface choco.prop.VarEventListener
addListener, isActive, setActive, setPassive
 
Methods inherited from interface choco.integer.IntConstraint
awakeOnBounds, awakeOnRemovals, getIntVar
 
Methods inherited from interface choco.Propagator
assignIndices, awake, awakeOnVar, constAwake, delete, getEvent, getPlugIn, getPriority, isCompletelyInstantiated, isConsistent, isEntailed, propagate
 
Methods inherited from interface choco.prop.VarEventListener
addListener, isActive, setActive, setPassive
 
Methods inherited from interface choco.integer.var.IntVarEventListener
awakeOnInf, awakeOnInst, awakeOnRem, awakeOnSup, getConstraintIdx, setConstraintIndex
 
Methods inherited from interface choco.prop.VarEventListener
addListener, isActive, setActive, setPassive
 

Method Detail

getStatus

java.lang.Boolean getStatus(int constIdx)
returns the current status of one of its subconstraints

Parameters:
constIdx - the index of the subconstraint
Returns:
Boolean.TRUE if the subconstraint is entailed, Boolean.FALSE if it is violated, NULL otherwise

getTargetStatus

java.lang.Boolean getTargetStatus(int constIdx)
returns the current target status of one of its subconstraints

Parameters:
constIdx - the index of the subconstraint
Returns:
Boolean.TRUE if the subconstraint must be satisfied (thus propagated), Boolean.FALSE if it must be violated (thus counter-propagated), NULL otherwise

setStatus

void setStatus(int constIdx,
               boolean st)
updates the status of one of its subconstraints

Parameters:
constIdx - the index of the subconstraint
st - true if the subconstraint is entailed, false if it is violated

setTargetStatus

void setTargetStatus(int constIdx,
                     boolean st)
updates the target status of one of its subconstraints

Parameters:
constIdx - the index of the subconstraint
st - true if the subconstraint must be satisfied (thus propagated), false if it must be violated (thus counter-propagated)

setSubConstraintStatus

void setSubConstraintStatus(Constraint subConstraint,
                            boolean status,
                            int varOffset)
records that the status of a subConstraint is now true

Parameters:
subConstraint - the subconstraint
status - the new value of the status to be recorded
varOffset - the offset for the local variable indexing in the subConstraint wrt the global numbering in this