set_duration_with_idle_times
From the given nominal duration, the duration variable will be constrained to take the following values:
- duration if the task does not intersect any idle time window
- duration increased by total length of the intersecting idle time windows
- If a task T1 starts before s1 but its duration make it intersect [s1, e1), then its duration variable will be T1.duration = duration + e1 - s1
- If a task T2 starts before s1 but its updated duration make it intersect [s1, e1) and [s2, e2), then its duration variable will be T2.duration = duration + (e1 - s1) + (e2 - s2)
- If a task T3 starts in the idle interval [s1, e1), then its duration variable will be T3.duration = duration + (e1 - T3.start)
- If a task T4 starts in the idle interval [s1, e1) and its updated duration make it intersect [s2, e2) then its duration variable will be T4.duration = duration + (e1 - T4.start) + (e2 - s2)
When developing the model, it is recommended to check the start-based duration constraint by printing the constraint: cp_show_var_constraints(getduration(task))

procedure set_duration_with_idle_times(resource: cpresource, task:cptask, duration:integer, idle_starts:list of integer, idle_ends:list of integer, allow_start_in_idle:boolean)
resource
|
a resource
|
task
|
a task
|
duration
|
The expected nominal duration of the task without idle times
|
idle_starts
|
The idle time windows start (must be of same length as
idle_ends)
|
idle_ends
|
The idle time windows end (must be of same length as
idle_starts)
|
allow_start_in_idle
|
If true, the
task will be able to start in an idle time window.
|
© 2001-2024 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.