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:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources

  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Manipulators/ChangeNodeTypeManipulation.cs

    r4189 r4722  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526using HeuristicLab.Core;
    2627using HeuristicLab.Data;
     
    3132  [StorableClass]
    3233  [Item("ChangeNodeTypeManipulation", "Selects a random tree node and changes the symbol.")]
    33   public class ChangeNodeTypeManipulation : SymbolicExpressionTreeManipulator {
     34  public sealed class ChangeNodeTypeManipulation : SymbolicExpressionTreeManipulator {
    3435
    35     public ChangeNodeTypeManipulation()
    36       : base() {
     36    [StorableConstructor]
     37    private ChangeNodeTypeManipulation(bool deserializing) : base(deserializing) { }
     38    private ChangeNodeTypeManipulation(ChangeNodeTypeManipulation original, Cloner cloner) : base(original, cloner) { }
     39    public ChangeNodeTypeManipulation() : base() { }
     40
     41    public override IDeepCloneable Clone(Cloner cloner) {
     42      return new ChangeNodeTypeManipulation(this, cloner);
    3743    }
    3844
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Manipulators/FullTreeShaker.cs

    r4068 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Data;
     
    2728  [StorableClass]
    2829  [Item("FullTreeShaker", "Manipulates all nodes that have local parameters.")]
    29   public class FullTreeShaker : SymbolicExpressionTreeManipulator {
     30  public sealed class FullTreeShaker : SymbolicExpressionTreeManipulator {
    3031
    31     public FullTreeShaker()
    32       : base() {
     32    [StorableConstructor]
     33    private FullTreeShaker(bool deserializing) : base(deserializing) { }
     34    private FullTreeShaker(FullTreeShaker original, Cloner cloner) : base(original, cloner) { }
     35    public FullTreeShaker() : base() { }
     36
     37    public override IDeepCloneable Clone(Cloner cloner) {
     38      return new FullTreeShaker(this, cloner);
    3339    }
    3440
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Manipulators/MultiSymbolicExpressionTreeManipulator.cs

    r4068 r4722  
    2323using System.Linq;
    2424using HeuristicLab.Collections;
     25using HeuristicLab.Common;
    2526using HeuristicLab.Core;
    2627using HeuristicLab.Data;
     
    3536  [Item("MultiSymbolicExpressionTreeManipulator", "Randomly selects and applies one of its manipulators every time it is called.")]
    3637  [StorableClass]
    37   public class MultiSymbolicExpressionTreeManipulator : StochasticMultiBranch<ISymbolicExpressionTreeManipulator>, ISymbolicExpressionTreeManipulator, IStochasticOperator {
     38  public sealed class MultiSymbolicExpressionTreeManipulator : StochasticMultiBranch<ISymbolicExpressionTreeManipulator>, ISymbolicExpressionTreeManipulator, IStochasticOperator {
    3839    private const string MaxTreeSizeParameterName = "MaxTreeSize";
    3940    private const string MaxTreeHeightParameterName = "MaxTreeHeight";
     
    6667    #endregion
    6768
    68 
    6969    [StorableConstructor]
    7070    private MultiSymbolicExpressionTreeManipulator(bool deserializing) : base(deserializing) { }
     71    private MultiSymbolicExpressionTreeManipulator(MultiSymbolicExpressionTreeManipulator original, Cloner cloner) : base(original, cloner) { }
    7172    public MultiSymbolicExpressionTreeManipulator()
    7273      : base() {
     
    8081          Operators.Add((ISymbolicExpressionTreeManipulator)Activator.CreateInstance(type), true);
    8182      }
     83    }
     84
     85    public override IDeepCloneable Clone(Cloner cloner) {
     86      return new MultiSymbolicExpressionTreeManipulator(this, cloner);
    8287    }
    8388
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Manipulators/OnePointShaker.cs

    r4068 r4722  
    2121
    2222using System.Linq;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Data;
     
    2829  [StorableClass]
    2930  [Item("OnePointShaker", "Selects a random node with local parameters and manipulates the selected node.")]
    30   public class OnePointShaker : SymbolicExpressionTreeManipulator {
     31  public sealed class OnePointShaker : SymbolicExpressionTreeManipulator {
     32    [StorableConstructor]
     33    private OnePointShaker(bool deserializing) : base(deserializing) { }
     34    private OnePointShaker(OnePointShaker original, Cloner cloner) : base(original, cloner) { }
     35    public OnePointShaker() : base() { }
    3136
    32     public OnePointShaker()
    33       : base() {
     37    public override IDeepCloneable Clone(Cloner cloner) {
     38      return new OnePointShaker(this, cloner);
    3439    }
    3540
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Manipulators/ReplaceBranchManipulation.cs

    r4189 r4722  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526using HeuristicLab.Core;
    2627using HeuristicLab.Data;
     28using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Creators;
    2729using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
    2830using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    29 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Creators;
    3031
    3132namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Manipulators {
    3233  [StorableClass]
    3334  [Item("ReplaceBranchManipulation", "Selects a branch of the tree randomly and replaces it with a newly initialized branch (using PTC2).")]
    34   public class ReplaceBranchManipulation : SymbolicExpressionTreeManipulator {
     35  public sealed class ReplaceBranchManipulation : SymbolicExpressionTreeManipulator {
     36    [StorableConstructor]
     37    private ReplaceBranchManipulation(bool deserializing) : base(deserializing) { }
     38    private ReplaceBranchManipulation(ReplaceBranchManipulation original, Cloner cloner) : base(original, cloner) { }
     39    public ReplaceBranchManipulation() : base() { }
    3540
    36     public ReplaceBranchManipulation()
    37       : base() {
     41    public override IDeepCloneable Clone(Cloner cloner) {
     42      return new ReplaceBranchManipulation(this, cloner);
    3843    }
    3944
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Manipulators/SymbolicExpressionTreeManipulator.cs

    r4068 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Data;
     
    5455    #endregion
    5556
     57    [StorableConstructor]
     58    protected SymbolicExpressionTreeManipulator(bool deserializing) : base(deserializing) { }
     59    protected SymbolicExpressionTreeManipulator(SymbolicExpressionTreeManipulator original, Cloner cloner) : base(original, cloner) { }
    5660    public SymbolicExpressionTreeManipulator()
    5761      : base() {
Note: See TracChangeset for help on using the changeset viewer.