This rule’s schema is currently unstable. We recommend that new integrators
avoid using it until it has been stabilized. If you really need it, reach out
to the team for more details.
Fairness is a special type of rule that can be used to improve the fair distribution of (in)conveniences from other rules among employees. Some examples include the number of night shifts that employees have to work, the number of hours employees receive, and the number of times employees receive work during their preferred hours.
Rules that support fairness
A fairness rule must always apply to one or more other, non-fairness rules.
Since fairness rules compare the (in)conveniences that come from those rules,
they must be of the same type to ensure that they are comparable.
The current list of rule types that a fairness rule can apply to is as follows:
| Rule type | Fairness target impact |
|---|
| Availability (desired) | Equal amount of desired hours for all employees |
| Availability (undesired) | Equal amount of undesired hours for all employees |
| Utilization | Equal fraction of ideal hours or ideal shifts for all employees |
Example - Fairness on Availability
In order to make sure employees receive the same amount of desired or undesired work, you can send in a fairness rule that applies to a group of Availability rules.
In the example below, the solver will try to assign the same amount of undesired hours to employees 1 and 2. Notice that the undesired hours can come from different shifts. It might be that employee 1 does not want to work weekends, while employee 2 does not want to work on Mondays. The rule will make sure that the total amount of undesired hours is the same for both employees.{
"id": "fairness-undesired-availability",
"importance": "HIGH",
"filters": {
"rules": {
"ids": [
"undesired-availability-employee-1",
"undesired-availability-employee-2"
]
}
},
"applyRuleImportanceScaling": true
}
In addition, notice that the above fairness rule applies rule importance scaling. This means that if the undesired-availability-employee-1 rule has a higher importance than the undesired-availability-employee-2 rule, the solver will take this into account when comparing the (in)conveniences of the two rules.
Example - Fairness on Utilization
In general, when applying a fairness rule it makes most sense to apply it to rules that cover similar use cases. For example, on Utilization it can make sense to have separate fairness rules for employees’ total utilization and weekly utilization.
In the below example, the solver will try to make sure that employees 1 and 2 receive the same share of their ideal total hours and the same share of their ideal weekly hours.[
{
"id": "fairness-total-hours",
"importance": "VERY_HIGH",
"filters": {
"rules": {
"ids": ["total-utilization-employee-1", "total-utilization-employee-2"]
}
}
},
{
"id": "fairness-weekly-hours",
"importance": "HIGH",
"filters": {
"rules": {
"ids": [
"weekly-utilization-employee-1",
"weekly-utilization-employee-2"
]
}
}
}
]
It is also possible to apply a fairness rule to just one rule, but that will only have an effect if the rule applies to multiple employees. The example below shows a rule that will try to give all employees the same share of their weekly 40 hours.{
"id": "fairness-weekly-hours",
"importance": "VERY_HIGH",
"filters": {
"rules": {
"ids": ["utilization-40-hours-for-all-employees"]
}
}
}