Package jsprit.core.algorithm

Examples of jsprit.core.algorithm.VehicleRoutingAlgorithm.addListener()


    @Test
    public void whenSettingPrematureBreak_itShouldReadTermination(){
        VehicleRoutingAlgorithm vra = VehicleRoutingAlgorithms.readAndCreateAlgorithm(vrp,"src/test/resources/algorithmConfigForReaderTest2.xml");
        IterationCounter iCounter = new IterationCounter();
        vra.addListener(iCounter);
        vra.searchSolutions();
        Assert.assertEquals(100,iCounter.iterations);
    }

    @Test
View Full Code Here


    @Test
    public void itShouldReadTermination(){
        VehicleRoutingAlgorithm vra = VehicleRoutingAlgorithms.readAndCreateAlgorithm(vrp,"src/test/resources/algorithmConfigForReaderTest.xml");
        IterationCounter iCounter = new IterationCounter();
        vra.addListener(iCounter);
        vra.searchSolutions();
        Assert.assertEquals(25,iCounter.iterations);
    }

View Full Code Here

    //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

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.