Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/06/10 01:56:04 (14 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.Encodings.SymbolicExpressionTreeEncoding/3.3/Crossovers/SubtreeCrossover.cs

    r4106 r4722  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526using HeuristicLab.Core;
    2627using HeuristicLab.Data;
     
    3738  [Item("SubtreeCrossover", "An operator which performs subtree swapping crossover.")]
    3839  [StorableClass]
    39   public class SubtreeCrossover : SymbolicExpressionTreeCrossover {
     40  public sealed class SubtreeCrossover : SymbolicExpressionTreeCrossover {
    4041    public IValueLookupParameter<PercentValue> InternalCrossoverPointProbabilityParameter {
    4142      get { return (IValueLookupParameter<PercentValue>)Parameters["InternalCrossoverPointProbability"]; }
    4243    }
    43 
     44    [StorableConstructor]
     45    private SubtreeCrossover(bool deserializing) : base(deserializing) { }
     46    private SubtreeCrossover(SubtreeCrossover original, Cloner cloner) : base(original, cloner) { }
    4447    public SubtreeCrossover()
    4548      : base() {
    4649      Parameters.Add(new ValueLookupParameter<PercentValue>("InternalCrossoverPointProbability", "The probability to select an internal crossover point (instead of a leaf node).", new PercentValue(0.9)));
     50    }
     51
     52    public override IDeepCloneable Clone(Cloner cloner) {
     53      return new SubtreeCrossover(this, cloner);
    4754    }
    4855
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Crossovers/SymbolicExpressionTreeCrossover.cs

    r4123 r4722  
    2121
    2222using System;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Data;
     
    5051      get { return FailedCrossoverEventsParameter.Value; }
    5152    }
     53    [StorableConstructor]
     54    protected SymbolicExpressionTreeCrossover(bool deserializing) : base(deserializing) { }
     55    protected SymbolicExpressionTreeCrossover(SymbolicExpressionTreeCrossover original, Cloner cloner) : base(original, cloner) { }
    5256    protected SymbolicExpressionTreeCrossover()
    5357      : base() {
Note: See TracChangeset for help on using the changeset viewer.