Package jsprit.analysis.toolbox

Examples of jsprit.analysis.toolbox.Plotter


    /*
     * Finally, the problem can be built. By default, transportCosts are crowFlyDistances (as usually used for vrp-instances).
     */
    VehicleRoutingProblem vrp = vrpBuilder.build();
   
    Plotter pblmPlotter = new Plotter(vrp);
    pblmPlotter.plot("output/solomon_C101_specifiedVehicleEndLocations.png","C101");
   
    /*
     * Define the required vehicle-routing algorithms to solve the above problem.
     *
     * The algorithm can be defined and configured in an xml-file.
     */
//    VehicleRoutingAlgorithm vra = new SchrimpfFactory().createAlgorithm(vrp);
    VehicleRoutingAlgorithm vra = VehicleRoutingAlgorithms.readAndCreateAlgorithm(vrp, "input/algorithmConfig_fix.xml");
    vra.setMaxIterations(20000);
//    vra.setPrematureBreak(100);
    vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/sol_progress.png"));
    /*
     * Solve the problem.
     *
     *
     */
    Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
   
    /*
     * Retrieve best solution.
     */
    VehicleRoutingProblemSolution solution = new SelectBest().selectSolution(solutions);
   
    /*
     * print solution
     */
    SolutionPrinter.print(solution);
   
    /*
     * Plot solution.
     */
//    SolutionPlotter.plotSolutionAsPNG(vrp, solution, "output/solomon_C101_specifiedVehicleEndLocations_solution.png","C101");
    Plotter solPlotter = new Plotter(vrp, solution);
    solPlotter.plot("output/solomon_C101_specifiedVehicleEndLocations_solution.png","C101");
   
   
    new GraphStreamViewer(vrp, solution).setRenderDelay(50).labelWith(Label.ID).setEnableAutoLayout(true).display();
 
   
View Full Code Here


    /*
     * Finally, the problem can be built. By default, transportCosts are crowFlyDistances (as usually used for vrp-instances).
     */
    VehicleRoutingProblem vrp = vrpBuilder.build();

    new Plotter(vrp).plot("output/solomon_C101.png", "C101");
   
    /*
     * Define the required vehicle-routing algorithms to solve the above problem.
     *
     * The algorithm can be defined and configured in an xml-file.
     */
    VehicleRoutingAlgorithm vra = new SchrimpfFactory().createAlgorithm(vrp);

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


    /*
     * print solution
     */
    SolutionPrinter.print(vrp, solution, SolutionPrinter.Print.VERBOSE);
   
    /*
     * Plot solution.
     */
    Plotter plotter = new Plotter(vrp,solution);
//    plotter.setBoundingBox(30, 0, 50, 20);
    plotter.plot("output/solomon_C101_solution.png", "C101");

    new GraphStreamViewer(vrp,solution).setCameraView(30, 30, 0.25).labelWith(Label.ID).setRenderDelay(100).display();
   
  }
View Full Code Here

     * Finally, the problem can be built. By default, transportCosts are crowFlyDistances (as usually used for vrp-instances).
     */
   
    final VehicleRoutingProblem vrp = vrpBuilder.build();
   
    new Plotter(vrp).plot("output/pd_solomon_r101.png", "pd_r101");
   
   
    /*
     * Define the required vehicle-routing algorithms to solve the above problem.
     *
     * The algorithm can be defined and configured in an xml-file.
     */
//    VehicleRoutingAlgorithm vra = new SchrimpfFactory().createAlgorithm(vrp);
    VehicleRoutingAlgorithm vra = VehicleRoutingAlgorithms.readAndCreateAlgorithm(vrp, "input/algorithmConfig_solomon.xml");
    vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/sol_progress.png"));
    /*
     * Solve the problem.
     *
     *
     */
    Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
   
    /*
     * Retrieve best solution.
     */
    VehicleRoutingProblemSolution solution = new SelectBest().selectSolution(solutions);
   
    /*
     * print solution
     */
    SolutionPrinter.print(solution);
   
    /*
     * Plot solution.
     */
//    SolutionPlotter.plotSolutionAsPNG(vrp, solution, "output/pd_solomon_r101_solution.png","pd_r101");
    Plotter plotter = new Plotter(vrp, solution);
    plotter.setLabel(Label.SIZE);
    plotter.plot("output/pd_solomon_r101_solution.png","pd_r101");

        //some stats
        SolutionAnalyser analyser = new SolutionAnalyser(vrp,solution,new SolutionAnalyser.DistanceCalculator() {

            @Override
View Full Code Here

   
    /*
     * Plot solution.
     */
//    SolutionPlotter.plotSolutionAsPNG(vrp, solution, "output/pd_solomon_r101_solution.png","pd_r101");
    Plotter plotter = new Plotter(vrp, solution);
    plotter.setLabel(Label.SIZE);
    plotter.plot("output/pd_solomon_r101_solution_open.png","pd_r101");
 
   
   
  }
View Full Code Here

//    vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/progress.png"));
    Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
   
    SolutionPrinter.print(vrp, Solutions.bestOf(solutions), jsprit.core.reporting.SolutionPrinter.Print.VERBOSE);

    new Plotter(vrp, Solutions.bestOf(solutions)).plot("output/p08_solution.png", "p08");
   
    new GraphStreamViewer(vrp,Solutions.bestOf(solutions)).setRenderDelay(50).display();
  }
View Full Code Here

    SolutionPrinter.print(bestSolution);
   
    /*
     * plot problem without solution
     */
    Plotter problemPlotter = new Plotter(problem);
    problemPlotter.plotShipments(true);
    problemPlotter.plot("output/simpleEnRoutePickupAndDeliveryExample_problem.png", "en-route pickup and delivery");
   
    /*
     * plot problem with solution
     */
    Plotter solutionPlotter = new Plotter(problem,Arrays.asList(Solutions.bestOf(solutions).getRoutes().iterator().next()));
    solutionPlotter.plotShipments(true);
    solutionPlotter.plot("output/simpleEnRoutePickupAndDeliveryExample_solution.png", "en-route pickup and delivery");
   
    new GraphStreamViewer(problem).setRenderShipments(true).display();
   
  }
View Full Code Here

   
    Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
   
    SolutionPrinter.print(Solutions.bestOf(solutions));
   
    new Plotter(vrp, Solutions.bestOf(solutions)).plot("output/yo.png", "po");
   
  }
View Full Code Here

    SolutionPrinter.print(bestSolution);
   
    /*
     * plot
     */
    Plotter plotter = new Plotter(problem,bestSolution);
    plotter.setLabel(Label.SIZE);
    plotter.plot("output/solution.png", "solution");

  }
View Full Code Here

    vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/progress.png"));
    Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
   
    SolutionPrinter.print(Solutions.bestOf(solutions));
   
    new Plotter(vrp, Solutions.bestOf(solutions)).plot("output/p01_solution.png", "p01");
   
    new GraphStreamViewer(vrp, Solutions.bestOf(solutions)).setRenderDelay(100).display();
   
  }
View Full Code Here

    SolutionPrinter.print(problem, bestSolution, SolutionPrinter.Print.VERBOSE);
   
    /*
     * plot problem without solution
     */
    Plotter problemPlotter = new Plotter(problem);
    problemPlotter.plotShipments(true);
    problemPlotter.setLabel(jsprit.analysis.toolbox.Plotter.Label.SIZE);
    problemPlotter.plot("output/transportOfDisabledPeopleExample_problem.png", "disabled people tp");

        Plotter solutionPlotter = new Plotter(problem,Solutions.bestOf(solutions));
        solutionPlotter.plotShipments(true);
        solutionPlotter.setLabel(jsprit.analysis.toolbox.Plotter.Label.SIZE);
        solutionPlotter.plot("output/transportOfDisabledPeopleExample_solution.png", "disabled people tp");

    new GraphStreamViewer(problem).labelWith(Label.ID).setRenderDelay(100).setRenderShipments(true).display();
   
    new GraphStreamViewer(problem,Solutions.bestOf(solutions)).labelWith(Label.ACTIVITY).setRenderDelay(100).setRenderShipments(true).display();
   
View Full Code Here

TOP

Related Classes of jsprit.analysis.toolbox.Plotter

Copyright © 2018 www.massapicom. 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.