-
Bug
-
Resolution: Done
-
Critical
-
6.3.0.CR2
-
NEW
-
NEW
Here is the deal:
in bxms test-suite we have few tests that uses custom phase first to initialize solution and then run LS. This specific one uses (very) old VRP even without shadow variables, so it's basically a primitive chaining problem.
Custom phase creates a well designed solution. Problem is, that if I pass this solution into another phase, I've got:
The planning value (1 vehicle-0) has multiple inverse entities ([2(after 1), 2(after 1)]) pointing to it from sourceVariable (previousAppearance).
at org.optaplanner.core.impl.domain.variable.inverserelation.ExternalizedSingletonInverseVariableSupply.getInverseSingleton(ExternalizedSingletonInverseVariableSupply.java:129)
at org.optaplanner.core.impl.heuristic.selector.move.generic.chained.ChainedChangeMove.doMoveOnGenuineVariables(ChainedChangeMove.java:56)
at org.optaplanner.core.impl.heuristic.move.AbstractMove.doMove(AbstractMove.java:34)
when I take solution after custom phase and create new solver instance with LS only and run it there, everything is fine, so there is some inconsistency.
there are two scenarios:
1. custom phase is broken due to your refactoring which is fine because custom phase is not public api, but I don't see any comment about it in upgrade-recipe.
2. there must be some kind of bug.
What custom phase does:
for (int i = 0; i < customers.size(); i++) { VrpCustomer customer = customers.get(i); VrpAppearance tmpAppearance = (i == 0) ? vehicles.get(0) : customers.get(i - 1); scoreDirector.beforeVariableChanged(customer, "previousAppearance"); customer.setPreviousAppearance(tmpAppearance); scoreDirector.afterVariableChanged(customer, "previousAppearance"); }