Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/25/13 09:21:45 (11 years ago)
Author:
gkronber
Message:

#1591: adapted FLA branch to reference most recent version of ALGLIB (3.7.0) and VRP (3.4). Several major changes were necessary to port the implementation to the new VRP problem.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/FitnessLandscapeAnalysis/HeuristicLab.Analysis.FitnessLandscape.VRP/Manipulators/OrOptManipulator.cs

    r7159 r9750  
    4848
    4949    public static void Apply(IRandom random, PotvinEncoding individual) {
    50       List<Tour> tours = individual.Tours.FindAll(t => t.Cities.Count >= 2);
     50      List<Tour> tours = individual.Tours.FindAll(t => t.Stops.Count >= 2);
    5151
    5252      if (tours.Count > 0) {
     
    5454        Tour tour = tours[tourIdx];
    5555
    56         int segmentStart = random.Next(tour.Cities.Count);
     56        int segmentStart = random.Next(tour.Stops.Count);
    5757        int segmentLength;
    5858        if (segmentStart == 0) {
    59           segmentLength = 1 + random.Next(tour.Cities.Count - 1);
     59          segmentLength = 1 + random.Next(tour.Stops.Count - 1);
    6060        } else {
    61           segmentLength = 1 + random.Next(tour.Cities.Count - segmentStart);
     61          segmentLength = 1 + random.Next(tour.Stops.Count - segmentStart);
    6262        }
    6363
    64         List<int> segment = tour.Cities.GetRange(segmentStart, segmentLength);
    65         tour.Cities.RemoveRange(segmentStart, segmentLength);
     64        List<int> segment = tour.Stops.GetRange(segmentStart, segmentLength);
     65        tour.Stops.RemoveRange(segmentStart, segmentLength);
    6666        int newPos;
    67         if(tour.Cities.Count == 1)
     67        if (tour.Stops.Count == 1)
    6868          newPos = 0;
    6969        else
    70           newPos = random.Next(tour.Cities.Count - 1);
     70          newPos = random.Next(tour.Stops.Count - 1);
    7171
    7272        if (newPos >= segmentStart)
    7373          newPos++;
    74         tour.Cities.InsertRange(newPos, segment);
     74        tour.Stops.InsertRange(newPos, segment);
    7575      }
    7676    }
Note: See TracChangeset for help on using the changeset viewer.