The example only does the capacitated vehicle routing problem (VRP + capacity limits), not the windowed vehicle routing problem.What I didn't grasp is how the rule in your example is using the CustomerTimeWindow? I'm assuming the CustomerTimeWindow is a property on VrpCustomer?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).My first stab on this uses the following rules: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.Hi Geoffrey,After a long period away from this problem I've come back to it and I'm feeling a bit lost :-)
$vehicle : VrpVehicle()
$customer : VrpCustomer(
vehicle == $vehicle,
$arrivalTime : arrivalTime)
insertLogical(new VrpCustomerVisitArrivalTime($customer, $arrivalTime));
VrpCustomerVisitArrivalTime($c : customer, $a : arrival)
not CustomerTimeWindow(customer == $c, $a > startTime, $a < endTime)
insertLogical(new IntConstraintOccurrence("arrivalWithinTimeWindow", ConstraintType.HARD, -$a, $c))
Yes, so your score rules can exploit it.Should I add each CustomerTimeWindow as a fact in the VrpSchedule.getProblemFacts?
Btw, I'm using drools-planner 6.0.0-SNAPSHOT.
I like the new name OptaPlanner.
On Tue, Nov 20, 2012 at 1:54 PM, Mats Norén <email@example.com> wrote:
Ok, so on the first rule should fire for all occurrences of a Customer since each Customer should have at least one visit?
It's not another planning variable,
do something like
CustomerVisitArrivalTime($c : customer, $a : arrival)
not CustomerTimeWindow(customer == $c, $a > start, $a < end)
See nurseRosteringScoreRules.drl for an example of use of
insertLogical's like that
rules-users mailing list
Btw, thanks for your help and thanks for a great product!
_______________________________________________ rules-users mailing list firstname.lastname@example.org https://lists.jboss.org/mailman/listinfo/rules-users