choco.cp.solver.constraints.global.scheduling.precedence
Class PrecedenceDisjoint

java.lang.Object
  extended by choco.kernel.solver.propagation.Propagator
      extended by choco.kernel.solver.constraints.AbstractSConstraint<IntDomainVar>
          extended by choco.kernel.solver.constraints.integer.AbstractIntSConstraint
              extended by choco.kernel.solver.constraints.integer.AbstractLargeIntSConstraint
                  extended by choco.cp.solver.constraints.global.scheduling.precedence.AbstractPrecedenceSConstraint
                      extended by choco.cp.solver.constraints.global.scheduling.precedence.PrecedenceDisjoint
All Implemented Interfaces:
ITemporalSRelation, IExtensionnable, IPretty, ITemporalRelation<TaskVar<?>,IntDomainVar>, SConstraint<IntDomainVar>, IntPropagator, Cloneable, EventListener

public final class PrecedenceDisjoint
extends AbstractPrecedenceSConstraint

Let b be a boolean variables; x1, x2 be two integer variables and k1, k2 two integers. This constraint enforce x1 before x2 if b is true or x2 before x1 if b is false. b = 1 <=> x1 + k1 <= x2 b = 0 <=> x2 + k2 <= x1


Field Summary
 
Fields inherited from class choco.cp.solver.constraints.global.scheduling.precedence.AbstractPrecedenceSConstraint
BIDX, k1, k2, reuseBool, task1, task2
 
Fields inherited from class choco.kernel.solver.constraints.AbstractSConstraint
cIndices, constraintType, extensions, vars
 
Fields inherited from class choco.kernel.solver.propagation.Propagator
active, constAwakeEvent, priority, propagationEngine
 
Fields inherited from interface choco.cp.solver.constraints.global.scheduling.precedence.ITemporalSRelation
PRESERVED_PRECISION
 
Fields inherited from interface choco.kernel.model.constraints.ITemporalRelation
BWD, FWD
 
Fields inherited from interface choco.kernel.solver.constraints.SConstraint
LOGGER
 
Constructor Summary
PrecedenceDisjoint(IntDomainVar x1, int k1, IntDomainVar x2, int k2, IntDomainVar b)
          b = 1 <=> x1 + k1 <= x2 b = 0 <=> x2 + k2 <= x1
PrecedenceDisjoint(TaskVar t1, int k1, TaskVar t2, int k2, IntDomainVar b)
           
 
Method Summary
 Boolean isP1Entailed()
           
 Boolean isP2Entailed()
           
 boolean isSatisfied()
          Default implementation of the isSatisfied by delegating to the isSatisfied(int[] tuple)
 boolean isSatisfied(int[] tuple)
          TEMPORARY: if not overriden by the constraint, throws an error to avoid bug using reified constraints in constraints that have not been changed to fulfill this api yet !
 String pretty()
          pretty printing of the object.
 void propagateP1()
           
 void propagateP2()
           
 String toString()
           
 
Methods inherited from class choco.cp.solver.constraints.global.scheduling.precedence.AbstractPrecedenceSConstraint
awakeOnBounds, awakeOnInf, awakeOnInst, awakeOnRemovals, awakeOnSup, backwardSetup, filterOnP1P2TowardsB, forwardSetup, getBackwardPreserved, getDestination, getDirection, getDirVal, getFilteredEventMask, getForwardPreserved, getOrigin, getTotalSlack, isEntailed, isEntailed, isFixed, isSatisfied, isSatisfied, pretty, pretty, pretty, propagate, propagate, propagate, setTasks
 
Methods inherited from class choco.kernel.solver.constraints.integer.AbstractIntSConstraint
awakeOnRem, getConstraintType, isConsistent
 
Methods inherited from class choco.kernel.solver.constraints.AbstractSConstraint
addExtension, addListener, clone, getAbstractSConstraintExtensionNumber, getConstraintIdx, getExtension, getFineDegree, getNbVarNotInst, getNbVars, getVar, getVarQuick, isCompletelyInstantiated, isEntailed, opposite, setConstraintIndex, setExtension, setVar
 
Methods inherited from class choco.kernel.solver.propagation.Propagator
activate, awake, constAwake, fail, getEvent, getPriority, isActive, setActive, setActiveSilently, setEntailed, setPassive, setPropagationEngine
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PrecedenceDisjoint

public PrecedenceDisjoint(IntDomainVar x1,
                          int k1,
                          IntDomainVar x2,
                          int k2,
                          IntDomainVar b)
b = 1 <=> x1 + k1 <= x2 b = 0 <=> x2 + k2 <= x1


PrecedenceDisjoint

public PrecedenceDisjoint(TaskVar t1,
                          int k1,
                          TaskVar t2,
                          int k2,
                          IntDomainVar b)
Method Detail

propagateP1

public final void propagateP1()
                       throws ContradictionException
Specified by:
propagateP1 in class AbstractPrecedenceSConstraint
Throws:
ContradictionException

propagateP2

public final void propagateP2()
                       throws ContradictionException
Specified by:
propagateP2 in class AbstractPrecedenceSConstraint
Throws:
ContradictionException

isP1Entailed

public final Boolean isP1Entailed()
Specified by:
isP1Entailed in class AbstractPrecedenceSConstraint

isP2Entailed

public final Boolean isP2Entailed()
Specified by:
isP2Entailed in class AbstractPrecedenceSConstraint

isSatisfied

public boolean isSatisfied()
Description copied from class: AbstractIntSConstraint
Default implementation of the isSatisfied by delegating to the isSatisfied(int[] tuple)

Specified by:
isSatisfied in interface SConstraint<IntDomainVar>
Overrides:
isSatisfied in class AbstractIntSConstraint
Returns:
true if the constraint is satisfied

isSatisfied

public boolean isSatisfied(int[] tuple)
Description copied from class: AbstractIntSConstraint
TEMPORARY: if not overriden by the constraint, throws an error to avoid bug using reified constraints in constraints that have not been changed to fulfill this api yet !

Specified by:
isSatisfied in interface IntPropagator
Overrides:
isSatisfied in class AbstractIntSConstraint

pretty

public String pretty()
Description copied from interface: IPretty
pretty printing of the object. This String is not constant and may depend on the context.

Specified by:
pretty in interface IPretty
Overrides:
pretty in class AbstractSConstraint<IntDomainVar>
Returns:
a readable string representation of the object

toString

public String toString()
Overrides:
toString in class AbstractPrecedenceSConstraint


Copyright © 2012. All Rights Reserved.