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

Legend:

Unmodified
Added
Removed
  • trunk/sources

  • trunk/sources/HeuristicLab.Problems.ExternalEvaluation.GP/3.3/Grammar/FullFunctionalExpressionGrammar.cs

    r4364 r4722  
    2121
    2222using System.Collections.Generic;
    23 using System.Linq;
     23using HeuristicLab.Common;
    2424using HeuristicLab.Core;
    2525using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
     
    3333    [Storable]
    3434    private HeuristicLab.Problems.ExternalEvaluation.GP.Variable variableSymbol;
     35    [StorableConstructor]
     36    protected FullFunctionalExpressionGrammar(bool deserializing) : base(deserializing) { }
     37    protected FullFunctionalExpressionGrammar(FullFunctionalExpressionGrammar original, Cloner cloner) : base(original, cloner) { }
     38    public override IDeepCloneable Clone(Cloner cloner) {
     39      return new FullFunctionalExpressionGrammar(this, cloner);
     40    }
    3541
    3642    public FullFunctionalExpressionGrammar()
     
    7581      var unaryFunctionSymbols = new List<Symbol>() { sin, cos, tan, log, exp, not };
    7682      var binaryFunctionSymbols = new List<Symbol>() { gt, lt };
    77       var functionSymbols = new List<Symbol>() { add, sub, mul, div, mean, and, or};
     83      var functionSymbols = new List<Symbol>() { add, sub, mul, div, mean, and, or };
    7884
    7985      foreach (var symb in allSymbols)
  • trunk/sources/HeuristicLab.Problems.ExternalEvaluation.GP/3.3/Interpretation/TreeInterpreter.cs

    r4117 r4722  
    2222using System;
    2323using System.Collections.Generic;
     24using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    2526using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
     
    9293    private Instruction[] code;
    9394    private int pc;
    94    
     95
    9596    public override bool CanChangeName {
    9697      get { return false; }
     
    100101    }
    101102
    102     public TreeInterpreter()
    103       : base() {
    104     }
     103
     104    [StorableConstructor]
     105    protected TreeInterpreter(bool deserializing) : base(deserializing) { }
     106    protected TreeInterpreter(TreeInterpreter original, Cloner cloner) : base(original, cloner) { }
     107    public override IDeepCloneable Clone(Cloner cloner) {
     108      return new TreeInterpreter(this, cloner);
     109    }
     110    public TreeInterpreter() : base() { }
    105111
    106112    public void Prepare(SymbolicExpressionTree tree) {
  • trunk/sources/HeuristicLab.Problems.ExternalEvaluation.GP/3.3/SymbolicExpressionTreeBinaryConverter.cs

    r4089 r4722  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
    26 using HeuristicLab.Core;
    27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    28 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    2922using System.IO;
    3023using Google.ProtocolBuffers;
     24using HeuristicLab.Common;
     25using HeuristicLab.Core;
     26using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
     27using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3128
    3229namespace HeuristicLab.Problems.ExternalEvaluation.GP {
     
    3431  [StorableClass]
    3532  public class SymbolicExpressionTreeBinaryConverter : SymbolicExpressionTreeConverter {
     33    [StorableConstructor]
     34    protected SymbolicExpressionTreeBinaryConverter(bool deserializing) : base(deserializing) { }
     35    protected SymbolicExpressionTreeBinaryConverter(SymbolicExpressionTreeBinaryConverter original, Cloner cloner)
     36      : base(original, cloner) {
     37    }
     38    public override IDeepCloneable Clone(Cloner cloner) {
     39      return new SymbolicExpressionTreeBinaryConverter(this, cloner);
     40    }
     41    public SymbolicExpressionTreeBinaryConverter() : base() { }
    3642
    3743    protected override void ConvertSymbolicExpressionTree(SymbolicExpressionTree tree, string name, SolutionMessage.Builder builder) {
  • trunk/sources/HeuristicLab.Problems.ExternalEvaluation.GP/3.3/SymbolicExpressionTreeConverter.cs

    r4089 r4722  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
     23using HeuristicLab.Common;
    2624using HeuristicLab.Core;
    2725using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
     
    3331  public abstract class SymbolicExpressionTreeConverter : Item, IItemToSolutionMessageConverter {
    3432    private static readonly Type[] itemTypes = new Type[] { typeof(SymbolicExpressionTree) };
     33
     34    [StorableConstructor]
     35    protected SymbolicExpressionTreeConverter(bool deserializing) : base(deserializing) { }
     36    protected SymbolicExpressionTreeConverter(SymbolicExpressionTreeConverter original, Cloner cloner)
     37      : base(original, cloner) {
     38    }
     39    public SymbolicExpressionTreeConverter() : base() { }
    3540
    3641    #region IItemToSolutionMessageConverter Members
  • trunk/sources/HeuristicLab.Problems.ExternalEvaluation.GP/3.3/SymbolicExpressionTreeStringConverter.cs

    r4089 r4722  
    2121
    2222using System;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
     
    3132    SymbolicExpressionTreeStringFormatter formatter;
    3233
    33     public SymbolicExpressionTreeStringConverter() {
     34    [StorableConstructor]
     35    protected SymbolicExpressionTreeStringConverter(bool deserializing) : base(deserializing) { }
     36    protected SymbolicExpressionTreeStringConverter(SymbolicExpressionTreeStringConverter original, Cloner cloner)
     37      : base(original, cloner) {
     38    }
     39    public override IDeepCloneable Clone(Cloner cloner) {
     40      return new SymbolicExpressionTreeStringConverter(this, cloner);
     41    }
     42
     43    public SymbolicExpressionTreeStringConverter()
     44      : base() {
    3445      formatter = new SymbolicExpressionTreeStringFormatter();
    3546      formatter.Indent = false;
  • trunk/sources/HeuristicLab.Problems.ExternalEvaluation.GP/3.3/Symbols/Addition.cs

    r4089 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
     
    2829  [Item("Addition", "Symbol that represents the + operator.")]
    2930  public sealed class Addition : Symbol {
    30 
     31    [StorableConstructor]
     32    private Addition(bool deserializing) : base(deserializing) { }
     33    private Addition(Addition original, Cloner cloner)
     34      : base(original, cloner) {
     35    }
     36    public override IDeepCloneable Clone(Cloner cloner) {
     37      return new Addition(this, cloner);
     38    }
    3139    public Addition()
    3240      : base("+", "Symbol that represents the + operator.") {
  • trunk/sources/HeuristicLab.Problems.ExternalEvaluation.GP/3.3/Symbols/And.cs

    r4089 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
     
    2829  [Item("And", "Symbol that represents the boolean AND operator.")]
    2930  public sealed class And : Symbol {
    30 
     31    [StorableConstructor]
     32    private And(bool deserializing) : base(deserializing) { }
     33    private And(And original, Cloner cloner)
     34      : base(original, cloner) {
     35    }
     36    public override IDeepCloneable Clone(Cloner cloner) {
     37      return new And(this, cloner);
     38    }
    3139    public And()
    3240      : base("&&", "Symbol that represents the boolean AND operator.") {
  • trunk/sources/HeuristicLab.Problems.ExternalEvaluation.GP/3.3/Symbols/Average.cs

    r4089 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
     
    2829  [Item("Average", "Symbol that represents the average (arithmetic mean) function.")]
    2930  public sealed class Average : Symbol {
    30 
     31    [StorableConstructor]
     32    private Average(bool deserializing) : base(deserializing) { }
     33    private Average(Average original, Cloner cloner)
     34      : base(original, cloner) {
     35    }
     36    public override IDeepCloneable Clone(Cloner cloner) {
     37      return new Average(this, cloner);
     38    }
    3139    public Average()
    3240      : base("avg", "Symbol that represents the average (arithmetic mean) function.") {
  • trunk/sources/HeuristicLab.Problems.ExternalEvaluation.GP/3.3/Symbols/Constant.cs

    r4089 r4722  
    7878    }
    7979    #endregion
     80
     81    [StorableConstructor]
     82    private Constant(bool deserializing) : base(deserializing) { }
     83    private Constant(Constant original, Cloner cloner)
     84      : base(original, cloner) {
     85      minValue = original.minValue;
     86      maxValue = original.maxValue;
     87      manipulatorNu = original.manipulatorNu;
     88      manipulatorSigma = original.manipulatorSigma;
     89    }
     90    public override IDeepCloneable Clone(Cloner cloner) {
     91      return new Constant(this, cloner);
     92    }
    8093    public Constant()
    8194      : base("Constant", "Represents a constant value.") {
     
    89102      return new ConstantTreeNode(this);
    90103    }
    91 
    92     public override IDeepCloneable Clone(Cloner cloner) {
    93       Constant clone = (Constant)base.Clone(cloner);
    94       clone.minValue = minValue;
    95       clone.maxValue = maxValue;
    96       clone.manipulatorNu = manipulatorNu;
    97       clone.manipulatorSigma = manipulatorSigma;
    98       return clone;
    99     }
    100104  }
    101105}
  • trunk/sources/HeuristicLab.Problems.ExternalEvaluation.GP/3.3/Symbols/ConstantTreeNode.cs

    r4089 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
     
    3940    }
    4041
    41     private ConstantTreeNode() : base() { }
    42 
    43     // copy constructor
    44     private ConstantTreeNode(ConstantTreeNode original)
    45       : base(original) {
    46       constantValue = original.constantValue;
     42    [StorableConstructor]
     43    private ConstantTreeNode(bool deserializing) : base(deserializing) { }
     44    private ConstantTreeNode(ConstantTreeNode original, Cloner cloner)
     45      : base(original, cloner) {
     46    }
     47    public override IDeepCloneable Clone(Cloner cloner) {
     48      return new ConstantTreeNode(this, cloner);
    4749    }
    4850
     
    6769    }
    6870
    69     public override object Clone() {
    70       return new ConstantTreeNode(this);
    71     }
    72 
    7371    public override string ToString() {
    7472      return ";" + constantValue.ToString("E4");
  • trunk/sources/HeuristicLab.Problems.ExternalEvaluation.GP/3.3/Symbols/Cosine.cs

    r4089 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
     
    2829  [Item("Cosine", "Symbol that represents the cosine function.")]
    2930  public sealed class Cosine : Symbol {
    30 
     31    [StorableConstructor]
     32    private Cosine(bool deserializing) : base(deserializing) { }
     33    private Cosine(Cosine original, Cloner cloner)
     34      : base(original, cloner) {
     35    }
     36    public override IDeepCloneable Clone(Cloner cloner) {
     37      return new Cosine(this, cloner);
     38    }
    3139    public Cosine()
    3240      : base("cos", "Symbol that represents the cosine function.") {
  • trunk/sources/HeuristicLab.Problems.ExternalEvaluation.GP/3.3/Symbols/Division.cs

    r4089 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
     
    2829  [Item("Division", "Symbol that represents the / operator.")]
    2930  public sealed class Division : Symbol {
    30 
     31    [StorableConstructor]
     32    private Division(bool deserializing) : base(deserializing) { }
     33    private Division(Division original, Cloner cloner)
     34      : base(original, cloner) {
     35    }
     36    public override IDeepCloneable Clone(Cloner cloner) {
     37      return new Division(this, cloner);
     38    }
    3139    public Division()
    3240      : base("/", "Symbol that represents the / operator.") {
  • trunk/sources/HeuristicLab.Problems.ExternalEvaluation.GP/3.3/Symbols/Exponential.cs

    r4089 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
     
    2829  [Item("Exponential", "Symbol that represents the exponential function.")]
    2930  public sealed class Exponential : Symbol {
    30 
     31    [StorableConstructor]
     32    private Exponential(bool deserializing) : base(deserializing) { }
     33    private Exponential(Exponential original, Cloner cloner)
     34      : base(original, cloner) {
     35    }
     36    public override IDeepCloneable Clone(Cloner cloner) {
     37      return new Exponential(this, cloner);
     38    }
    3139    public Exponential()
    3240      : base("exp", "Symbol that represents the exponential function.") {
  • trunk/sources/HeuristicLab.Problems.ExternalEvaluation.GP/3.3/Symbols/GreaterThan.cs

    r4089 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
     
    2829  [Item("GreaterThan", "Symbol that represents a greater than relation.")]
    2930  public sealed class GreaterThan : Symbol {
    30 
     31    [StorableConstructor]
     32    private GreaterThan(bool deserializing) : base(deserializing) { }
     33    private GreaterThan(GreaterThan original, Cloner cloner)
     34      : base(original, cloner) {
     35    }
     36    public override IDeepCloneable Clone(Cloner cloner) {
     37      return new GreaterThan(this, cloner);
     38    }
    3139    public GreaterThan()
    3240      : base(">", "Symbol that represents a greater than relation.") {
  • trunk/sources/HeuristicLab.Problems.ExternalEvaluation.GP/3.3/Symbols/IfThenElse.cs

    r4089 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
     
    2829  [Item("IfThenElse", "Symbol that represents a conditional operator.")]
    2930  public sealed class IfThenElse : Symbol {
    30 
     31    [StorableConstructor]
     32    private IfThenElse(bool deserializing) : base(deserializing) { }
     33    private IfThenElse(IfThenElse original, Cloner cloner)
     34      : base(original, cloner) {
     35    }
     36    public override IDeepCloneable Clone(Cloner cloner) {
     37      return new IfThenElse(this, cloner);
     38    }
    3139    public IfThenElse()
    3240      : base("if", "Symbol that represents a conditional operator.") {
  • trunk/sources/HeuristicLab.Problems.ExternalEvaluation.GP/3.3/Symbols/LessThan.cs

    r4089 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
     
    2829  [Item("LessThan", "Symbol that represents a less than relation.")]
    2930  public sealed class LessThan : Symbol {
    30 
     31    [StorableConstructor]
     32    private LessThan(bool deserializing) : base(deserializing) { }
     33    private LessThan(LessThan original, Cloner cloner)
     34      : base(original, cloner) {
     35    }
     36    public override IDeepCloneable Clone(Cloner cloner) {
     37      return new LessThan(this, cloner);
     38    }
    3139    public LessThan()
    3240      : base("<", "Symbol that represents a less than relation.") {
  • trunk/sources/HeuristicLab.Problems.ExternalEvaluation.GP/3.3/Symbols/Logarithm.cs

    r4089 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
     
    2829  [Item("Logarithm", "Symbol that represents the logarithm function.")]
    2930  public sealed class Logarithm : Symbol {
    30 
     31    [StorableConstructor]
     32    private Logarithm(bool deserializing) : base(deserializing) { }
     33    private Logarithm(Logarithm original, Cloner cloner)
     34      : base(original, cloner) {
     35    }
     36    public override IDeepCloneable Clone(Cloner cloner) {
     37      return new Logarithm(this, cloner);
     38    }
    3139    public Logarithm()
    3240      : base("ln", "Symbol that represents the logarithm function.") {
  • trunk/sources/HeuristicLab.Problems.ExternalEvaluation.GP/3.3/Symbols/Multiplication.cs

    r4089 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
     
    2829  [Item("Multiplication", "Symbol that represents the * operator.")]
    2930  public sealed class Multiplication : Symbol {
    30 
     31    [StorableConstructor]
     32    private Multiplication(bool deserializing) : base(deserializing) { }
     33    private Multiplication(Multiplication original, Cloner cloner)
     34      : base(original, cloner) {
     35    }
     36    public override IDeepCloneable Clone(Cloner cloner) {
     37      return new Multiplication(this, cloner);
     38    }
    3139    public Multiplication()
    3240      : base("*", "Symbol that represents the * operator.") {
  • trunk/sources/HeuristicLab.Problems.ExternalEvaluation.GP/3.3/Symbols/Not.cs

    r4089 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
     
    2829  [Item("Not", "Symbol that represents the boolean NOT operator.")]
    2930  public sealed class Not : Symbol {
    30 
     31    [StorableConstructor]
     32    private Not(bool deserializing) : base(deserializing) { }
     33    private Not(Not original, Cloner cloner)
     34      : base(original, cloner) {
     35    }
     36    public override IDeepCloneable Clone(Cloner cloner) {
     37      return new Not(this, cloner);
     38    }
    3139    public Not()
    3240      : base("!", "Symbol that represents the boolean NOT operator.") {
  • trunk/sources/HeuristicLab.Problems.ExternalEvaluation.GP/3.3/Symbols/Or.cs

    r4089 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
     
    2829  [Item("Or", "Symbol that represents the boolean OR operator.")]
    2930  public sealed class Or : Symbol {
    30 
     31    [StorableConstructor]
     32    private Or(bool deserializing) : base(deserializing) { }
     33    private Or(Or original, Cloner cloner)
     34      : base(original, cloner) {
     35    }
     36    public override IDeepCloneable Clone(Cloner cloner) {
     37      return new Or(this, cloner);
     38    }
    3139    public Or()
    3240      : base("||", "Symbol that represents the boolean OR operator.") {
  • trunk/sources/HeuristicLab.Problems.ExternalEvaluation.GP/3.3/Symbols/Sine.cs

    r4089 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
     
    2829  [Item("Sine", "Symbol that represents the sine function.")]
    2930  public sealed class Sine : Symbol {
    30 
     31      [StorableConstructor]
     32    private Sine(bool deserializing) : base(deserializing) { }
     33    private Sine(Sine original, Cloner cloner)
     34      : base(original, cloner) {
     35    }
     36    public override IDeepCloneable Clone(Cloner cloner) {
     37      return new Sine(this, cloner);
     38    }
    3139    public Sine()
    3240      : base("sin", "Symbol that represents the sine function.") {
  • trunk/sources/HeuristicLab.Problems.ExternalEvaluation.GP/3.3/Symbols/Subtraction.cs

    r4089 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
     
    2829  [Item("Subtraction", "Symbol that represents the - operator.")]
    2930  public sealed class Subtraction : Symbol {
    30 
     31    [StorableConstructor]
     32    private Subtraction(bool deserializing) : base(deserializing) { }
     33    private Subtraction(Subtraction original, Cloner cloner)
     34      : base(original, cloner) {
     35    }
     36    public override IDeepCloneable Clone(Cloner cloner) {
     37      return new Subtraction(this, cloner);
     38    }
    3139    public Subtraction()
    3240      : base("-", "Symbol that represents the - operator.") {
  • trunk/sources/HeuristicLab.Problems.ExternalEvaluation.GP/3.3/Symbols/Tangent.cs

    r4089 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
     
    2829  [Item("Tangent", "Symbol that represents the tangent trigonometric function.")]
    2930  public sealed class Tangent : Symbol {
    30 
     31    [StorableConstructor]
     32    private Tangent(bool deserializing) : base(deserializing) { }
     33    private Tangent(Tangent original, Cloner cloner)
     34      : base(original, cloner) {
     35    }
     36    public override IDeepCloneable Clone(Cloner cloner) {
     37      return new Tangent(this, cloner);
     38    }
    3139    public Tangent()
    3240      : base("tan", "Symbol that represents the tangent trigonometric function.") {
  • trunk/sources/HeuristicLab.Problems.ExternalEvaluation.GP/3.3/Symbols/Variable.cs

    r4089 r4722  
    9191    }
    9292    #endregion
     93
     94    [StorableConstructor]
     95    private Variable(bool deserializing) : base(deserializing) { }
     96    private Variable(Variable original, Cloner cloner)
     97      : base(original, cloner) {
     98      weightNu = original.weightNu;
     99      weightSigma = original.weightSigma;
     100      variableNames = new List<string>(original.variableNames);
     101      weightManipulatorNu = original.weightManipulatorNu;
     102      weightManipulatorSigma = original.weightManipulatorSigma;
     103    }
     104    public override IDeepCloneable Clone(Cloner cloner) {
     105      return new Variable(this, cloner);
     106    }
     107
    93108    public Variable()
    94109      : base("Variable", "Represents a variable value.") {
     
    103118      return new VariableTreeNode(this);
    104119    }
    105 
    106     public override IDeepCloneable Clone(Cloner cloner) {
    107       Variable clone = (Variable)base.Clone(cloner);
    108       clone.weightNu = weightNu;
    109       clone.weightSigma = weightSigma;
    110       clone.variableNames = new List<string>(variableNames);
    111       clone.weightManipulatorNu = weightManipulatorNu;
    112       clone.weightManipulatorSigma = weightManipulatorSigma;
    113       return clone;
    114     }
    115120  }
    116121}
  • trunk/sources/HeuristicLab.Problems.ExternalEvaluation.GP/3.3/Symbols/VariableTreeNode.cs

    r4089 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
     
    4748    private VariableTreeNode() { }
    4849
    49     // copy constructor
    50     private VariableTreeNode(VariableTreeNode original)
    51       : base(original) {
     50    [StorableConstructor]
     51    private VariableTreeNode(bool deserializing) : base(deserializing) { }
     52    private VariableTreeNode(VariableTreeNode original, Cloner cloner)
     53      : base(original, cloner) {
    5254      weight = original.weight;
    5355      variableName = original.variableName;
     56    }
     57    public override IDeepCloneable Clone(Cloner cloner) {
     58      return new VariableTreeNode(this, cloner);
    5459    }
    5560
     
    5762
    5863    public override bool HasLocalParameters {
    59       get {
    60         return true;
    61       }
     64      get { return true; }
    6265    }
    6366
     
    7780    }
    7881
    79 
    80     public override object Clone() {
    81       return new VariableTreeNode(this);
    82     }
    83 
    8482    public override string ToString() {
    8583      return ";" + variableName + ";" + weight.ToString("E4");
Note: See TracChangeset for help on using the changeset viewer.