Skip weekends. Does not work for holidays. To skip holidays too, cache all working days in scoreDirector.getWorkingSolution().getWorkCalendar(). Keep in sync with Programme.createStartDateList().
Starting from optaplanner-quickstarts's maintenance scheduling example:
solve()
) all working days and store them in a List<LocalDate>
in WorkCalendar
.MaintenanceSchedule.createStartDateList()
return that list as the planning value range.EndDateUpdatingVariableListener.calculateEndDate()
use that list instead of presuming it all weekdays (including holidays) are workdays.