Package jsprit.core.algorithm.acceptor

Examples of jsprit.core.algorithm.acceptor.GreedyAcceptance


     * but before define how a generated solution is evaluated
     * here: the VariablePlusFixed.... comes out of the box and it does what its name suggests
     */
    SolutionCostCalculator solutionCostCalculator = new VariablePlusFixedSolutionCostCalculatorFactory(stateManager).createCalculator();
   
    SearchStrategy firstStrategy = new SearchStrategy(new SelectBest(), new GreedyAcceptance(1), solutionCostCalculator);
    firstStrategy.addModule(new RuinAndRecreateModule("randomRuinAndBestInsertion", iStrategy, randomRuin));
   
    SearchStrategy secondStrategy = new SearchStrategy(new SelectBest(), new GreedyAcceptance(1), solutionCostCalculator);
    secondStrategy.addModule(new RuinAndRecreateModule("radialRuinAndBestInsertion", iStrategy, radialRuin));
   
    /*
     * put both strategies together, each with the prob of 0.5 to be selected
     */
 
View Full Code Here


                }
                return costs;
            }
        };

        SearchStrategy randomStrategy = new SearchStrategy(new SelectBest(), new GreedyAcceptance(1), solutionCostCalculator);
        RuinAndRecreateModule randomModule = new RuinAndRecreateModule("randomRuin_bestInsertion", bestInsertion, random);
        randomStrategy.addModule(randomModule);

        SearchStrategy radialStrategy = new SearchStrategy(new SelectBest(), new GreedyAcceptance(1), solutionCostCalculator);
        RuinAndRecreateModule radialModule = new RuinAndRecreateModule("radialRuin_bestInsertion", bestInsertion, radial);
        radialStrategy.addModule(radialModule);

        SearchStrategyManager strategyManager = new SearchStrategyManager();
        strategyManager.addStrategy(radialStrategy, 0.5);
View Full Code Here

    String acceptorId = "acceptorId";
   
    ModKey key = new ModKey(acceptorName,acceptorId);
    AcceptorKey accKey = new AcceptorKey(key);
   
    SolutionAcceptor acceptor = new GreedyAcceptance(1);
   
    typedMap.put(accKey, acceptor);
   
    assertEquals(acceptor,typedMap.get(accKey));
   
View Full Code Here

    String selectorName = "selector";
    String selectorId = "selectorId";
   
    ModKey key = new ModKey(acceptorName,acceptorId);
    AcceptorKey accKey = new AcceptorKey(key);
    SolutionAcceptor acceptor =  new GreedyAcceptance(1);
   
    SelectorKey selKey = new SelectorKey(new ModKey(selectorName,selectorId));
    SolutionSelector selector = new SelectBest();
   
    typedMap.put(accKey, acceptor);
View Full Code Here

    String selectorName = "selector";
    String selectorId = "selectorId";
   
    ModKey key = new ModKey(acceptorName,acceptorId);
    AcceptorKey accKey = new AcceptorKey(key);
    SolutionAcceptor acceptor =  new GreedyAcceptance(1);
   
    SelectorKey selKey = new SelectorKey(new ModKey(selectorName,selectorId));
    SolutionSelector selector = new SelectBest();
   
    AcceptorKey accKey2 = new AcceptorKey(new ModKey(acceptorName2,acceptorId2));
    SolutionAcceptor acceptor2 =  new GreedyAcceptance(1);
   
    typedMap.put(accKey, acceptor);
    typedMap.put(selKey, selector);
    typedMap.put(accKey2, acceptor2);
   
View Full Code Here

        }
        return costs;
      }
    };
   
    SearchStrategy randomStrategy = new SearchStrategy(new SelectBest(), new GreedyAcceptance(1), solutionCostCalculator);
    RuinAndRecreateModule randomModule = new RuinAndRecreateModule("randomRuin_bestInsertion", bestInsertion, random);
    randomStrategy.addModule(randomModule);
   
    SearchStrategy radialStrategy = new SearchStrategy(new SelectBest(), new GreedyAcceptance(1), solutionCostCalculator);
    RuinAndRecreateModule radialModule = new RuinAndRecreateModule("radialRuin_bestInsertion", bestInsertion, radial);
    radialStrategy.addModule(radialModule);
   
    SearchStrategyManager strategyManager = new SearchStrategyManager();
    strategyManager.addStrategy(radialStrategy, 0.5);
View Full Code Here

          }
          return costs;
        }
      };
     
      SearchStrategy randomStrategy = new SearchStrategy(new SelectBest(), new GreedyAcceptance(1), solutionCostCalculator);
      RuinAndRecreateModule randomModule = new RuinAndRecreateModule("randomRuin_bestInsertion", bestInsertion, random);
      randomStrategy.addModule(randomModule);
     
      SearchStrategy radialStrategy = new SearchStrategy(new SelectBest(), new GreedyAcceptance(1), solutionCostCalculator);
      RuinAndRecreateModule radialModule = new RuinAndRecreateModule("radialRuin_bestInsertion", bestInsertion, radial);
      radialStrategy.addModule(radialModule);
     
      SearchStrategyManager strategyManager = new SearchStrategyManager();
      strategyManager.addStrategy(radialStrategy, 0.5);
View Full Code Here

     * but before define how a generated solution is evaluated
     * here: the VariablePlusFixed.... comes out of the box and it does what its name suggests
     */
    SolutionCostCalculator solutionCostCalculator = new VariablePlusFixedSolutionCostCalculatorFactory(stateManager).createCalculator();
   
    SearchStrategy firstStrategy = new SearchStrategy(new SelectBest(), new GreedyAcceptance(1), solutionCostCalculator);
    firstStrategy.addModule(new RuinAndRecreateModule("randomRuinAndBestInsertion", iStrategy, randomRuin));
   
    SearchStrategy secondStrategy = new SearchStrategy(new SelectBest(), new GreedyAcceptance(1), solutionCostCalculator);
    secondStrategy.addModule(new RuinAndRecreateModule("radialRuinAndBestInsertion", iStrategy, radialRuin));
   
    /*
     * put both strategies together, each with the prob of 0.5 to be selected
     */
 
View Full Code Here

TOP

Related Classes of jsprit.core.algorithm.acceptor.GreedyAcceptance

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.