Employee schema
object
Attributes
Employee attributes provide a flexible way to specify custom characteristics for each employee. These attributes can be used to determine eligibility for shifts, demands, or tasks. In addition, some rules can be configured to apply to all employees that meet certain attribute requirements. Some good examples of characteristics where it might make sense to use attributes aredepartments, competences, or personnel-groups.
Each attribute must have its own unique category indicating what kind of attribute it is. An employee can have multiple values for the same attribute.
Here’s an example of how to specify attributes for an employee:
Preassigned shifts
It is possible to start the solver from a partially filled schedule where employees already have some shifts assigned to them. These are specified inpreassignedShifts. If these pre-assignments are set to isLocked, the solver will never change them. The solver therefore considers unlocked preassigned shifts as suggestions.
Read-only employees
You can set an employee toisReadOnly to indicate that the solver should only use their preassigned shifts and not assign them to any new shifts. This is useful when you want to preserve certain employee assignments while allowing the solver to optimize the rest of the schedule.
When an employee is marked as isReadOnly, the solver will:
- Use all their preassigned shifts (regardless of whether they are locked or unlocked)
- Not assign the employee to any additional shifts beyond their preassigned ones
