Demands
Demand is the need for workforce and defines how many employees you need at work at any given time in the planning period. Specifying demands in the payload is done using the Demands
property.
Demands in the request payload
object (scheduleDaysWithoutWeekDays) = 1 properties List of days on which this demand exists. Multiple demands can exist on the same day. | |
Array of objects (shiftDemand) List of shift demands that exist on the days specified in the days field. | |
Array of objects (timeDemand) List of time demands that exist on the days specified in the days field. |
[- {
- "days": {
- "dayIndexes": {
- "example_1": {
- "value": [
- 0,
- 1,
- 2,
- 3
], - "summary": "First four days of the planning horizon."
}
}
}, - "shiftDemands": [
- {
- "shiftId": "string",
- "min": 0,
- "ideal": 0,
- "max": 0,
- "attributeRequirements": [
- {
- "example_1": {
- "value": {
- "id": "personnel_group",
- "values": [
- "personnel_group_morning",
- "personnel_group_afternoon"
], - "minimum": 1
}, - "summary": "This example shows a requirement for an employee to be part of either the \"personnel_group_morning\" or \"personnel_group_afternoon\". If the employee is part of both groups, the requirement is satisfied as well. The employee is allowed to also be part of other personnel groups that are not specified in the requirement."
}
}
], - "priority": 1
}
], - "timeDemands": [
- {
- "timeSlotId": "string",
- "min": 0,
- "ideal": 0,
- "max": 0,
- "priority": 1
}
]
}
]
The Automatic Rostering API allows you to define demand for workforce in two different ways:
ShiftDemand
allows you to specify demand by stating which shifts you need on which days, and how many people you need working those shifts.TimeDemand
allows you to specify demand by stating how many employees you need at different times of day throughout your schedule. The API will then assign shifts to cover the demand at those times.
A request to the Automatic Rostering API should either specify all demand as ShiftDemand
, or all demand as TimeDemand
. A combination of both is currently not supported.
Choose which type of demand suits your needs, then find below some pointers on how to configure the Demands
object for your use case.
ShiftDemand
If you have already configured Shifts in your request, then using these to specify ShiftDemand
is very simple. Consider the following example.
The following shows how to specify that on days 1 and 2 you require 2 people to work Shift A and 2 people to work Shift B, while on day 3 you only require 2 people working Shift B.
{
"demands": [
{
"days": {
"dayIndexes": [0, 1]
},
"shiftDemands": [
{
"shiftId": "ShiftA",
"ideal": 2
},
{
"shiftId": "ShiftB",
"ideal": 2
}
]
},
{
"days": {
"dayIndexes": [2]
},
"shiftDemands": [
{
"shiftId": "ShiftB",
"ideal": 2
}
]
}
]
}
TimeDemand
When demand is defined as the time periods for when employees are needed. Based on the available shifts, the solver then assigns employees to the shifts that are able to cover this demand.
A demand always belongs to a day, so in the cases where there are demand intervals spanning midnight, this has to be specified in separate demands.
If several demands with the same attributes overlap, they are merged together, as visualized in the below example with three demands that have overlapping time intervals.