1
0
Fork 0
mirror of https://github.com/graphhopper/jsprit.git synced 2020-01-24 07:45:05 +01:00

OPTI-871: enable serialization of VehicleRoutingProblem

This commit is contained in:
hilaminster 2019-10-23 18:29:56 +03:00
parent 4102a3d488
commit c0218b3927

View file

@ -599,7 +599,11 @@ public class VehicleRoutingProblem {
this.jobs = builder.jobs;
this.fleetSize = builder.fleetSize;
this.vehicles = builder.uniqueVehicles;
this.vehicleTypes = builder.vehicleTypes.values();
//this allow us to serialize the vrp object, as builder.vehicleTypes.values() return transient collection
this.vehicleTypes = new HashSet<>();
vehicleTypes.addAll(builder.vehicleTypes.values());
this.initialVehicleRoutes = builder.initialRoutes;
this.transportCosts = builder.transportCosts;
this.activityCosts = builder.activityCosts;