Examples of GreedySchrimpfFactory


Examples of jsprit.core.algorithm.box.GreedySchrimpfFactory

    vra_withThreshold.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/schrimpfThreshold_progress.png"), Priority.LOW);
    vra_withThreshold.getAlgorithmListeners().addListener(new StopWatch(), Priority.HIGH);
    /*
     * Get greedy schrimpf
     */
    VehicleRoutingAlgorithm vra_greedy = new GreedySchrimpfFactory().createAlgorithm(vrp);
    vra_greedy.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/schrimpfGreedy_progress.png"), Priority.LOW);
    vra_greedy.getAlgorithmListeners().addListener(new StopWatch(), Priority.HIGH);

    /*
     * run both
View Full Code Here

Examples of jsprit.core.algorithm.box.GreedySchrimpfFactory

    vrpBuilder.setRoutingCost(matrixBuilder.build());
   
    VehicleRoutingProblem vrp = vrpBuilder.build();
   
    VehicleRoutingAlgorithm vra = new GreedySchrimpfFactory().createAlgorithm(vrp);
    vra.setPrematureAlgorithmTermination(new IterationWithoutImprovementTermination(100));
    Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
   
    SolutionPrinter.print(Solutions.bestOf(solutions));
   
View Full Code Here

Examples of jsprit.core.algorithm.box.GreedySchrimpfFactory

        VehicleRoutingProblem.Builder vrpBuilder_ = VehicleRoutingProblem.Builder.newInstance();
        new VrpJsonReader(vrpBuilder_).read("output/vpr.json");
        VehicleRoutingProblem vrp_ = vrpBuilder_.build();

        VehicleRoutingAlgorithm vra = new GreedySchrimpfFactory().createAlgorithm(vrp_);
        VehicleRoutingProblemSolution solutions = Solutions.bestOf(vra.searchSolutions());

        new VrpJsonWriter(vrp,solutions,new SolutionAnalyser.DistanceCalculator() {

            @Override
View Full Code Here

Examples of jsprit.core.algorithm.box.GreedySchrimpfFactory

        builder.addJob(job1);
        Service job2 = Service.Builder.newInstance("job2").setCoord(Coordinate.newInstance(2, 2)).setTimeWindow(TimeWindow.newInstance(12, 24)).setServiceTime(1).build();
        builder.addJob(job2);

        VehicleRoutingProblem vrp = builder.build();
        VehicleRoutingAlgorithm algorithm = new GreedySchrimpfFactory().createAlgorithm(vrp);
        algorithm.setMaxIterations(10);
        Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();

        VehicleRoutingProblemSolution solution = Solutions.bestOf(solutions);
        assertTrue(!solution.getUnassignedJobs().contains(job1));
View Full Code Here

Examples of jsprit.core.algorithm.box.GreedySchrimpfFactory

        builder.addJob(job1);
        Service job2 = Service.Builder.newInstance("job2").setCoord(Coordinate.newInstance(2, 2)).addSizeDimension(0,10).setTimeWindow(TimeWindow.newInstance(0, 12)).setServiceTime(1).build();
        builder.addJob(job2);

        VehicleRoutingProblem vrp = builder.build();
        VehicleRoutingAlgorithm algorithm = new GreedySchrimpfFactory().createAlgorithm(vrp);
        algorithm.setMaxIterations(10);
        Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();

        VehicleRoutingProblemSolution solution = Solutions.bestOf(solutions);
        assertTrue(!solution.getUnassignedJobs().contains(job1));
View Full Code Here

Examples of jsprit.core.algorithm.box.GreedySchrimpfFactory

        VehicleRoute iniRoute = VehicleRoute.Builder.newInstance(vehicle).addPickup(shipment).addDelivery(shipment).build();

        VehicleRoutingProblem vrp = VehicleRoutingProblem.Builder.newInstance().addJob(shipment).addVehicle(vehicle).addJob(another_shipment)
                .setFleetSize(VehicleRoutingProblem.FleetSize.FINITE).addInitialVehicleRoute(iniRoute).build();

        VehicleRoutingAlgorithm vra = new GreedySchrimpfFactory().createAlgorithm(vrp);
        vra.setNuOfIterations(10);

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

        assertFalse(secondActIsPickup(solutions));
View Full Code Here

Examples of jsprit.core.algorithm.box.GreedySchrimpfFactory

    @Test
    public void whenReadingProblemFromFile_maxCapacityShouldNotBeExceeded(){
        VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
        new VrpXMLReader(vrpBuilder).read("src/test/resources/simpleProblem_iniRoutes_2.xml");
        VehicleRoutingAlgorithm vra = new GreedySchrimpfFactory().createAlgorithm(vrpBuilder.build());
        vra.setNuOfIterations(10);

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

        assertFalse(secondActIsPickup(solutions));
View Full Code Here

Examples of jsprit.core.algorithm.box.GreedySchrimpfFactory

      e.printStackTrace();
    }
   
    vrpBuilder.setRoutingCost(matrixBuilder.build());
    VehicleRoutingProblem vrp = vrpBuilder.build();
    VehicleRoutingAlgorithm vra = new GreedySchrimpfFactory().createAlgorithm(vrp);
    vra.setPrematureAlgorithmTermination(new IterationWithoutImprovementTermination(100));
    Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
   
    SolutionPrinter.print(vrp, Solutions.bestOf(solutions), Print.VERBOSE);
   
View Full Code Here

Examples of jsprit.core.algorithm.box.GreedySchrimpfFactory

      e.printStackTrace();
    }
   
    vrpBuilder.setRoutingCost(matrixBuilder.build());
    VehicleRoutingProblem vrp = vrpBuilder.build();
    VehicleRoutingAlgorithm vra = new GreedySchrimpfFactory().createAlgorithm(vrp);
    vra.setPrematureAlgorithmTermination(new IterationWithoutImprovementTermination(100));
    Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
   
    SolutionPrinter.print(vrp, Solutions.bestOf(solutions), Print.VERBOSE);
   
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.