java.lang.Object
org.maxicp.cp.engine.core.AbstractCPConstraint
org.maxicp.cp.engine.constraints.scheduling.IntervalVarStartOrValue
- All Implemented Interfaces:
CPConstraint,ConcreteConstraint<ConcreteCPModel>
Constraint linking the start time of an interval variable
var to an integer variable start
when var is present, or fixing start to a default value when var is absent.- Author:
- Charles Thomas
-
Constructor Summary
ConstructorsConstructorDescriptionIntervalVarStartOrValue(CPIntervalVar var, CPIntVar start, int value) Creates a constraint enforcingstart == start(var)ifvaris present, andstart == valueifvaris absent. -
Method Summary
Methods inherited from class org.maxicp.cp.engine.core.AbstractCPConstraint
getSolver, isActive, isScheduled, priority, registerDelta, setActive, setScheduled, updateDeltas
-
Constructor Details
-
IntervalVarStartOrValue
Creates a constraint enforcingstart == start(var)ifvaris present, andstart == valueifvaris absent.- Parameters:
var- the interval variablestart- the integer variable representing the start ofvarorvaluevalue- the fallback value assigned tostartwhenvaris absent
-
-
Method Details
-
post
public void post()Description copied from interface:CPConstraintInitializes the constraint when it is posted to the solver.- Specified by:
postin interfaceCPConstraint- Overrides:
postin classAbstractCPConstraint
-
propagate
public void propagate()Description copied from interface:CPConstraintPropagates the constraint.- Specified by:
propagatein interfaceCPConstraint- Overrides:
propagatein classAbstractCPConstraint
-