Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/27/12 15:21:20 (12 years ago)
Author:
jkarder
Message:

#1331:

  • added operators for the VehicleRouting problem
  • minor code improvements
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Crossovers/PotvinRouteBasedCrossover.cs

    r8053 r8346  
    2424using HeuristicLab.Encodings.PermutationEncoding;
    2525using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     26using HeuristicLab.Problems.VehicleRouting.Interfaces;
    2627
    2728namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
     
    4344    }
    4445
    45     protected override PotvinEncoding Crossover(IRandom random, PotvinEncoding parent1, PotvinEncoding parent2) {
    46       bool allowInfeasible = AllowInfeasibleSolutions.Value.Value;
    47 
     46    public static PotvinEncoding Apply(IRandom random, PotvinEncoding parent1, PotvinEncoding parent2, IVRPProblemInstance problemInstance, bool allowInfeasible) {
    4847      PotvinEncoding child = parent2.Clone() as PotvinEncoding;
    4948
     
    7574            child.Unrouted.Add(city);
    7675
    77         if (Repair(random, child, replacing, ProblemInstance, allowInfeasible) || allowInfeasible)
     76        if (Repair(random, child, replacing, problemInstance, allowInfeasible) || allowInfeasible)
    7877          return child;
    7978        else {
     
    8786      }
    8887    }
     88
     89    protected override PotvinEncoding Crossover(IRandom random, PotvinEncoding parent1, PotvinEncoding parent2) {
     90      return Apply(random, parent1, parent2, ProblemInstance, AllowInfeasibleSolutions.Value.Value);
     91    }
    8992  }
    9093}
Note: See TracChangeset for help on using the changeset viewer.