[ library(fd) | Reference Manual | Alphabetic Index ]

disjunction(?Start1, +Duration1, ?Start2, +Duration2, ?Flag)

Flag indicates which of the two non-overlapping tasks is scheduled as first. Either the one with starting time Start1 and duration Duration1 (then the value of Flag is 1), or the second one with starting time Start2 and duration Duration2 (and the Flag is 2).
A finite domain variable or integer
An integer
A finite domain variable or integer
An integer
A finite domain variable or integer


This constraint can be used to model two non-overlapping tasks with known durations. Given the starting times and durations, this constraint uses constructive disjunction to remove all inconsistent values from the domains of Start1 and Start2. In addition to maintaining their bounds in a consistent state, it also locally executes both cases (first task before the second one or voce versa) and removes all values which are not consistent with any of these two alternatives.

If Duration1 or Duration2 is not integer, it obtains a default domain.

Fail Conditions

Fails if there is no possibility to schedule given two tasks in any order under given conditions.




   [eclipse 5]: [X, Y]::1..10, disjunction_choose(X, 5, Y, 7, F).
   X = X[1..10]
   Y = Y[1..10]
   F = F[1, 2]
   Delayed goals:
   disjunction_choose_1(X[1..10], 5, Y[1..10], 7, F[1, 2])
   [eclipse 6]: [X, Y]::1..10, disjunction(X, 5, Y, 7, F).
   X = X[1..5, 8..10]
   Y = Y[1..3, 6..10]
   F = F
   Delayed goals:
   disjunction(X[1..5, 8..10], 5, Y[1..3, 6..10], 7, F)

See Also

disjunctive / 3, disjunction_choose / 5