Invalidate span when there's a change in a planning entity

Viewed 33

So I hit the wall pretty hard on my current implementation. I have two planning entities: a machine and a task. The task has a custom shadow variable which calculates the task start time. It was all working well, however I needed to add a span when the task cannot start at the calculated time, because there are no employees available ( there's a fixed number of employees per machine ) To implement this last feature, after calculating the start time, if the task couldn't be started at that time it searches for the next available time where there are enough employees for this task to start. It is done by looping through the ordered planned tasks of all machines, and calculating if at the end of that task it has enough employees for this task. The problem with this is: this span time does not go away if the task it spanned until the end of changes position. I'll leave an image trying to explain this: example

Is there a better way to add these spans? Or if I'm in the right direction, is there a way to make sure optaplanner invalidates the start times and recalculates them when such a move occurs? Thank you in advance!

Update: I've managed to trigger the update for every entity after one changes, however this gets real slow real fast, but i do not see any other way around this, as if an entity changes it may cause lack of employees on another machine's entity, anyone has something else in mind for this issue?

0 Answers
Related