Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/06/10 01:56:04 (13 years ago)
Author:
swagner
Message:

Merged cloning refactoring branch back into trunk (#922)

Location:
trunk/sources
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources

  • trunk/sources/HeuristicLab.Problems.VehicleRouting

  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Zhu/Crossovers/ZhuHeuristicCrossover2.cs

    r4352 r4722  
    2020#endregion
    2121
     22using System.Collections.Generic;
     23using HeuristicLab.Common;
    2224using HeuristicLab.Core;
    23 using HeuristicLab.Encodings.PermutationEncoding;
    24 using HeuristicLab.Parameters;
    2525using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    26 using HeuristicLab.Data;
    27 using System.Collections.Generic;
    2826
    2927namespace HeuristicLab.Problems.VehicleRouting.Encodings.Zhu {
    3028  [Item("ZhuHeuristicCrossover2", "The Zhu Heuristic Crossover (Version 2). It is implemented as described in Zhu, K.Q. (2000). A New Genetic Algorithm For VRPTW. Proceedings of the International Conference on Artificial Intelligence.")]
    3129  [StorableClass]
    32   public sealed class ZhuHeuristicCrossover2 : ZhuCrossover {   
     30  public sealed class ZhuHeuristicCrossover2 : ZhuCrossover {
    3331    [StorableConstructor]
    3432    private ZhuHeuristicCrossover2(bool deserializing) : base(deserializing) { }
    35 
     33    private ZhuHeuristicCrossover2(ZhuHeuristicCrossover2 original, Cloner cloner)
     34      : base(original, cloner) {
     35    }
     36    public override IDeepCloneable Clone(Cloner cloner) {
     37      return new ZhuHeuristicCrossover2(this, cloner);
     38    }
    3639    public ZhuHeuristicCrossover2()
    3740      : base() {
     
    4952      if (predecessor < 0)
    5053        predecessor = predecessor + child.Length;
    51      
     54
    5255      int parent1Index = i;
    5356      int parent2Index = i;
     
    5659        if (i == breakPoint) {
    5760          child[i] = p1[parent1Index];
    58          
     61
    5962          p1.Remove(child[i]);
    6063          if (parent1Index >= p1.Count)
Note: See TracChangeset for help on using the changeset viewer.