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
My first stab on this uses the following rules:
$vehicle : VrpVehicle()
$customer : VrpCustomer(
vehicle == $vehicle,
$arrivalTime : arrivalTime)
VrpCustomerVisitArrivalTime($c : customer, $a : arrival)
not CustomerTimeWindow(customer == $c, $a > startTime, $a < endTime)
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).
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
Should I add each CustomerTimeWindow as a fact in the
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 <mats.noren(a)gmail.com> wrote:
Ok, so on the first rule should fire for all occurrences of a
since each Customer should have at least one visit?
It's not another planning variable,
> do something like
> insertLogical(new CustomerVisitArrivalTime(...));
> CustomerVisitArrivalTime($c : customer, $a : arrival)
> not CustomerTimeWindow(customer == $c, $a > start, $a < end)
> insertLogical(new IntConstraintOccurrence(...))
> 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!