Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/27/11 13:29:56 (13 years ago)
Author:
svonolfe
Message:

Updated interface of evaluator - added individual (#1177)

File:
1 edited

Legend:

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

    r6752 r6838  
    149149
    150150    private bool FindRouteInsertionPlace(
     151      PotvinEncoding individual,
    151152      Tour tour,
    152153      int city, bool allowInfeasible, out int place) {
     
    162163
    163164      double minDetour = 0;
    164       VRPEvaluation eval = ProblemInstance.Evaluate(tour);
     165      VRPEvaluation eval = ProblemInstance.EvaluateTour(tour, individual);
    165166      bool originalFeasible = ProblemInstance.Feasible(eval);
    166167
     
    220221
    221222        Tour childTour = new Tour();
     223        child.Tours.Add(childTour);
    222224        childTour.Stops.AddRange(r1.Stops);
    223225
     
    233235
    234236        while (count < maxCount && R2.Count != 0) {
    235           PotvinEncoding newChild = child.Clone() as PotvinEncoding;
    236           newChild.Tours.Add(childTour);
    237 
    238237          int index = random.Next(R2.Count);
    239238          int city = R2[index];
     
    241240
    242241          int place = -1;
    243           bool found = FindRouteInsertionPlace(childTour, city, allowInfeasible, out place);
     242          bool found = FindRouteInsertionPlace(child, childTour, city, allowInfeasible, out place);
    244243          if (found) {
    245244            childTour.Stops.Insert(place, city);
     
    253252        }
    254253
    255         child.Tours.Add(childTour);
    256254        Repair(random, child, childTour, ProblemInstance, allowInfeasible);
    257255      }
Note: See TracChangeset for help on using the changeset viewer.