CREATE request
The Creation Solver can be used to assign shifts based on a given demand. Additional constraints can be placed on the
problem like limiting inter-shift-start-times, accounting for limited resources used by certain shifts and/or requiring
certain skills. Flexible work is executed as late as possible and user provided preferences and costs can be used by the
solver.
The input of the creation solver consists of two parts:
- The possible shifts and their properties
- The demands that must be fulfilled by those shifts
The demands can be provided in two different ways, in fixed or flexible format. These cannot be mixed. Based on which
type of demand is provided, the solver will run in fixed or flexible mode, more explanation on this later in the guide.
The output of the solver contains the selected shifts along with the amount of each shift that the solver assigned. The
output is the same for fixed and flexible mode.
The solver can run in two modes: Fixed Mode
and Flexible Mode
.
Fixed Mode
In Fixed Mode
the solver has no choice about when work needs to be done. In this mode, the input specifies how many
people we need at which point in time for what skill.
When a demand block that starts at 9am and ends at 10am has a demand
value of 3, that means that 3 people are required
for that skill between 9am and 10am.
Flexible Mode
In Flexible Mode
the solver has some freedom over when certain work can be done. In this mode, the input specifies
when volumes of work can be done and when they have to be completed.
When a demand block that starts at 9am and ends at 10am has a min
value of 60 and a max
value of 120, that means
that a minimum of 60 minutes of work needs to have been done by 10am and that the maximum amount of work that can be
done by 10am is 120 minutes.
This CREATE request
schema is used for solving a Shift Creation Problem. It consists of demands
and shift templates
, options
and weights
.
Demand
The demands are used to specify when shifts of each skill are needed. When using fixed mode only the demand
field
needs to be specified. When using flexible mode only the min
and max
fields of the demands need to be specified. A
solver instance can only contain fixed or flexible demands, not both.
Property | Type | Description |
---|---|---|
from | string (iso DateTime) | Start time of the Demand block. |
to | string (iso DateTime) | End time of the Demand block. |
skill | string | The skill that is required to fulfil this demand. |
demand | integer | The number of people needed during this Demand block. (when using fixed mode) |
min | integer | The minimum total number of minutes that need to have been assigned to this skill by the end of this Demand block (when using flexible mode). |
max | integer | The maximum total number of minutes that can be been assigned to this skill by the end of this Demand block (when using flexible mode). |
Template
Property | Type | Description |
---|---|---|
patterns | Array of Pattern | A list of Patterns defining at what times this shift takes place. |
skill | string | specifies the employee type that will perform the shift. Should match with a Demand skill field. |
min | integer | Minimum number of people that have to be assigned to this shift. If this is known, provide it to the solver as it will speed up results. |
max | integer | Maximum number of people that can be assigned to this shift. If this is known, provide it to the solver as it will speed up results. |
resources | Array of Resource Requirement | The different resources and the number of each resource needed to execute this shift for one person (eg. 1 hammer). |
cost | integer | The cost of assigning a single person to this shift. |
preference | integer | A number that behaves like the cost of a shift. Used to specify a preference between two shifts that have the same cost. |
value | integer | This is actually the decision being taken by the solver: the number of shifts to create. Optionally, you can provide a value here to override the solver's decision as a warm start. |
Pattern
Property | Type | Description |
---|---|---|
from | string (iso DateTime) | Start time of the shift pattern. |
to | string (iso DateTime) | End time of the shift pattern. |
breaks | Array of Break | A list of breaks that take place between the from and to time. |
Break
Property | Type | Description |
---|---|---|
start | string (iso DateTime) | Start time of this break. |
end | string (iso DateTime) | End time of this break. |
Resource Requirement
Used to specify that a shift requires a certain resource during the times when the shift takes place.
For example, a shift with skill 'worker' needs 1 hammer.
Property | Type | Description |
---|---|---|
resourceName | string | The name of the required resource. A resource with this name also needs to be present in the resourceAvaliability list. |
value | integer | The amount of this resource that are needed when assigning 1 person to the shifts that holds this Resource Requirement. |
Resource Availability
Used to specify which resources are available at all times and how many there are available of each resource.
An example would be that there are 5 hammers available.
Property | Type | Description |
---|---|---|
resourceName | string | The name of the available resource. |
max | integer | How many units of the available resource can be used simultaneously. |
Example
In the example of Single Day Shift Creation
we will be testing a simple demand curve against 2 patterns from 9am to
5pm and 10am to 2pm.
{
"solver": "CREATE",
"demands": [
{
"from": "2021-10-04T08:15:00",
"to": "2021-10-04T11:30:00",
"skill": "mechanic",
"demand": 3
},
{
"from": "2021-10-04T11:30:00",
"to": "2021-10-04T15:15:00",
"skill": "mechanic",
"demand": 6
}
],
"resourceAvailabilities": [
{
"resourceName": "screwdriver",
"max": 10
}
],
"patterns": [
{
"name": "MON:9-5",
"skill": "mechanic",
"min": 0,
"max": 10,
"cost": 80,
"preference": 10,
"resourceRequirements": [
{
"resourceName": "screwdriver",
"value": 1
}
],
"definition": [
{
"from": "2021-10-04T09:00:00",
"to": "2021-10-04T17:00:00",
"breaks": [
{
"start": "2021-10-04T12:00:00",
"end": "2021-10-04T13:00:00"
}
]
}
]
},
{
"name": "FLEX:10-14",
"skill": "mechanic",
"min": 0,
"max": 10,
"cost": 45,
"preference": 0,
"resourceRequirements": [
{
"resourceName": "screwdriver",
"value": 1
}
],
"definition": [
{
"from": "2021-10-04T10:00:00",
"to": "2021-10-04T14:00:00"
}
]
}
]
}
{
"solver": "CREATE",
"demands": [
{
"from": "2021-10-04T08:15:00",
"to": "2021-10-04T11:30:00",
"skill": "mechanic",
"min": 0,
"max": 180
},
{
"from": "2021-10-04T11:30:00",
"to": "2021-10-04T15:15:00",
"skill": "mechanic",
"min": 120,
"max": 480
}
],
"resourceAvailabilities": [
{
"resourceName": "screwdriver",
"max": 10
}
],
"patterns": [
{
"name": "MON:9-5",
"skill": "mechanic",
"min": 0,
"max": 10,
"cost": 80,
"preference": 10,
"resourceRequirements": [
{
"resourceName": "screwdriver",
"value": 1
}
],
"definition": [
{
"from": "2021-10-04T09:00:00",
"to": "2021-10-04T17:00:00",
"breaks": [
{
"start": "2021-10-04T12:00:00",
"end": "2021-10-04T13:00:00"
}
]
}
]
},
{
"name": "FLEX:10-14",
"skill": "mechanic",
"min": 0,
"max": 10,
"cost": 45,
"preference": 0,
"resourceRequirements": [
{
"resourceName": "screwdriver",
"value": 1
}
],
"definition": [
{
"from": "2021-10-04T10:00:00",
"to": "2021-10-04T14:00:00"
}
]
}
]
}
Updated 7 months ago