5.45. calendar
| DESCRIPTION | LINKS |
- Origin
- Constraint
- Type
- Arguments
- Restrictions
- Purpose
Makes the link between an universal calendar and resource dependent calendars. Given a collection of machines where each machine is defined by its identifier and its unavailability periods the constraint maps items of real and virtual dates depending on the machine assignment as well as of the fact that we consider start () or end () times. Virtual dates on a given machine do not consider the unavailability periods on , while real dates consider all time points.
- Example
-
FigureΒ 5.45.1 illustrates the example. It present four machines with their respective unavailability periods (in grey) as well as four tasks (in blue and pink). Each item of the collection corresponds to the start or to the end of one of the previous four tasks. The constraint holds since:
The real date 3 () associated with the start () of task (a) in the universal time corresponds to the virtual date 2 () on machine 1 ().
The real date 6 () associated with the end () of task (a) in the universal time corresponds to the virtual date 5 () on machine 1 ().
The real date 5 () associated with the start () of task (b) in the universal time corresponds to the virtual date 4 () on machine 2 ().
The real date 9 () associated with the end () of task (b) in the universal time corresponds to the virtual date 6 () on machine 2 ().
The real date 2 () associated with the start () of task (c) in the universal time corresponds to the virtual date 2 () on machine 3 ().
The real date 5 () associated with the end () of task (c) in the universal time corresponds to the virtual date 5 () on machine 3 ().
The real date 2 () associated with the start () of task (d) in the universal time corresponds to the virtual date 2 () on machine 4 ().
The real date 9 () associated with the end () of task (d) in the universal time corresponds to the virtual date 7 () on machine 4 ().
Figure 5.45.1. Four machines with their unavailability periods as well as four tasks assigned to these machines (virtual dates mentioned in the Example slot use a bold font)

- Typical
- Symmetries
Items of are permutable.
Items of are permutable.
- Usage
The constraint is used as a channelling constraint in resource scheduling problems where resources have unavailability periods that can preempt the execution of a task. In this context two time coordinates systems are used:
A first coordinate system, so called the virtual coordinate system, ignores all unavailability periods on the different resources. All resource constraints are stated within this virtual coordinate system.
A second coordinate system, so called the real coordinate system, corresponds to the real time. All temporal constraints (e.g.,Β precedence constraints) are stated within this real coordinate system.
In this context, each task has a virtual origin, a virtual duration, a virtual end, a real origin, a real duration, a real end and the constraint links together the virtual origin and the real origin as well as the virtual end and the real end. The virtual duration (i.e.,Β the real duration plus the sum of the unavailability periods crossed by the task) is linked to the virtual end and the virtual origin through an equality constraint on the difference between the virtual end and the virtual origin. The real duration is linked in a similar way to the real end and the real origin. The keyword scheduling with machine choice, calendars and preemption provides a concrete example of resource scheduling problem using the constraint.
- Reformulation
The constraint can be reformulated into two generalised constraints (i.e.,Β two constraints augmented with linear constraints). PartΒ (A) (respectively PartΒ (B)) of FigureΒ 5.45.2 provides the dag that allows mapping the virtual start and real start (respectively the virtual end and real end) of a task. This dag can be computed directly from the arguments of the constraint:
We create an initial root node labelled by and we partition the set of machines into classes of consecutive machines that all share exactly the same unavailability periods. For each such class we create an arc from the root node to a new node labelled by the corresponding interval of consecutive machines identifiers. In PartΒ (A) this corresponds to node and its three outgoing arcs respectively labelled by intervals , and .
For each class of consecutive machines found previously, we label in increasing order each timepoint that is not part of an unavailability period. We create an arc from the corresponding node for each maximum interval of available timepoints to a new node labelled by . In PartΒ (A) this translate to:
For the class corresponding to machines 1 and 2 we create three outgoing arcs labelled by the time intervals , and .
For the class corresponding to machine 3 we create the outgoing arc labelled by time interval .
For the class corresponding to machine 4 we create the two outgoing arcs labelled by the time intervals and .
For each class of consecutive machines and for each maximum interval of available timepoints previously computed, we find out the number of unavailable timepoints on the same class of machines that are located before the virtual coordinate . We create an outgoing arc from the corresponding node to a new node labelled by (there is one single node for the full dag). This arc is labelled by the interval and by the linear constraint . In PartΒ (A) this translate to:
For the class corresponding to machines 1 and 2 and for each node associated with the time intervals , and we respectively create an outgoing arc labelled by intervals , and . To each of these arcs we also respectively associate the linear constraints ( since on machines 1 and 2 there is no unavailability period before the virtual coordinate 1), ( since on machines 1 and 2 there is one single unavailable timepoint before the virtual coordinate 2) and ( since on machines 1 and 2 there is three unavailable timepoints before the virtual coordinate 5).
For the class corresponding to machine 3 and for the node associated with the time interval we create the outgoing arc labelled by time interval and by (i.e.,Β since their is no unavailability period at all on machine 3).
For the class corresponding to machine 4 and for each node associated with the time intervals and we respectively create an outgoing arc labelled by and . To each of these arcs we also respectively associate the linear constraints ( since on machine 4 there is no unavailability period before the virtual coordinate 1) and ( since on machine 4 there is two unavailable timepoints before the virtual coordinate 3).
Figure 5.45.2. The two generalised constraints for respectively mapping (1) the virtual start and real start of a task corresponding to the Example slot as well as (2) the virtual end and real end

- See also
common keyword: Β (scheduling constraint), , Β (scheduling with machine choice, calendars and preemption), Β (scheduling constraint),
Β (scheduling with machine choice, calendars and preemption).
- Keywords
constraint type: predefined constraint, temporal constraint, scheduling constraint.
modelling: channelling constraint, scheduling with machine choice, calendars and preemption, assignment dimension.
modelling exercises: scheduling with machine choice, calendars and preemption.