choco.bool
Class AbstractBinBoolConstraintWithCounterOpposite

java.lang.Object
  extended by choco.AbstractEntity
      extended by choco.AbstractConstraint
          extended by choco.bool.AbstractCompositeConstraint
              extended by choco.bool.AbstractBinCompositeConstraint
                  extended by choco.bool.AbstractBinBoolConstraint
                      extended by choco.bool.AbstractBinBoolConstraintWithCounterOpposite
All Implemented Interfaces:
BoolConstraint, CompositeConstraint, Constraint, Entity, IntConstraint, IntVarEventListener, VarEventListener, Propagator, java.lang.Cloneable, java.util.EventListener
Direct Known Subclasses:
BinConjunction, Equiv

public abstract class AbstractBinBoolConstraintWithCounterOpposite
extends AbstractBinBoolConstraint

An abstract class storing the counterpart of each subconstraint + an index correspondence for variables (between subconstraints and opposite subconstraints)


Field Summary
 
Fields inherited from class choco.bool.AbstractBinBoolConstraint
statusBitVector
 
Fields inherited from class choco.bool.AbstractBinCompositeConstraint
const0, const1, offset
 
Fields inherited from class choco.AbstractConstraint
active, constAwakeEvent, hook, priority
 
Fields inherited from class choco.AbstractEntity
problem
 
Constructor Summary
AbstractBinBoolConstraintWithCounterOpposite(AbstractConstraint c1, AbstractConstraint c2)
           
 
Method Summary
 int assignIndices(AbstractCompositeConstraint root, int i, boolean dynamicAddition)
          Assigns indices to variables for the global constraint involving this one.
 java.lang.Object clone()
          Builds a copy of this constraint.
 Constraint getOppositeSubConstraint(int subConstIdx)
           
 void setSubConstraintStatus(Constraint subConstraint, boolean status, int varOffset)
          records that the status of a subConstraint is now true
 
Methods inherited from class choco.bool.AbstractBinBoolConstraint
getStatus, getTargetStatus, setStatus, setTargetStatus
 
Methods inherited from class choco.bool.AbstractBinCompositeConstraint
getConstraintIdx, getIntVar, getNbSubConstraints, getNbVars, getSubConstraint, getSubConstraintIdx, getVar, getVarIdxInOpposite, isCompletelyInstantiated, setConstraintIndex, setVar
 
Methods inherited from class choco.bool.AbstractCompositeConstraint
addListener, awakeOnBounds, awakeOnRemovals, getGlobalVarIndex
 
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 choco.AbstractEntity
pretty
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
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
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
 

Constructor Detail

AbstractBinBoolConstraintWithCounterOpposite

public AbstractBinBoolConstraintWithCounterOpposite(AbstractConstraint c1,
                                                    AbstractConstraint c2)
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Description copied from class: AbstractBinCompositeConstraint
Builds a copy of this constraint.

Specified by:
clone in interface Constraint
Overrides:
clone in class AbstractBinBoolConstraint
Returns:
a copy of this constraint
Throws:
java.lang.CloneNotSupportedException - if an problem occurs when cloning elements pf this constraint

assignIndices

public int assignIndices(AbstractCompositeConstraint root,
                         int i,
                         boolean dynamicAddition)
Description copied from class: AbstractBinCompositeConstraint
Assigns indices to variables for the global constraint involving this one.

Specified by:
assignIndices in interface Propagator
Overrides:
assignIndices in class AbstractBinCompositeConstraint
Parameters:
root - the global constraint including this one
i - the first available index
dynamicAddition - states if the constraint is added definitively
Returns:
the next available index for the global constraint

getOppositeSubConstraint

public Constraint getOppositeSubConstraint(int subConstIdx)

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
Overrides:
setSubConstraintStatus in class AbstractBinBoolConstraint
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