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/Creators/ProbabilisticTreeCreator.cs

    r4477 r4722  
    2424using System.Linq;
    2525using System.Text;
     26using HeuristicLab.Common;
    2627using HeuristicLab.Core;
    2728using HeuristicLab.Data;
     
    3334  [StorableClass]
    3435  [Item("ProbabilisticTreeCreator", "An operator that creates new symbolic expression trees with uniformly distributed size")]
    35   public class ProbabilisticTreeCreator : SymbolicExpressionTreeCreator {
     36  public sealed class ProbabilisticTreeCreator : SymbolicExpressionTreeCreator {
    3637    private const int MAX_TRIES = 100;
    37 
    38     public ProbabilisticTreeCreator()
    39       : base() {
     38    [StorableConstructor]
     39    private ProbabilisticTreeCreator(bool deserializing) : base(deserializing) { }
     40    private ProbabilisticTreeCreator(ProbabilisticTreeCreator original, Cloner cloner) : base(original, cloner) { }
     41    public ProbabilisticTreeCreator() : base() { }
     42
     43    public override IDeepCloneable Clone(Cloner cloner) {
     44      return new ProbabilisticTreeCreator(this, cloner);
    4045    }
    4146
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Creators/SymbolicExpressionTreeCreator.cs

    r4068 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Data;
     
    6162
    6263    #endregion
     64    [StorableConstructor]
     65    protected SymbolicExpressionTreeCreator(bool deserializing) : base(deserializing) { }
     66    protected SymbolicExpressionTreeCreator(SymbolicExpressionTreeCreator original, Cloner cloner) : base(original, cloner) { }
    6367    protected SymbolicExpressionTreeCreator()
    6468      : base() {
     
    7175      SymbolicExpressionTree = Create(Random, SymbolicExpressionGrammar,
    7276        MaxTreeSize, MaxTreeHeight, MaxFunctionDefinitions, MaxFunctionArguments);
    73       return null;
     77      return base.Apply();
    7478    }
    7579
Note: See TracChangeset for help on using the changeset viewer.