optimizationconstraintsoptaplannerplanninglogistics

Is there a way in Optaplanner to deactivate a whole planning entity during planning if it is not needed?


I have a set of tasks to organize in Optaplanner. Each task has 2 planning variables: 1) when the task starts and 2) how long it should be.

However, I do not need all the tasks to be scheduled. To account for this, I added a new Boolean variable "active", that can be True or False. To reduce the search space, I would like that for tasks that have "active = False" the algorithm does not consider the other two planning variables (time and duration).

Is there a way to achieve this?


Solution

  • In both OptaPlanner and Timefold, two concepts apply:

    The former allows you to specify that not all entities need to be assigned. (Their variables may be left to null.) The latter allows you to specify that an entity should not be touched at all, its variables be kept in the original state.

    The solution you are looking for would be a combination of the two. That said, I am not entirely sure of what happens if you change the value of a pin while the solver is running. That is something that needs to be experimented with.