Regarding A Channing Problem #1889
Ajay3oodles
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Im working on a VRP dummy project using a custom chaining heuristic. I’m traversing through employees E1, E2, E3 and a NoneEmployee placeholder to assign visits V1, V2, V3, V4, V5, V6.
Currently, if assigning a visit (e.g., V2) to E1 worsens the score, the existing code assigns V2 to NoneEmployee. However, this can cause a problem: V2 might have been a good fit for E2, but since it is already assigned to None, it is no longer considered for E2.
I want a better approach: instead of assigning V2 to NoneEmployee, I want to unassign the visit from the chain, i.e., break it from E1’s chain:
E1 -> V1 -> V2
Set V2.previous = null
Set V2.employeeShift = null
Update V1.nextVOB = null
However, when I try this, I get the following exception:
java.lang.IllegalStateException: The entity ([Visit-6ad18b4a-d911-49fe-a480-7c6601f23f40]) has a variable (previousVisitOrEmployee) with value (Employee{startDate=2025-10-24 07:00:00.0, endDate=2025-10-24 13:00:00.0, employee=Bethany McC, travelType=Car-Company}) which has a sourceVariableName variable (nextVisit) with a value (null) which is not that entity.
Verify the consistency of your input problem for that sourceVariableName variable.
I’m looking for guidance on how to safely unassign a visit from a chained planning variable so that it can be reassigned to other employees without breaking the chain.
Beta Was this translation helpful? Give feedback.
All reactions