In the above solution I need to prevent “pickupShipment 3” until shipment 2 has been delivered since it is already loaded in the vehicle. Any advice on how to achieve this would be appreciated.
Exception in thread "main" java.lang.IllegalStateException: state-id with name 'com.graphhopper.jsprit.examples.CostMatrixExample2$1@7714e963' cannot be created. it is already reserved internally.
at com.graphhopper.jsprit.core.algorithm.state.StateFactory.throwReservedIdException(StateFactory.java:56)
at com.graphhopper.jsprit.core.algorithm.state.StateManager.putRouteState(StateManager.java:439)
at com.graphhopper.jsprit.core.problem.constraint.PreventMidRoutePickupsConstraint.fulfilled(PreventMidRoutePickupsConstraint.java:63)
at com.graphhopper.jsprit.core.algorithm.recreate.AbstractInsertionCalculator.fulfilled(AbstractInsertionCalculator.java:69)
at com.graphhopper.jsprit.core.algorithm.recreate.ShipmentInsertionCalculator.getInsertionData(ShipmentInsertionCalculator.java:148)
at com.graphhopper.jsprit.core.algorithm.recreate.JobCalculatorSwitcher.getInsertionData(JobCalculatorSwitcher.java:40)
at com.graphhopper.jsprit.core.algorithm.recreate.VehicleTypeDependentJobInsertionCalculator.getInsertionData(VehicleTypeDependentJobInsertionCalculator.java:116)
at com.graphhopper.jsprit.core.algorithm.recreate.RegretInsertion.getScoredJob(RegretInsertion.java:187)
at com.graphhopper.jsprit.core.algorithm.recreate.RegretInsertion.nextJob(RegretInsertion.java:140)
at com.graphhopper.jsprit.core.algorithm.recreate.RegretInsertion.insertUnassignedJobs(RegretInsertion.java:112)
at com.graphhopper.jsprit.core.algorithm.recreate.AbstractInsertionStrategy.insertJobs(AbstractInsertionStrategy.java:91)
at com.graphhopper.jsprit.core.algorithm.InsertionInitialSolutionFactory.createSolution(InsertionInitialSolutionFactory.java:56)
at com.graphhopper.jsprit.core.algorithm.PrettyAlgorithmBuilder$1.informAlgorithmStarts(PrettyAlgorithmBuilder.java:116)
at com.graphhopper.jsprit.core.algorithm.listener.VehicleRoutingAlgorithmListeners.algorithmStarts(VehicleRoutingAlgorithmListeners.java:128)
at com.graphhopper.jsprit.core.algorithm.VehicleRoutingAlgorithm.algorithmStarts(VehicleRoutingAlgorithm.java:356)
at com.graphhopper.jsprit.core.algorithm.VehicleRoutingAlgorithm.searchSolutions(VehicleRoutingAlgorithm.java:229)
at com.graphhopper.jsprit.examples.CostMatrixExample2.readAndSolve(CostMatrixExample2.java:487)
at com.graphhopper.jsprit.examples.CostMatrixExample2.main(CostMatrixExample2.java:76)