choco.kernel.solver.constraints
Class ConstantSConstraint
java.lang.Object
choco.kernel.solver.propagation.Propagator
choco.kernel.solver.constraints.AbstractSConstraint<IntDomainVar>
choco.kernel.solver.constraints.integer.AbstractIntSConstraint
choco.kernel.solver.constraints.ConstantSConstraint
- All Implemented Interfaces:
- IExtensionnable, IPretty, SConstraint<IntDomainVar>, IntPropagator, Cloneable, EventListener
public class ConstantSConstraint
- extends AbstractIntSConstraint
Method Summary |
Object |
clone()
Clone the constraint |
boolean |
isConsistent()
tests if the constraint is consistent with respect to the current state of domains |
Boolean |
isEntailed()
Indicates if the constraint is entailed, from now on will be always satisfied |
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 |
propagate()
Propagation:
Propagating the constraint until local consistency is reached. |
Methods inherited from class choco.kernel.solver.constraints.AbstractSConstraint |
addExtension, addListener, getAbstractSConstraintExtensionNumber, getConstraintIdx, getExtension, getFineDegree, getNbVarNotInst, getNbVars, getVar, getVarQuick, isCompletelyInstantiated, opposite, setConstraintIndex, setExtension, setVar, toString |
Methods inherited from class choco.kernel.solver.propagation.Propagator |
activate, awake, constAwake, fail, getEvent, getFilteredEventMask, getPriority, isActive, setActive, setActiveSilently, setEntailed, setPassive, setPropagationEngine |
ConstantSConstraint
protected ConstantSConstraint(boolean value)
clone
public final Object clone()
throws CloneNotSupportedException
- Description copied from class:
AbstractSConstraint
- Clone the constraint
- Overrides:
clone
in class AbstractSConstraint<IntDomainVar>
- Returns:
- the clone of the constraint
- Throws:
CloneNotSupportedException
- Clone not supported exception
isSatisfied
public final 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
isSatisfied
public final 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
propagate
public final void propagate()
throws ContradictionException
- Description copied from class:
Propagator
- Propagation:
Propagating the constraint until local consistency is reached.
- Specified by:
propagate
in class Propagator
- Throws:
ContradictionException
- contradiction exception
isEntailed
public final Boolean isEntailed()
- Description copied from class:
AbstractSConstraint
- Indicates if the constraint is entailed, from now on will be always satisfied
- Overrides:
isEntailed
in class AbstractSConstraint<IntDomainVar>
- Returns:
- wether the constraint is entailed
isConsistent
public final boolean isConsistent()
- Description copied from class:
AbstractIntSConstraint
- tests if the constraint is consistent with respect to the current state of domains
- Overrides:
isConsistent
in class AbstractIntSConstraint
- Returns:
- true if the constraint is entailed (default approximate definition)
pretty
public final 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
Copyright © 2012. All Rights Reserved.