Free cookie consent management tool by TermsFeed Policy Generator

Changeset 6713


Ignore:
Timestamp:
09/06/11 16:57:00 (12 years ago)
Author:
svonolfe
Message:

Fixed minor bugs (#1177)

Location:
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/TourEncoding.cs

    r5867 r6713  
    4343      foreach(Tour tour in Tours) {
    4444        if (tour.Stops.Count > 0)
    45           result.Add(tour);
     45          result.Add(tour.Clone() as Tour);
    4646      }
    4747
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Creators/IterativeInsertionCreator.cs

    r6607 r6713  
    9696
    9797      Tour currentTour = new Tour();
    98       result.Tours.Add(currentTour);
     98
    9999      int j = random.Next(customers.Count);
    100100      for (int i = 0; i < customers.Count; i++) {
     
    109109          currentTour.Stops.RemoveAt(stopIdx);
    110110
     111          if(currentTour.Stops.Count > 0)
     112            result.Tours.Add(currentTour);
    111113          currentTour = new Tour();
    112           result.Tours.Add(currentTour);
     114         
    113115          currentTour.Stops.Add(customers[index]);
    114116        }
    115117      }
     118
     119      if (currentTour.Stops.Count > 0)
     120        result.Tours.Add(currentTour);
    116121
    117122      return result;
Note: See TracChangeset for help on using the changeset viewer.