Cannot Lock Vehicle Twice

Dear Team Jsprit,

I attempted to modify the to add depots from a csv. However, after running the project, I got the following exception:

"Exception in thread “main” java.lang.IllegalStateException: cannot lock vehicle twice ***

at jsprit.core.problem.vehicle.VehicleFleetManagerImpl.lock(

at jsprit.core.algorithm.ResetAndIniFleetManager.informInsertionStarts(

at jsprit.core.algorithm.recreate.listener.InsertionListeners.informInsertionStarts(

at jsprit.core.algorithm.recreate.AbstractInsertionStrategy.insertJobs(

at jsprit.core.algorithm.module.RuinAndRecreateModule.runAndGetSolution(


at jsprit.core.algorithm.VehicleRoutingAlgorithm.searchSolutions(

at test.MultipleDepotExample.main(
Are there resources available for me to better understand what it means when it says that I cannot lock a vehicle twice?

Please advise. I would greatly appreciate your support.

Can you provide a simple example to reproduce this?

For anyone who encounters this problem in the future, I found the problem.

If you have multiple vehicles at each “depot” you need to name the vehicles uniquely. Vehicles sharing the same depot cannot have the same name… Pretty dumb bug on my end… should have been intuitive, but it wasnt.


Irr … this should not be. This must be avoided. Actually, the vrp
builder should have control over this. I am going to check this.

Am 02/02/16 um 20:33 schrieb kevin1:

Same ids for vehicles should not be possible anymore. See:

Thanks, Kevin for detecting this.