[rules-users] Planner: Vehicle Routing, but with return to home after last delivery

jimirn jimirn at gmail.com
Thu Sep 27 04:03:19 EDT 2012


Hi all,

I have changed the Vehicle Routing example to suit my domain model.

My domain is:
- Consultant (the person that will drive to a DeliveryPlace and spent some
time there, each Consultant has a max total time available, implements
Appearance)
- DeliveryPlace (the place where a Consultant will drive to and spent some
time making a delivery, implements Appearance)
- Location (a Consultant has a home and a DeliveryPlace has a location) 

I need the soft constraints to take into account returning from last
DeliveryPlace to the home location of the Consultant. 

But how do I know if a DeliveryPlace is the last one so I can add that to
the rule ?

Right now I have a rule that just takes each DeliveryPlace and calculates
minutes to previousAppearance:

rule "minutesToPreviousAppearance"
    when
        $deliveryPlace : DeliveryPlace(previousAppearance != null,
$minutesToPreviousAppearance : minutesToPreviousAppearance)
    then
        insertLogical(new
IntConstraintOccurrence("minutesToPreviousAppearance",
ConstraintType.NEGATIVE_SOFT,
                $minutesToPreviousAppearance,
                $deliveryPlace));
end



--
View this message in context: http://drools.46999.n3.nabble.com/Planner-Vehicle-Routing-but-with-return-to-home-after-last-delivery-tp4019990.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list