Package jsprit.core.algorithm.termination

Examples of jsprit.core.algorithm.termination.IterationWithoutImprovementTermination


    }
   
    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);
   
    assertEquals(2.*397.,Solutions.bestOf(solutions).getCost(),0.01);
 
View Full Code Here


     
      VehicleRoutingProblemSolution iniSolution = new InsertionInitialSolutionFactory(bestInsertion, solutionCostCalculator).createSolution(vrp);

      vra.addInitialSolution(iniSolution);
      vra.setNuOfIterations(1000);
      vra.setPrematureAlgorithmTermination(new IterationWithoutImprovementTermination(100));
     
  }
View Full Code Here

    algorithmBuilder.setStateAndConstraintManager(stateManager, constraintManager);
    algorithmBuilder.addCoreConstraints();
    algorithmBuilder.addDefaultCostCalculators();
   
    VehicleRoutingAlgorithm algorithm = algorithmBuilder.build();
    algorithm.setPrematureAlgorithmTermination(new IterationWithoutImprovementTermination(100));

    /*
     * and search a solution
     */
    Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();
View Full Code Here

    vra.setMaxIterations(1000);
   
    /*
     * optionally define a premature termination criterion (by default: not criterion is set)
     */
    vra.setPrematureAlgorithmTermination(new IterationWithoutImprovementTermination(100));
   
    return vra;
  }
View Full Code Here

TOP

Related Classes of jsprit.core.algorithm.termination.IterationWithoutImprovementTermination

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.