startAtStart

Constrains the delay between the starts of two interval variables.

Syntax


constraint startAtStart(intervalVar a, intervalVar b, intExpr delay = 0)

Parameters

  • a: first interval variables
  • b: second interval variables
  • delay: exact delay between starts of a and b. If not specified then zero is used.

Description

The function startAtStart constrains interval variables a and b in the following way. If both intervals a and b are present then interval b must start exactly at startOf(a)+delay. If a or b is absent then the constraint is automatically satisfied.

The default value for delay is zero. Note that delay can be negative.

Example

There is mandatory task x and optional task y. If y is performed then it must start at the same time as x.


x = intervalVar(length = 5..10);
y = intervalVar(optional);
startAtStart(x, y);