synchronize

OPL constraint (scheduling) used to synchronize the start and end of intervals.

context type
Model files (.mod)
boolean

Syntax

synchronize(a, B);

Where:

dvar interval a;
dvar interval B[];

Description

The constraint synchronize(a, {b1, .., bn}) makes intervals b1 . . . bn start and end together with interval a (if a is present). If a is not present, there is no constraint on b1 ... bn from this synchronize constraint.

The array B must be a one-dimensional array; for greater complexity, use the keyword all.

Note: This constraint cannot be used in a meta-constraint.

Example

using CP;

dvar interval a in 0..4;
dvar interval b[1..2] in 0..4;

subject to
{
 startOf(a)==2;
 endOf(a)==4;
 synchronize(a,b);
}

assert startOf(b[1])==2;
assert endOf(b[1])==4;
assert startOf(b[2])==2;
assert endOf(b[2])==4;