Multi-core VRP

38 views
Skip to first unread message

James Nebeker

unread,
Jan 12, 2022, 5:31:06 PM1/12/22
to OptaPlanner development
Hey guys, I'm attempting to set up multi-threaded processing with VRP, and am running into an issue.FIrst, when running with no modifications I receive this error:

java.lang.IllegalArgumentException: The externalObject () cannot be looked up. Some functionality, such as multithreaded solving, requires this ability. Maybe add an @PlanningId annotation on an identifier property of the class (class []). Or otherwise, maybe change the @PlanningSolution annotation's LookUpStrategyType (not recommended)

Based on this, I added the @PlanningId annotation to my previousStandstill variable in my Ride class; the relevant line looks this like:

@PlanningVariable(valueRangeProviderRefs = { "vehicleRange",

            "rideRange" }, graphType = PlanningVariableGraphType.CHAINED)

    @PlanningId

    protected Standstill previousStandstill;

Now, I receive this error:


java.lang.IllegalArgumentException: The class (class org.acme.vehiclerouting.domain.timewindowed.TimeWindowedRide) has a member (protected org.acme.vehiclerouting.domain.Standstill org.acme.vehiclerouting.domain.Ride.previousStandstill) with a @PlanningId annotation that returns a type (interface org.acme.vehiclerouting.domain.Standstill) that does not implement Comparable.


Any help would be greatly appreciated.


Lukáš Petrovický

unread,
Jan 13, 2022, 2:05:06 AM1/13/22
to optapla...@googlegroups.com
On Wed, Jan 12, 2022 at 11:31 PM James Nebeker <jneb...@truckitapp.com> wrote:

java.lang.IllegalArgumentException: The class (class org.acme.vehiclerouting.domain.timewindowed.TimeWindowedRide) has a member (protected org.acme.vehiclerouting.domain.Standstill org.acme.vehiclerouting.domain.Ride.previousStandstill) with a @PlanningId annotation that returns a type (interface org.acme.vehiclerouting.domain.Standstill) that does not implement Comparable.


The message is saying that your PlanningId needs to implement the java.lang.Comparable interface. 
PlanningIds are typically Integers or Longs.

Regards!
 
--

Lukáš Petrovický

He/Him/His

Principal Software Engineer, Business Automation

lukas.pe...@redhat.com    IM: triceo/lpetrovi

My work week is Monday to Thursday.
Reply all
Reply to author
Forward
0 new messages