Package jsprit.core.algorithm.ruin

Examples of jsprit.core.algorithm.ruin.RuinStrategy


      String ruin_id = moduleConfig.getString("ruin[@id]");
      if(ruin_id == null) ruin_id = "noId";
      String shareToRuinString = moduleConfig.getString("ruin.share");
      if(shareToRuinString == null) throw new IllegalStateException("module.ruin.share is missing.");
      double shareToRuin = Double.valueOf(shareToRuinString);
      final RuinStrategy ruin;
      ModKey ruinKey = makeKey(ruin_name,ruin_id);
      if(ruin_name.equals("randomRuin")){
        ruin = getRandomRuin(vrp, routeStates, definedClasses, ruinKey, shareToRuin);
      }
      else if(ruin_name.equals("radialRuin")){
View Full Code Here


        "\n\tradialRuin");
  }

  private static RuinStrategy getRadialRuin(final VehicleRoutingProblem vrp, final StateManager routeStates, TypedMap definedClasses, ModKey modKey, double shareToRuin, JobDistance jobDistance) {
    RuinStrategyKey stratKey = new RuinStrategyKey(modKey);
    RuinStrategy ruin = definedClasses.get(stratKey);
    if(ruin == null){
      ruin = new RadialRuinStrategyFactory(shareToRuin, jobDistance).createStrategy(vrp);
      definedClasses.put(stratKey, ruin);
    }
    return ruin;
View Full Code Here

    return ruin;
  }

  private static RuinStrategy getRandomRuin(final VehicleRoutingProblem vrp, final StateManager routeStates, TypedMap definedClasses, ModKey modKey, double shareToRuin) {
    RuinStrategyKey stratKey = new RuinStrategyKey(modKey);
    RuinStrategy ruin = definedClasses.get(stratKey);
    if(ruin == null){
      ruin = new RandomRuinStrategyFactory(shareToRuin).createStrategy(vrp);
      definedClasses.put(stratKey, ruin);
    }
    return ruin;
View Full Code Here

    InsertionStrategy iStrategy = iBuilder.build();
   
    /*
     * second, define random-ruin that ruins 50-percent of the selected solution
     */
    RuinStrategy randomRuin = new RandomRuinStrategyFactory(0.5).createStrategy(vrp);
   
    /*
     * third, define radial-ruin that ruins 30-percent of the selected solution
     * the second para defines the distance between two jobs.
     */
    RuinStrategy radialRuin = new RadialRuinStrategyFactory(0.3, new AvgServiceAndShipmentDistance(vrp.getTransportCosts())).createStrategy(vrp);
   
    /*
     * now define a strategy
     */
    /*
 
View Full Code Here

        BestInsertionBuilder bestIBuilder = new BestInsertionBuilder(vrp, fleetManager, stateManager,constraintManager);
        InsertionStrategy bestInsertion = bestIBuilder.build();


        RuinStrategy radial = new RadialRuinStrategyFactory( 0.3, new AvgServiceAndShipmentDistance(vrp.getTransportCosts())).createStrategy(vrp);
        RuinStrategy random = new RandomRuinStrategyFactory(0.5).createStrategy(vrp);


        SolutionCostCalculator solutionCostCalculator = new SolutionCostCalculator() {

            @Override
View Full Code Here

    String acceptorName = "acceptor";
    String acceptorId = "acceptorId";
   
    ModKey key = new ModKey(acceptorName,acceptorId);
    RuinStrategyKey accKey = new RuinStrategyKey(key);
    RuinStrategy acceptor = new RuinStrategy(){

      @Override
      public Collection<Job> ruin(Collection<VehicleRoute> vehicleRoutes) {
        // TODO Auto-generated method stub
        return null;
View Full Code Here

       
    VehicleFleetManager fleetManager = new InfiniteFleetManagerFactory(vrp.getVehicles()).createFleetManager();
   
    InsertionStrategy bestInsertion = new BestInsertionBuilder(vrp, fleetManager, stateManager, cManager).build();
   
    RuinStrategy radial = new RadialRuinStrategyFactory(0.15, new AvgServiceDistance(vrp.getTransportCosts())).createStrategy(vrp);
    RuinStrategy random = new RandomRuinStrategyFactory(0.25).createStrategy(vrp);
   
    SolutionCostCalculator solutionCostCalculator = new SolutionCostCalculator() {
     
      @Override
      public double getCosts(VehicleRoutingProblemSolution solution) {
View Full Code Here

     
      BestInsertionBuilder iBuilder = new BestInsertionBuilder(vrp, fleetManager, stateManager, constraintManager);
//      iBuilder.setConstraintManager(constraintManger);
      InsertionStrategy bestInsertion = iBuilder.build();
       
      RuinStrategy radial = new RadialRuinStrategyFactory( 0.15, new AvgServiceDistance(vrp.getTransportCosts())).createStrategy(vrp);
      RuinStrategy random = new RandomRuinStrategyFactory(0.25).createStrategy(vrp);
     
      SolutionCostCalculator solutionCostCalculator = new SolutionCostCalculator() {
       
        @Override
        public double getCosts(VehicleRoutingProblemSolution solution) {
View Full Code Here

    InsertionStrategy iStrategy = iBuilder.build();
   
    /*
     * second, define random-ruin that ruins 50-percent of the selected solution
     */
    RuinStrategy randomRuin = new RandomRuinStrategyFactory(0.5).createStrategy(vrp);
   
    /*
     * third, define radial-ruin that ruins 30-percent of the selected solution
     * the second para defines the distance between two jobs.
     */
    RuinStrategy radialRuin = new RadialRuinStrategyFactory(0.3, new AvgServiceAndShipmentDistance(vrp.getTransportCosts())).createStrategy(vrp);
   
    /*
     * now define a strategy
     */
    /*
 
View Full Code Here

TOP

Related Classes of jsprit.core.algorithm.ruin.RuinStrategy

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.