Function cp::LengthOfNext(sequentialResource, scheduledActivity, lastValue, absentValue)

cp::LengthOfNext

The function cp::LengthOfNext refers to the length of the next activity in a sequence of activities. A length is an integer in the range \(\{0..card(\texttt{problem schedule domain})-1\}\). For a resource \(r\), an activity \(a\), lengths \(l\) and \(d\), the function cp::LengthOfNext(r,a,l,d) returns

  • \(d\) if \(a\) is absent,

  • \(l\) if \(a\) is present and scheduled as the last activity on \(r\), and

  • \(n\texttt{.length}\) if \(a\) is present and not scheduled as the last activity on \(r\), and \(n\) is the next activity of \(a\) scheduled on \(r\).

cp::LengthOfNext(
        sequentialResource,  ! (input) an expression
        scheduledActivity,   ! (input) an expression
        lastValue,           ! (optional) an expression
        absentValue          ! (optional) an expression
)

Arguments

sequentialResource

An expression that results in a sequential resource.

scheduledActivity

An expression that results in an activity.

lastValue

An optional expression that results in a length. The default value of this expression is 0.

absentValue

An optional expression that results in a length. The default value of this expression is 0.

Return Value

This function returns a length.

See also