choco.bool
Class BinDisjunction

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.BinDisjunction
All Implemented Interfaces:
BoolConstraint, CompositeConstraint, Constraint, Entity, IntConstraint, IntVarEventListener, VarEventListener, Propagator, java.lang.Cloneable, java.util.EventListener

public class BinDisjunction
extends AbstractBinBoolConstraint


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
BinDisjunction(AbstractConstraint c1, AbstractConstraint c2)
           
 
Method Summary
 void awakeOnBounds(int i)
           
 void awakeOnInf(int i)
          Default propagation on improved lower bound: propagation on domain revision.
 void awakeOnInst(int i)
          Default propagation on instantiation: full constraint re-propagation.
 void awakeOnRem(int i, int x)
          Default propagation on one value removal: propagation on domain revision.
 void awakeOnRemovals(int i, IntIterator deltaDomain)
           
 void awakeOnSup(int i)
          Default propagation on improved upper bound: propagation on domain revision.
protected  void checkStatus(int i)
           
 java.lang.Object clone()
          Builds a copy of this constraint.
 boolean isConsistent()
          tests if the constraint is consistent with respect to the current state of domains
 java.lang.Boolean isEntailed()
          Checks whether the constraint is definitely satisfied, no matter what further restrictions occur to the domain of its variables.
 boolean isEquivalentTo(Constraint compareTo)
          tests the equivalence (logical equality of the conditions) between two constraints.
 boolean isSatisfied()
          Semantic: Testing if the constraint is satisfied.
 AbstractConstraint opposite()
          computes the constraint modelling the counter-opposite condition of this
 java.lang.String pretty()
          Pretty print of the constraint.
 void propagate()
          Propagation: Propagating the constraint until local consistency is reached.
 
Methods inherited from class choco.bool.AbstractBinBoolConstraint
getStatus, getTargetStatus, setStatus, setSubConstraintStatus, setTargetStatus
 
Methods inherited from class choco.bool.AbstractBinCompositeConstraint
assignIndices, getConstraintIdx, getIntVar, getNbSubConstraints, getNbVars, getSubConstraint, getSubConstraintIdx, getVar, getVarIdxInOpposite, isCompletelyInstantiated, setConstraintIndex, setVar
 
Methods inherited from class choco.bool.AbstractCompositeConstraint
addListener, getGlobalVarIndex
 
Methods inherited from class choco.AbstractConstraint
awake, awakeOnVar, connectVar, constAwake, delete, fail, getEvent, getPlugIn, getPriority, getProblem, isActive, 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.bool.CompositeConstraint
getGlobalVarIndex, getNbSubConstraints, getSubConstraint, getSubConstraintIdx
 
Methods inherited from interface choco.integer.var.IntVarEventListener
getConstraintIdx, setConstraintIndex
 
Methods inherited from interface choco.prop.VarEventListener
addListener, isActive, setActive, setPassive
 
Methods inherited from interface choco.integer.IntConstraint
getIntVar
 
Methods inherited from interface choco.Propagator
assignIndices, awake, awakeOnVar, constAwake, delete, getEvent, getPlugIn, getPriority, isCompletelyInstantiated
 
Methods inherited from interface choco.prop.VarEventListener
addListener, isActive, setActive, setPassive
 
Methods inherited from interface choco.integer.var.IntVarEventListener
getConstraintIdx, setConstraintIndex
 
Methods inherited from interface choco.prop.VarEventListener
addListener, isActive, setActive, setPassive
 

Constructor Detail

BinDisjunction

public BinDisjunction(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

pretty

public java.lang.String pretty()
Pretty print of the constraint.

Specified by:
pretty in interface Entity
Overrides:
pretty in class AbstractEntity
Returns:
a readable string representation of the object

checkStatus

protected void checkStatus(int i)
                    throws ContradictionException
Throws:
ContradictionException

awakeOnInf

public void awakeOnInf(int i)
                throws ContradictionException
Default propagation on improved lower bound: propagation on domain revision.

Throws:
ContradictionException

awakeOnSup

public void awakeOnSup(int i)
                throws ContradictionException
Description copied from interface: IntVarEventListener
Default propagation on improved upper bound: propagation on domain revision.

Throws:
ContradictionException

awakeOnBounds

public void awakeOnBounds(int i)
                   throws ContradictionException
Specified by:
awakeOnBounds in interface IntConstraint
Overrides:
awakeOnBounds in class AbstractCompositeConstraint
Throws:
ContradictionException

awakeOnInst

public void awakeOnInst(int i)
                 throws ContradictionException
Description copied from interface: IntVarEventListener
Default propagation on instantiation: full constraint re-propagation.

Throws:
ContradictionException

awakeOnRemovals

public void awakeOnRemovals(int i,
                            IntIterator deltaDomain)
                     throws ContradictionException
Specified by:
awakeOnRemovals in interface IntConstraint
Overrides:
awakeOnRemovals in class AbstractCompositeConstraint
Throws:
ContradictionException

awakeOnRem

public void awakeOnRem(int i,
                       int x)
                throws ContradictionException
Description copied from interface: IntVarEventListener
Default propagation on one value removal: propagation on domain revision.

Throws:
ContradictionException

isSatisfied

public boolean isSatisfied()
Description copied from interface: Constraint
Semantic: Testing if the constraint is satisfied. Note that all variables involved in the constraint must be instantiated when this method is called.


isConsistent

public boolean isConsistent()
Description copied from interface: Propagator
tests if the constraint is consistent with respect to the current state of domains


isEntailed

public java.lang.Boolean isEntailed()
Description copied from interface: Propagator
Checks whether the constraint is definitely satisfied, no matter what further restrictions occur to the domain of its variables.

Specified by:
isEntailed in interface Propagator
Overrides:
isEntailed in class AbstractConstraint

propagate

public void propagate()
               throws ContradictionException
Description copied from interface: Propagator
Propagation: Propagating the constraint until local consistency is reached.

Throws:
ContradictionException

opposite

public AbstractConstraint opposite()
Description copied from interface: Constraint
computes the constraint modelling the counter-opposite condition of this

Specified by:
opposite in interface Constraint
Overrides:
opposite in class AbstractConstraint
Returns:
a new constraint (modelling the opposite condition)

isEquivalentTo

public boolean isEquivalentTo(Constraint compareTo)
Description copied from interface: Constraint
tests the equivalence (logical equality of the conditions) between two constraints. In particular whenever c1.equals(c2), then c1.isEquivalent(c2).

Specified by:
isEquivalentTo in interface Constraint
Overrides:
isEquivalentTo in class AbstractConstraint
Parameters:
compareTo - the constraint to be compared to
Returns:
true if and only if the constraints model the same logical condition.