MinAbsDifference
|
Minimizes the total absolute difference between required resources per period and resources scheduled by the solver. |
Runs the optimization solver |
- class pyworkforce.scheduling.MinAbsDifference(num_days: int, periods: int, shifts_coverage: dict, required_resources: list, max_period_concurrency: int, max_shift_concurrency: int, max_search_time: float = 120.0, num_search_workers=2, *args, **kwargs)[source]
Minimizes the total absolute difference between required resources per period and resources scheduled by the solver.
- Parameters:
- num_days: int,
Number of days to schedule.
- periods: int,
Number of working periods in a day.
- shifts_coverage: dict,
Dictionary of the form
{"shift_name": shift_array}, where eachshift_arrayhas lengthperiodsand uses 1 when the shift covers a period, otherwise 0.- required_resources: list,
Array of size
[days, periods].- max_period_concurrency: int,
Maximum resources allowed in any period and day.
- max_shift_concurrency: int,
Maximum resources allowed in the same shift.
- max_search_time: float, default = 240
Maximum time, in seconds, to search for a solution.
- num_search_workers: int, default = 2
Number of workers used to search for a solution.