Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/10/10 13:00:54 (14 years ago)
Author:
svonolfe
Message:

Improved performance of PotvinEncoding(#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/Alba/Moves/AlbaMoveMaker.cs

    r4369 r4378  
    3939      : base() {
    4040    }
    41 
    42     public override IOperation Apply() {
    43       IVRPEncoding solution = VRPToursParameter.ActualValue;
    44       if (!(solution is AlbaEncoding)) {
    45         //VRPToursParameter.ActualValue = AlbaEncoding.ConvertFrom(solution, VehiclesParameter.ActualValue.Value,
    46         //  DistanceMatrixParameter);
    47       }
    48 
    49       return base.Apply();
    50     }
    5141  }
    5242}
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/PotvinEncoding.cs

    r4376 r4378  
    9999      for (int tour = 0; tour < Tours.Count; tour++) {
    100100        if (tour != routeToAvoid) {
     101          double length = GetTourLength(Tours[tour]);
     102
    101103          for (int i = 0; i <= Tours[tour].Stops.Count; i++) {
    102             double length = GetTourLength(Tours[tour]);
    103 
    104104            Tours[tour].Stops.Insert(i, city);
    105105
    106             if (ProblemInstance.Feasible(Tours[tour])) {
    107               double newLength = GetTourLength(Tours[tour]);
     106            VRPEvaluation eval = ProblemInstance.EvaluatorParameter.Value.Evaluate(
     107              ProblemInstance, Tours[tour]);
     108            if (ProblemInstance.EvaluatorParameter.Value.Feasible(eval)) {
     109              double newLength = eval.Distance;
    108110
    109111              double detour = newLength - length;
Note: See TracChangeset for help on using the changeset viewer.