Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/04/10 17:34:02 (14 years ago)
Author:
svonolfe
Message:

Further improved the VRP design (#1039)

Location:
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Crossovers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Crossovers/AlbaCrossover.cs

    r4150 r4154  
    2828namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
    2929  [StorableClass]
    30   public abstract class AlbaCrossover : VRPCrossover {
    31     public ILookupParameter<IntValue> VehiclesParameter {
    32       get { return (ILookupParameter<IntValue>)Parameters["Vehicles"]; }
    33     }
    34 
    35     public AlbaCrossover()
    36       : base() {
    37         Parameters.Add(new LookupParameter<IntValue>("Vehicles", "The vehicles count."));
    38     }
    39    
     30  public abstract class AlbaCrossover : VRPCrossover {   
    4031    protected virtual void Crossover() {
    4132    }
    4233
    4334    public override IOperation Apply() {
    44       int cities = 0;
    45 
    4635      ItemArray<IVRPEncoding> parents = new ItemArray<IVRPEncoding>(ParentsParameter.ActualValue.Length);
    4736      for (int i = 0; i < ParentsParameter.ActualValue.Length; i++) {
    4837        IVRPEncoding solution = ParentsParameter.ActualValue[i];
    49         cities = solution.Cities;
     38
    5039        if (!(solution is AlbaEncoding)) {
    5140          parents[i] = AlbaEncoding.ConvertFrom(solution, VehiclesParameter.ActualValue.Value);
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Crossovers/AlbaPermutationCrossover.cs

    r4150 r4154  
    3939
    4040    protected override void Crossover() {
    41       int cities = ParentsParameter.ActualValue[0].Cities;
    42 
    4341      PermutationCrossoverParameter.ActualValue.ParentsParameter.ActualName = ParentsParameter.ActualName;
    4442      IAtomicOperation op = this.ExecutionContext.CreateOperation(
     
    5149        ExecutionContext.Scope.Variables.Remove(childName);
    5250
    53         ChildParameter.ActualValue = new AlbaEncoding(permutation, cities);
     51        ChildParameter.ActualValue = new AlbaEncoding(permutation, Cities);
    5452      } else
    5553        ChildParameter.ActualValue = null;
Note: See TracChangeset for help on using the changeset viewer.