Examples of VehicleRoutingProblemSolution


Examples of jsprit.core.problem.solution.VehicleRoutingProblemSolution

    Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
   
    /*
     * Retrieve best solution.
     */
    VehicleRoutingProblemSolution solution = new SelectBest().selectSolution(solutions);
   
    /*
     * print solution
     */
    SolutionPrinter.print(solution);
 
View Full Code Here

Examples of jsprit.core.problem.solution.VehicleRoutingProblemSolution

    Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
   
    /*
     * Retrieve best solution.
     */
    VehicleRoutingProblemSolution solution = new SelectBest().selectSolution(solutions);


    /*
     * print solution
     */
 
View Full Code Here

Examples of jsprit.core.problem.solution.VehicleRoutingProblemSolution

    Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();
   
    /*
     * get the best
     */
    VehicleRoutingProblemSolution bestSolution = Solutions.bestOf(solutions);
   
    /*
     * write out problem and solution to xml-file
     */
//    new VrpXMLWriter(problem, solutions).write("output/shipment-problem-with-solution.xml");
View Full Code Here

Examples of jsprit.core.problem.solution.VehicleRoutingProblemSolution

    Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
   
    /*
     * Retrieve best solution.
     */
    VehicleRoutingProblemSolution solution = new SelectBest().selectSolution(solutions);
   
    /*
     * print solution
     */
    SolutionPrinter.print(solution);
 
View Full Code Here

Examples of jsprit.core.problem.solution.VehicleRoutingProblemSolution

    Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();
   
    /*
     * get the best
     */
    VehicleRoutingProblemSolution bestSolution = Solutions.bestOf(solutions);
   
    new VrpXMLWriter(problem, solutions).write("output/problem-with-solution.xml");
   
    SolutionPrinter.print(problem, bestSolution, SolutionPrinter.Print.VERBOSE);
   
View Full Code Here

Examples of jsprit.core.problem.solution.VehicleRoutingProblemSolution

    VehicleRoutingProblem vrp = vrpBuilder.build();
   
    VehicleRoutingAlgorithm vra = VehicleRoutingAlgorithms.readAndCreateAlgorithm(vrp, "input/algorithmConfigWithSchrimpfAcceptance.xml");
    Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
   
    VehicleRoutingProblemSolution best = Solutions.bestOf(solutions);
   
    SolutionPrinter.print(vrp, best, SolutionPrinter.Print.VERBOSE);
   
    new GraphStreamViewer(vrp, best).setRenderDelay(100).display();
   
View Full Code Here

Examples of jsprit.core.problem.solution.VehicleRoutingProblemSolution


public class Solutions {
 
  public static VehicleRoutingProblemSolution bestOf(Collection<VehicleRoutingProblemSolution> solutions){
    VehicleRoutingProblemSolution best = null;
    for(VehicleRoutingProblemSolution s : solutions){
      if(best == null) best = s;
      else if(s.getCost() < best.getCost()) best = s;
    }
    return best;
  }
View Full Code Here

Examples of jsprit.core.problem.solution.VehicleRoutingProblemSolution

  public VehicleRoutingProblemSolution createSolution(final VehicleRoutingProblem vrp) {
    logger.info("create initial solution.");
    List<VehicleRoute> vehicleRoutes = new ArrayList<VehicleRoute>();
    vehicleRoutes.addAll(vrp.getInitialVehicleRoutes());
    Collection<Job> badJobs = insertion.insertJobs(vehicleRoutes, getUnassignedJobs(vrp));
    VehicleRoutingProblemSolution solution = new VehicleRoutingProblemSolution(vehicleRoutes, badJobs, Double.MAX_VALUE);
    double costs = solutionCostsCalculator.getCosts(solution);
    solution.setCost(costs);
    logger.info("creation done");
    return solution;
  }
View Full Code Here

Examples of jsprit.core.problem.solution.VehicleRoutingProblemSolution

    for(int run=0;run<runs;run++){
      VehicleRoutingAlgorithm vra = createAlgorithm(p);
      StopWatch stopwatch = new StopWatch();
      vra.getAlgorithmListeners().addListener(stopwatch,Priority.HIGH);
      Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
      VehicleRoutingProblemSolution best = Solutions.bestOf(solutions);
      vehicles[run] = best.getRoutes().size();
      results[run] = cost.getCost(best);
      times[run] = stopwatch.getCompTimeInSeconds();
    }
   
    return new BenchmarkResult(p, runs, results, times, vehicles);
View Full Code Here

Examples of jsprit.core.problem.solution.VehicleRoutingProblemSolution

    Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();
   
    /*
     * get the best
     */
    VehicleRoutingProblemSolution bestSolution = Solutions.bestOf(solutions);
   
    /*
     * write out problem and solution to xml-file
     */
    new VrpXMLWriter(problem, solutions).write("output/shipment-problem-with-solution.xml");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.