Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/29/10 20:21:04 (14 years ago)
Author:
mkommend
Message:

Refactored VRP Encodings.General and Zhu (ticket #922).

Location:
branches/CloningRefactoring/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/Crossovers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/CloningRefactoring/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/Crossovers/MultiVRPSolutionCrossover.cs

    r4352 r4687  
    2323using System.Linq;
    2424using HeuristicLab.Collections;
     25using HeuristicLab.Common;
    2526using HeuristicLab.Core;
     27using HeuristicLab.Data;
    2628using HeuristicLab.Operators;
    2729using HeuristicLab.Optimization;
     
    2931using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3032using HeuristicLab.PluginInfrastructure;
    31 using HeuristicLab.Data;
    3233
    3334namespace HeuristicLab.Problems.VehicleRouting.Encodings.General {
     
    8384    [StorableConstructor]
    8485    private MultiVRPSolutionCrossover(bool deserializing) : base(deserializing) { }
     86    protected MultiVRPSolutionCrossover(MultiVRPSolutionCrossover original, Cloner cloner) : base(original, cloner) { }
     87    public override IDeepCloneable Clone(Cloner cloner) {
     88      return new MultiVRPSolutionCrossover(this, cloner);
     89    }
    8590    public MultiVRPSolutionCrossover()
    8691      : base() {
    87        Parameters.Add(new ScopeTreeLookupParameter<IVRPEncoding>("Parents", "The parent permutations which should be crossed."));
     92      Parameters.Add(new ScopeTreeLookupParameter<IVRPEncoding>("Parents", "The parent permutations which should be crossed."));
    8893      ParentsParameter.ActualName = "VRPTours";
    8994      Parameters.Add(new LookupParameter<IVRPEncoding>("Child", "The child permutation resulting from the crossover."));
  • branches/CloningRefactoring/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/Crossovers/RandomParentCloneCrossover.cs

    r4352 r4687  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
     22using HeuristicLab.Common;
    2623using HeuristicLab.Core;
    2724using HeuristicLab.Optimization;
     
    3936    [StorableConstructor]
    4037    private RandomParentCloneCrossover(bool deserializing) : base(deserializing) { }
     38    protected RandomParentCloneCrossover(RandomParentCloneCrossover original, Cloner cloner) : base(original, cloner) { }
     39    public override IDeepCloneable Clone(Cloner cloner) {
     40      return new RandomParentCloneCrossover(this, cloner);
     41    }
    4142
    4243    public RandomParentCloneCrossover()
     
    5455      Parameters.Remove("ServiceTime");
    5556    }
    56    
     57
    5758    public override IOperation Apply() {
    5859      if (RandomParameter.ActualValue.Next() < 0.5)
Note: See TracChangeset for help on using the changeset viewer.