Advertisement
Guest User

Untitled

a guest
Sep 14th, 2017
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.62 KB | None | 0 0
  1. VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
  2. vrpBuilder.addAllJobs(services);
  3. vrpBuilder.addAllVehicles(vehicles);
  4. EuclideanCosts costs = new EuclideanCosts();
  5. // Here I tried 0, 1000, 50, 20, nothing changes
  6. costs.speed = 500;
  7. vrpBuilder.setRoutingCost(costs);
  8. vrpBuilder.setFleetSize(FleetSize.FINITE);
  9. VehicleRoutingProblem vrp = vrpBuilder.build();
  10. VehicleRoutingAlgorithm vra = Jsprit.Builder.newInstance(vrp) .setProperty(Jsprit.Parameter.FAST_REGRET, "true")
  11. .setProperty(Jsprit.Parameter.THREADS, "4")
  12. .buildAlgorithm();
  13. Collection tempSolutions = vra.searchSolutions();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement