Examples of VehicleRoutingAlgorithm


Examples of jsprit.core.algorithm.VehicleRoutingAlgorithm

    VehicleRoutingProblem vrp = vrpBuilder.build();
   
    //try also input//jsprit-examples/input/algorithmConfig_considerFixedCosts_routeLevel.xml
    //results might even be a bit better, but it is slower, since it checks insertion on routeLevel
    //rather than on local level
    VehicleRoutingAlgorithm vra = VehicleRoutingAlgorithms.readAndCreateAlgorithm(vrp, "input/algorithmConfig_considerFixedCosts.xml");
    vra.setMaxIterations(10000);
//    vra.setPrematureAlgorithmTermination(new IterationWithoutImprovementTermination(500));
    vra.addListener(new AlgorithmSearchProgressChartListener("output/progress.png"));
    Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
   
    VehicleRoutingProblemSolution best = Solutions.bestOf(solutions);
   
    SolutionPrinter.print(vrp, best, SolutionPrinter.Print.VERBOSE);
   
View Full Code Here

Examples of jsprit.core.algorithm.VehicleRoutingAlgorithm

    VehicleRoutingProblem problem = vrpBuilder.build();
   
    /*
     * get the algorithm out-of-the-box.
     */
    VehicleRoutingAlgorithm algorithm = VehicleRoutingAlgorithms.readAndCreateAlgorithm(problem, "input/algorithmConfig.xml");
//    algorithm.setNuOfIterations(30000);
    /*
     * and search a solution
     */
    Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();
   
    /*
     * get the best
     */
    VehicleRoutingProblemSolution bestSolution = Solutions.bestOf(solutions);
View Full Code Here

Examples of jsprit.core.algorithm.VehicleRoutingAlgorithm

        stateManager.updateSkillStates();

        ConstraintManager constraintManager = new ConstraintManager(skillProblem,stateManager);
        constraintManager.addSkillsConstraint();

        VehicleRoutingAlgorithm vra = vraBuilder.build();
//        vra.setNuOfIterations(500);


        Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
        VehicleRoutingProblemSolution solution = Solutions.bestOf(solutions);

        SolutionPrinter.print(skillProblem, solution, SolutionPrinter.Print.VERBOSE);

        new Plotter(skillProblem,solution).plot("output/skill_solution","solomon_with_skills");
View Full Code Here

Examples of jsprit.core.algorithm.VehicleRoutingAlgorithm

        vraBuilder.addDefaultCostCalculators();
        StateManager stateManager = new StateManager(problem);
        ConstraintManager constraintManager = new ConstraintManager(problem,stateManager);
        constraintManager.addConstraint(new ServiceDeliveriesFirstConstraint(), ConstraintManager.Priority.CRITICAL);
        vraBuilder.setStateAndConstraintManager(stateManager,constraintManager);
        VehicleRoutingAlgorithm algorithm = vraBuilder.build();
   
    /*
     * and search a solution
     */
    Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();
   
    /*
     * get the best
     */
    VehicleRoutingProblemSolution bestSolution = Solutions.bestOf(solutions);
View Full Code Here

Examples of jsprit.core.algorithm.VehicleRoutingAlgorithm

//        vraBuilder.addCoreConstraints();
        vraBuilder.addDefaultCostCalculators();
        vraBuilder.setStateAndConstraintManager(stateManager,constraintManager);

        VehicleRoutingAlgorithm vra = vraBuilder.build();
//        vra.setNuOfIterations(250); //v1.3.1
        vra.setMaxIterations(250); //head of development - upcoming release (v1.4)

        Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();

        SolutionPrinter.print(vrp, Solutions.bestOf(solutions), SolutionPrinter.Print.VERBOSE);

        new Plotter(vrp, Solutions.bestOf(solutions)).plot("output/plot","plot");
    }
View Full Code Here

Examples of jsprit.core.algorithm.VehicleRoutingAlgorithm

     * 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.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);
View Full Code Here

Examples of jsprit.core.algorithm.VehicleRoutingAlgorithm

        StateManager stateManager = new StateManager(problem);
        ConstraintManager constraintManager = new ConstraintManager(problem,stateManager);
        constraintManager.addConstraint(geoClusterConstraint);

        vraBuilder.setStateAndConstraintManager(stateManager,constraintManager);
        VehicleRoutingAlgorithm algorithm = vraBuilder.build();

    algorithm.setPrematureAlgorithmTermination(new IterationWithoutImprovementTermination(100));
//    algorithm.setNuOfIterations(30000);
    /*
     * and search a solution
     */
    Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();
   
    /*
     * get the best
     */
    VehicleRoutingProblemSolution bestSolution = Solutions.bestOf(solutions);
View Full Code Here

Examples of jsprit.core.algorithm.VehicleRoutingAlgorithm

   
    /*
     * get the algorithm out-of-the-box.
     */
    AlgorithmConfig algorithmConfig = getAlgorithmConfig();
    VehicleRoutingAlgorithm algorithm = VehicleRoutingAlgorithms.createAlgorithm(problem,algorithmConfig);
   
    /*
     * and search a solution
     */
    Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();
   
    /*
     * get the best
     */
    VehicleRoutingProblemSolution bestSolution = Solutions.bestOf(solutions);
View Full Code Here

Examples of jsprit.core.algorithm.VehicleRoutingAlgorithm

        ConstraintManager constraintManager = new ConstraintManager(vrp,stateManager);
        constraintManager.addConstraint(new GetUseAndDeliverKeySimpleHardActivityConstraint(stateManager,keyPicked,keyUsed,keyDelivered), ConstraintManager.Priority.CRITICAL);
        constraintManager.addConstraint(new GetUseAndDeliverHardRouteContraint(stateManager,keyPicked,keyUsed,keyDelivered));

        vraBuilder.setStateAndConstraintManager(stateManager,constraintManager);
        VehicleRoutingAlgorithm vra = vraBuilder.build();
        vra.setMaxIterations(100);

        Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();

        SolutionPrinter.print(vrp, Solutions.bestOf(solutions), SolutionPrinter.Print.VERBOSE);

        new GraphStreamViewer(vrp, Solutions.bestOf(solutions)).labelWith(GraphStreamViewer.Label.JOB_NAME).display();
View Full Code Here

Examples of jsprit.core.algorithm.VehicleRoutingAlgorithm

    new Plotter(vrp).setLabel(Label.ID).plot("output/cordeau01_problem_withInitialRoute.png", "c");

    /*
     * solve the problem
     */
    VehicleRoutingAlgorithm vra = VehicleRoutingAlgorithms.readAndCreateAlgorithm(vrp, "input/algorithmConfig_noVehicleSwitch.xml");
    Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
   
    SolutionPrinter.print(Solutions.bestOf(solutions));
   
    new Plotter(vrp, Solutions.bestOf(solutions)).setLabel(Label.ID).plot("output/cordeau01_solution_withInitialRoute.png", "p01");
   
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.