We are try to use EmployeeSchedule algorithm for n-n shift-employee schedule. But the algorithm assigns only one employee per shift. For this case we find that we need to use planning_variable_list decorator (as shown as in the vehicle algorihm) and with this decorator we update our domain class. But our constraints are not working after we do this updates and we couldn't find any example to use constraints like situation that we are in.
our constraint example:
def one_shift_per_day(constraint_factory: ConstraintFactory):
return constraint_factory \
.for_each_unique_pair(Shift,
Joiners.equal(lambda shift: shift.employees),
Joiners.equal(lambda shift: shift.start.date())
) \
.penalize("Max one shift per day", HardSoftScore.ONE_HARD)
After we run the solition we are getting this error:
RuntimeError: An error occurred during solving. This can occur when functions take the wrong number of parameters (ex: a setter that does not take exactly one parameter) or by a function returning an incompatible return type (ex: returning a str in a filter, which expects a bool). This can also occur when an exception is raised when evaluating constraints/getters/setters.
If you may tell us that in the EmployeeSchedule how to do that we can manage to make it in our project