Module org.maxicp
Class IsEndBeforeStartWithTransition
java.lang.Object
org.maxicp.cp.engine.core.AbstractCPConstraint
org.maxicp.cp.engine.constraints.scheduling.IsEndBeforeStartWithTransition
- All Implemented Interfaces:
CPConstraint,ConcreteConstraint<ConcreteCPModel>
Reified temporal ordering constraint with transition times.
Links a boolean variable isBefore to the temporal ordering of two intervals
with minimum transition times:
isBefore = true⇔end(a) + transitionAB <= start(b)(interval a finishes before b starts, with at leasttransitionABin between)isBefore = false⇔end(b) + transitionBA <= start(a)(interval b finishes before a starts, with at leasttransitionBAin between)
The constraint propagates in three directions:
- Boolean → temporal: when
isBeforeis fixed, enforce the corresponding start/end bounds with transition times. - Temporal → boolean: when the temporal gap between the intervals is
large enough, fix
isBeforeto the entailed ordering. - Infeasibility detection: when one ordering is impossible (the earliest
end of one interval plus the transition exceeds the latest start of the other),
fix
isBeforeto the only feasible ordering.
This constraint is a building block of NoOverlapWithPosition and replaces the
more generically named NoOverlapBinaryWithTransitionTime in that context,
making the reified semantics explicit.
- Author:
- Pierre Schaus
-
Constructor Summary
ConstructorsConstructorDescriptionIsEndBeforeStartWithTransition(CPBoolVar isBefore, CPIntervalVar a, CPIntervalVar b, int transitionAB, int transitionBA) Creates a reified temporal ordering constraint with transition times. -
Method Summary
Methods inherited from class org.maxicp.cp.engine.core.AbstractCPConstraint
getSolver, isActive, isScheduled, priority, registerDelta, setActive, setScheduled, updateDeltas
-
Constructor Details
-
IsEndBeforeStartWithTransition
public IsEndBeforeStartWithTransition(CPBoolVar isBefore, CPIntervalVar a, CPIntervalVar b, int transitionAB, int transitionBA) Creates a reified temporal ordering constraint with transition times.- Parameters:
isBefore- boolean variable: true iff a ends before b starts (with transitionAB gap)a- first intervalb- second intervaltransitionAB- minimum gap between end(a) and start(b) when a precedes btransitionBA- minimum gap between end(b) and start(a) when b precedes a
-
-
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
-