choco.bool
Class AbstractLargeBoolConstraint
java.lang.Object
choco.AbstractEntity
choco.AbstractConstraint
choco.bool.AbstractCompositeConstraint
choco.bool.AbstractLargeCompositeConstraint
choco.bool.AbstractLargeBoolConstraint
- All Implemented Interfaces:
- BoolConstraint, CompositeConstraint, Constraint, Entity, IntConstraint, IntVarEventListener, VarEventListener, Propagator, java.lang.Cloneable, java.util.EventListener
- Direct Known Subclasses:
- AbstractLargeBoolConstraintWithCounterOpposite, LargeConjunction
public abstract class AbstractLargeBoolConstraint
- extends AbstractLargeCompositeConstraint
- implements BoolConstraint
An abstract class for Boolean composition of more than two constraints
Method Summary |
int |
assignIndices(AbstractCompositeConstraint root,
int i,
boolean dynamicAddition)
performs the global numbering (wrt root) of the variables contained in the subtree this, starting from i |
java.lang.Object |
clone()
returns a copy of the constraint. |
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 |
protected void |
initAbstractLargeBoolConstraint()
|
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 class choco.bool.AbstractLargeCompositeConstraint |
getConstraintIdx, getIntVar, getLocalVarIndex, getNbSubConstraints, getNbVars, getNbVarsFromSubConst, getSubConstraint, getSubConstraintIdx, getVar, getVarIdxInOpposite, isCompletelyInstantiated, setConstraintIndex, setVar |
Methods inherited from class choco.AbstractConstraint |
awake, awakeOnVar, connectVar, constAwake, delete, fail, getEvent, getPlugIn, getPriority, getProblem, isActive, isEntailed, isEquivalentTo, opposite, setActive, setEntailed, setPassive, setPlugIn, substituteVar |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface choco.Propagator |
awake, awakeOnVar, constAwake, delete, getEvent, getPlugIn, getPriority, isCompletelyInstantiated, isConsistent, isEntailed, propagate |
statusBitVector
protected StoredIntVector statusBitVector
nbTrueStatus
protected StoredInt nbTrueStatus
nbFalseStatus
protected StoredInt nbFalseStatus
AbstractLargeBoolConstraint
public AbstractLargeBoolConstraint(Constraint[] subConstraints)
AbstractLargeBoolConstraint
public AbstractLargeBoolConstraint(Constraint[] subConstraints,
IntDomainVar[] moreVars)
clone
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
- Description copied from interface:
Constraint
- returns a copy of the constraint. This copy is a new object, may be a recursive copy in case
of composite constraints. The original and the copy share the same variables & plugins
- Specified by:
clone
in interface Constraint
- Overrides:
clone
in class AbstractLargeCompositeConstraint
- Returns:
-
- Throws:
java.lang.CloneNotSupportedException
initAbstractLargeBoolConstraint
protected void initAbstractLargeBoolConstraint()
getStatus
public java.lang.Boolean getStatus(int constIdx)
- Description copied from interface:
BoolConstraint
- returns the current status of one of its subconstraints
- Specified by:
getStatus
in interface BoolConstraint
- Parameters:
constIdx
- the index of the subconstraint
- Returns:
- Boolean.TRUE if the subconstraint is entailed, Boolean.FALSE if it is violated, NULL otherwise
getTargetStatus
public java.lang.Boolean getTargetStatus(int constIdx)
- Description copied from interface:
BoolConstraint
- returns the current target status of one of its subconstraints
- Specified by:
getTargetStatus
in interface BoolConstraint
- 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
public void setStatus(int constIdx,
boolean st)
- Description copied from interface:
BoolConstraint
- updates the status of one of its subconstraints
- Specified by:
setStatus
in interface BoolConstraint
- Parameters:
constIdx
- the index of the subconstraintst
- true if the subconstraint is entailed, false if it is violated
setTargetStatus
public void setTargetStatus(int constIdx,
boolean st)
- Description copied from interface:
BoolConstraint
- updates the target status of one of its subconstraints
- Specified by:
setTargetStatus
in interface BoolConstraint
- Parameters:
constIdx
- the index of the subconstraintst
- true if the subconstraint must be satisfied (thus propagated),
false if it must be violated (thus counter-propagated)
assignIndices
public int assignIndices(AbstractCompositeConstraint root,
int i,
boolean dynamicAddition)
- Description copied from interface:
Propagator
- performs the global numbering (wrt root) of the variables contained in the subtree this, starting from i
- Specified by:
assignIndices
in interface Propagator
- Overrides:
assignIndices
in class AbstractLargeCompositeConstraint
- Parameters:
root
- the overall root constraint, for which the variables are numberedi
- the index that will assigned to the first variable in the subtree this (originally 0)dynamicAddition
- whether the addition is undone automatically on backtracking
- Returns:
- the index of the last variable in the subtree
setSubConstraintStatus
public void setSubConstraintStatus(Constraint subConstraint,
boolean status,
int varOffset)
- Description copied from interface:
BoolConstraint
- records that the status of a subConstraint is now true
- Specified by:
setSubConstraintStatus
in interface BoolConstraint
- Parameters:
subConstraint
- the subconstraintstatus
- the new value of the status to be recordedvarOffset
- the offset for the local variable indexing in the subConstraint wrt the global numbering in this