- Function cp::SizeOfPrevious(sequentialResource, scheduledActivity, firstValue, absentValue)
cp::SizeOfPrevious
The function cp::SizeOfPrevious
refers to the size of the previous
activity in a sequence of activities. A size is an integer in the range
\(\{0..card(\texttt{problem schedule domain})-1\}\). For a resource
\(r\), an activity \(a\), sizes \(f\) and \(d\), the
function cp::SizeOfPrevious(r,a,f,d)
returns
\(d\) if \(a\) is absent,
\(f\) if \(a\) is present and scheduled as the first activity on \(r\), and
\(p\texttt{.size}\) if \(a\) is present and not scheduled as the first activity on \(r\), and \(p\) is the previous activity of \(a\) scheduled on \(r\).
cp::SizeOfPrevious(
sequentialResource, ! (input) an expression
scheduledActivity, ! (input) an expression
firstValue, ! (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.
- firstValue
An optional expression that results in a size. The default of this expression is 0.
- absentValue
An optional expression that results in a size. The default of this expression is 0.
Return Value
This function returns a size.
See also
The functions
cp::BeginOfPrevious
andcp::EndOfNext
, andConstraint Programming on Constraint Programming in the Language Reference.