Package jsprit.core.algorithm

Examples of jsprit.core.algorithm.VehicleRoutingAlgorithmFactory


     * add algorithms through factories
     *
     *
     *
     */
    computationalLab.addAlgorithmFactory("schrimpfAcceptance", new VehicleRoutingAlgorithmFactory() {
     
      @Override
      public VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vrp) {
        VehicleRoutingAlgorithm vra = VehicleRoutingAlgorithms.readAndCreateAlgorithm(vrp, "input/algorithmConfigWithSchrimpfAcceptance.xml");
        vra.setMaxIterations(4000);
View Full Code Here


    return sum/(double)doubles.size();
  }
 

  private static VehicleRoutingAlgorithmFactory getAlgorithmFactory(final int iterations) {
    return new VehicleRoutingAlgorithmFactory() {
     
      @Override
      public VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vrp) {
        VehicleRoutingAlgorithm vra = VehicleRoutingAlgorithms.readAndCreateAlgorithm(vrp, "input/algorithmConfigWithSchrimpfAcceptance.xml");
        vra.setMaxIterations(iterations);
View Full Code Here

     * Define 2 algorithms
     * - algorithmsConfigWithSchrimpfAcceptance (4000 iterations)
     * - algorithmsConfigWithGreedyAcceptance (4000 iterations)
     *
     */
    computationalLab.addAlgorithmFactory("schrimpfAcceptance", new VehicleRoutingAlgorithmFactory() {
     
      @Override
      public VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vrp) {
        VehicleRoutingAlgorithm vra = VehicleRoutingAlgorithms.readAndCreateAlgorithm(vrp, "input/algorithmConfigWithSchrimpfAcceptance.xml");
        vra.setMaxIterations(4000);
        return vra;
      }
    });
    computationalLab.addAlgorithmFactory("greedyAcceptance", new VehicleRoutingAlgorithmFactory() {
     
      @Override
      public VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vrp) {
        VehicleRoutingAlgorithm vra = VehicleRoutingAlgorithms.readAndCreateAlgorithm(vrp, "input/algorithmConfig_solomon.xml");
        vra.setMaxIterations(4000);
View Full Code Here

     *
     */
    for(double alphaVal=0.;alphaVal<.4;alphaVal+=.1){
     
      final String alpha = String.valueOf(alphaVal).substring(0, 3);
      computationalLab.addAlgorithmFactory("alpha_"+alpha, new VehicleRoutingAlgorithmFactory() {

        @Override
        public VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vrp) {
          return VehicleRoutingAlgorithms.createAlgorithm(vrp, getAlgorithmConfig(alpha));
        }
View Full Code Here

TOP

Related Classes of jsprit.core.algorithm.VehicleRoutingAlgorithmFactory

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.