Eliot GODARD
Eliot GODARD

Reputation: 1

Block Resource in Optaplanner Job scheduling

I've managed to use the Job scheduling example for a project I'm working on. I have an additionnal constraint I would like to add. Some Resources should be blocked sometimes. For example a Global renewable Resource shouldn't be used between minutes 10 to 20. Is it currently already doable or if not, how can it be done in the score calculation ?

Thanks

Upvotes: 0

Views: 96

Answers (1)

Geoffrey De Smet
Geoffrey De Smet

Reputation: 27312

Use a custom shadow variable listener to predict the starting time of each task.

Then simply have a hard constraint to check that the task won't overlap with its blocks. Penalize the amount of overlap to avoid a "score trap".

custom shadow variable listener

Upvotes: 1

Related Questions