Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/20/11 13:36:49 (13 years ago)
Author:
svonolfe
Message:

Improved performance of many VRP operators by optimizing the parameter lookup (#1561)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/Crossovers/PotvinRouteBasedCrossover.cs

    r5445 r6449  
    2323using HeuristicLab.Core;
    2424using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     25using HeuristicLab.Data;
    2526
    2627namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
     
    4041
    4142    protected override PotvinEncoding Crossover(IRandom random, PotvinEncoding parent1, PotvinEncoding parent2) {
     43      BoolValue useDistanceMatrix = UseDistanceMatrixParameter.ActualValue;
     44      DoubleMatrix coordinates = CoordinatesParameter.ActualValue;
     45      DistanceMatrix distMatrix = VRPUtilities.GetDistanceMatrix(coordinates, DistanceMatrixParameter, useDistanceMatrix);
     46      DoubleArray dueTime = DueTimeParameter.ActualValue;
     47      DoubleArray readyTime = ReadyTimeParameter.ActualValue;
     48      DoubleArray serviceTime = ServiceTimeParameter.ActualValue;
     49      DoubleArray demand = DemandParameter.ActualValue;
     50      DoubleValue capacity = CapacityParameter.ActualValue;
     51
    4252      PotvinEncoding child = parent2.Clone() as PotvinEncoding;
    4353
     
    5565          child.Unrouted.Add(city);
    5666
    57       if (Repair(random, child, replacing))
     67      if (Repair(random, child, replacing, distMatrix, dueTime, readyTime, serviceTime, demand, capacity))
    5868        return child;
    5969      else {
     
    6171          return parent1.Clone() as PotvinEncoding;
    6272        else
    63           return parent2.Clone() as PotvinEncoding;
     73          return parent2.Clone() as PotvinEncoding;   
    6474      }
    6575    }
Note: See TracChangeset for help on using the changeset viewer.