Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/24/20 00:58:42 (4 years ago)
Author:
abeham
Message:

#2521: working on VRP (WIP)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Crossovers/PotvinInsertionBasedCrossover.cs

    r17226 r17698  
    5151    }
    5252
    53     private static int SelectRandomTourBiasedByLength(IRandom random, PotvinEncoding individual) {
     53    private static int SelectRandomTourBiasedByLength(IRandom random, PotvinEncodedSolution individual) {
    5454      int tourIndex = -1;
    5555
     
    109109    }
    110110
    111     private int SelectCityBiasedByNeighborDistance(IRandom random, Tour tour, IVRPEncoding solution) {
     111    private int SelectCityBiasedByNeighborDistance(IRandom random, Tour tour, IVRPEncodedSolution solution) {
    112112      int cityIndex = -1;
    113113
     
    150150
    151151    private bool FindRouteInsertionPlace(
    152       PotvinEncoding individual,
     152      PotvinEncodedSolution individual,
    153153      Tour tour,
    154154      int city, bool allowInfeasible, out int place) {
     
    181181    }
    182182
    183     private ICollection<int> GetUnrouted(PotvinEncoding solution, int cities) {
     183    private ICollection<int> GetUnrouted(PotvinEncodedSolution solution, int cities) {
    184184      HashSet<int> undiscovered = new HashSet<int>();
    185185      for (int i = 1; i <= cities; i++) {
     
    195195    }
    196196
    197     protected override PotvinEncoding Crossover(IRandom random, PotvinEncoding parent1, PotvinEncoding parent2) {
    198       PotvinEncoding child = parent1.Clone() as PotvinEncoding;
     197    protected override PotvinEncodedSolution Crossover(IRandom random, PotvinEncodedSolution parent1, PotvinEncodedSolution parent2) {
     198      PotvinEncodedSolution child = parent1.Clone() as PotvinEncodedSolution;
    199199      child.Tours.Clear();
    200200
     
    202202
    203203      List<Tour> R1 = new List<Tour>();
    204       PotvinEncoding p1Clone = parent1.Clone() as PotvinEncoding;
     204      PotvinEncodedSolution p1Clone = parent1.Clone() as PotvinEncodedSolution;
    205205
    206206      int length = Math.Min(Length.Value.Value, parent1.Tours.Count) + 1;
     
    277277      else {
    278278        if (random.NextDouble() < 0.5)
    279           return parent1.Clone() as PotvinEncoding;
     279          return parent1.Clone() as PotvinEncodedSolution;
    280280        else
    281           return parent2.Clone() as PotvinEncoding;
     281          return parent2.Clone() as PotvinEncodedSolution;
    282282      }
    283283    }
Note: See TracChangeset for help on using the changeset viewer.