Hi Geoffrey,
After a long period away from this problem I've come back to it and I'm feeling a bit lost :-)
Could you elaborate on how to best model the rules and domain objects. I've looked at the nurse rostering example but didn't find any clues on how to proceed.
My first stab on this uses the following rules:
rule "arrivalTime"
when
$vehicle : VrpVehicle()
$customer : VrpCustomer(
vehicle == $vehicle,
$arrivalTime : arrivalTime)
then
insertLogical(new VrpCustomerVisitArrivalTime($customer, $arrivalTime));
end
rule "arrivalWithinTimeWindow"
when
VrpCustomerVisitArrivalTime($c : customer, $a : arrival)
not CustomerTimeWindow(customer == $c, $a > startTime, $a < endTime)
then
insertLogical(new IntConstraintOccurrence("arrivalWithinTimeWindow", ConstraintType.HARD, -$a, $c))
end
I've added a method arrivalTime to VrpCustomer that walks the VrpAppearances to the Depot and accumulates the travel time between each appearance. (I'm using GraphHopper and the OpenStreetMap roadnetwork). This works similar to the getDistance(VrpLocation location).