I am using the TimeWindowed version of the vehicle routing and I added to the vehicle an endOfShift time. I want to calculate the time of return to depot and make it hard constraint. The returnToDepotTime is calculate in the ArrivalTimeUpdatingVariableListener, and I also changed the drl file I added
rule "returnToDepotBeforeEndOfShift"
when
Vehicle(endOfShift < returnToDepotTime, $endOfShift : endOfShift, $returnToDepotTime : returnToDepotTime)
then
scoreHolder.addHardConstraintMatch(kcontext, $endOfShift - $returnToDepotTime.intValue()); end
The problem is that OptaPlanner does not take returnToDepotTime into consideration and it is calculated but not taken by the hard constrains calculation. Any idea what to change?