Not really a constraint

Skip to first unread message

Kevin Layman

Oct 16, 2022, 3:30:29 PM10/16/22
to OptaPlanner development

I'm looking at using Optaplanner for a specific employee rostering use case where employees do not have to stay to the end of their shift when work is completed early, but there is a specific order in which they are allowed to leave, referred to as the "first out" list.

The employee's position on the list continually cycles. 1st out, 2nd out, ..., until they move from last out back to 1st out.

I'm new to Optaplanner and this type of programming and I have examined lots of constraint examples, but remain clueless as to how to implement this.

Any suggestions?



Kevin Layman

Oct 16, 2022, 3:34:25 PM10/16/22
to OptaPlanner development
And FYI, there are different types of employees and that has to be taken into account when creating the out list. For example temporary contracts are always put in the out list below full-time contracts, so it is not just a first in last out type of pattern.

Osamu Kuniyasu

Nov 20, 2022, 4:00:40 AM11/20/22
to OptaPlanner development
It's rate response, but...

You assign a shift (not a job) to each employee for a given date, but the actual hours worked on that date vary from employee to employee based on "the out list", and you want to balance the total working hours?

You could add a shadow variable to contain the actual duration of working in each planning entity...(A)
and add a rule for fairness to minimize gap of its summary for each employee...(B)

I expect some risks to implement.
Before and After applying a Move, change of an entity leads changes of other entities. This affects the performance a lot.
Structure of (A) may complex, and the rule of (B) has complex "accumulate".

Instead of such a complex implementation in the planning part, I recommend an implementation that updates the "out list" daily based on the accumulated time of early departures up to the previous day. The process of updating the "out list" daily can be easily implemented in the system.

Best Regards,
Osamu Kuniyasu

2022年10月17日月曜日 4:34:25 UTC+9
Reply all
Reply to author
0 new messages