- Timestamp:
- 11/06/10 01:56:04 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources
- Property svn:mergeinfo changed
/branches/CloningRefactoring (added) merged: 4656-4693,4696-4697,4711-4714,4718-4719
- Property svn:mergeinfo changed
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/Argument.cs
r4068 r4722 43 43 44 44 [StorableConstructor] 45 private Argument() : base() { } 46 45 private Argument(bool deserializing) : base(deserializing) { } 46 private Argument(Argument original, Cloner cloner) 47 : base(original, cloner) { 48 argumentIndex = original.argumentIndex; 49 name = "ARG" + original.argumentIndex; 50 } 47 51 public Argument(int argumentIndex) 48 52 : base("ARG" + argumentIndex, Argument.ArgumentDescription) { … … 56 60 57 61 public override IDeepCloneable Clone(Cloner cloner) { 58 Argument clone = (Argument)base.Clone(cloner); 59 clone.argumentIndex = argumentIndex; 60 clone.name = "ARG" + argumentIndex; 61 return clone; 62 return new Argument(this, cloner); 62 63 } 63 64 } -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/ArgumentTreeNode.cs
r3486 r4722 21 21 22 22 using System; 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 24 25 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols { … … 34 35 } 35 36 36 private ArgumentTreeNode() : base() { } 37 38 // copy constructor 39 private ArgumentTreeNode(ArgumentTreeNode original) 40 : base(original) { 41 } 42 37 [StorableConstructor] 38 private ArgumentTreeNode(bool deserializing) : base(deserializing) { } 39 private ArgumentTreeNode(ArgumentTreeNode original, Cloner cloner) : base(original, cloner) { } 43 40 public ArgumentTreeNode(Argument argSymbol) : base(argSymbol) { } 44 41 45 public override object Clone() {46 return new ArgumentTreeNode(this );42 public override IDeepCloneable Clone(Cloner cloner) { 43 return new ArgumentTreeNode(this, cloner); 47 44 } 48 45 } -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/Defun.cs
r4068 r4722 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 32 33 public const string DefunDescription = "Symbol that represents a function defining node."; 33 34 34 public Defun() : base(Defun.DefunName, Defun.DefunDescription) { }35 35 [StorableConstructor] 36 36 private Defun(bool deserializing) : base(deserializing) { } 37 private Defun(Defun original, Cloner cloner) : base(original, cloner) { } 38 public Defun() : base(Defun.DefunName, Defun.DefunDescription) { } 39 40 public override IDeepCloneable Clone(Cloner cloner) { 41 return new Defun(this, cloner); 42 } 37 43 38 44 public override SymbolicExpressionTreeNode CreateTreeNode() { -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/DefunTreeNode.cs
r4068 r4722 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 23 24 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols { … … 37 38 } 38 39 39 private DefunTreeNode() : base() { } 40 41 // copy constructor 42 private DefunTreeNode(DefunTreeNode original) 43 : base(original) { 40 [StorableConstructor] 41 private DefunTreeNode(bool deserializing) : base(deserializing) { } 42 private DefunTreeNode(DefunTreeNode original, Cloner cloner) 43 : base(original, cloner) { 44 44 functionName = original.functionName; 45 45 numberOfArguments = original.numberOfArguments; … … 48 48 public DefunTreeNode(Defun defunSymbol) : base(defunSymbol) { } 49 49 50 51 public override object Clone() { 52 return new DefunTreeNode(this); 50 public override IDeepCloneable Clone(Cloner cloner) { 51 return new DefunTreeNode(this, cloner); 53 52 } 54 53 -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/InvokeFunction.cs
r4106 r4722 50 50 [StorableConstructor] 51 51 private InvokeFunction(bool deserializing) : base(deserializing) { } 52 private InvokeFunction(InvokeFunction original, Cloner cloner) 53 : base(original, cloner) { 54 functionName = original.functionName; 55 name = "Invoke: " + original.functionName; 56 } 52 57 public InvokeFunction(string functionName) 53 58 : base("Invoke: " + functionName, InvokeFunction.InvokeFunctionDescription) { … … 60 65 61 66 public override IDeepCloneable Clone(Cloner cloner) { 62 InvokeFunction clone = (InvokeFunction)base.Clone(cloner); 63 clone.functionName = functionName; 64 clone.name = "Invoke: " + functionName; 65 return clone; 67 return new InvokeFunction(this, cloner); 66 68 } 67 69 } -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/InvokeFunctionTreeNode.cs
r3484 r4722 21 21 22 22 using System; 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 24 25 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols { … … 34 35 } 35 36 36 private InvokeFunctionTreeNode() : base() { } 37 38 // copy constructor 39 private InvokeFunctionTreeNode(InvokeFunctionTreeNode original) 40 : base(original) { 41 } 42 37 [StorableConstructor] 38 private InvokeFunctionTreeNode(bool deserializing) : base(deserializing) { } 39 private InvokeFunctionTreeNode(InvokeFunctionTreeNode original, Cloner cloner) : base(original, cloner) { } 43 40 public InvokeFunctionTreeNode(InvokeFunction invokeSymbol) : base(invokeSymbol) { } 44 41 45 public override object Clone() {46 return new InvokeFunctionTreeNode(this );42 public override IDeepCloneable Clone(Cloner cloner) { 43 return new InvokeFunctionTreeNode(this, cloner); 47 44 } 48 45 } -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/ProgramRootSymbol.cs
r4068 r4722 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 29 30 public const string ProgramRootSymbolDescription = "Special symbol that represents the program root node of a symbolic expression tree."; 30 31 31 public ProgramRootSymbol() : base(ProgramRootSymbol.ProgramRootSymbolName, ProgramRootSymbol.ProgramRootSymbolDescription) { }32 32 [StorableConstructor] 33 33 private ProgramRootSymbol(bool deserializing) : base(deserializing) { } 34 private ProgramRootSymbol(ProgramRootSymbol original, Cloner cloner) : base(original, cloner) { } 35 public ProgramRootSymbol() : base(ProgramRootSymbol.ProgramRootSymbolName, ProgramRootSymbol.ProgramRootSymbolDescription) { } 34 36 37 public override IDeepCloneable Clone(Cloner cloner) { 38 return new ProgramRootSymbol(this, cloner); 39 } 35 40 public override SymbolicExpressionTreeNode CreateTreeNode() { 36 41 return new SymbolicExpressionTreeTopLevelNode(this); -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/ReadOnlySymbol.cs
r4068 r4722 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 27 28 [Item("ReadOnlySymbol", "Represents a symbol in a symbolic function tree that cannot be modified.")] 28 29 public abstract class ReadOnlySymbol : Symbol { 29 //#region Properties30 //[Storable]31 //private double initialFrequency;32 //public double InitialFrequency {33 // get { return initialFrequency; }34 // set { throw new NotSupportedException(); }35 //}36 //#endregion37 30 38 31 public override bool CanChangeName { … … 43 36 } 44 37 45 protected ReadOnlySymbol() : base() { }46 protected ReadOnlySymbol(string name, string description) : base(name, description) { }47 38 [StorableConstructor] 48 39 protected ReadOnlySymbol(bool deserializing) : base(deserializing) { } 40 protected ReadOnlySymbol(ReadOnlySymbol original, Cloner cloner) : base(original, cloner) { } 41 protected ReadOnlySymbol(string name, string description) : base(name, description) { } 49 42 } 50 43 } -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/StartSymbol.cs
r4068 r4722 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 29 30 public const string StartSymbolDescription = "Special symbol that represents the starting node of the result producing branch of a symbolic expression tree."; 30 31 31 public StartSymbol() : base(StartSymbol.StartSymbolName, StartSymbol.StartSymbolDescription) { }32 32 [StorableConstructor] 33 33 private StartSymbol(bool deserializing) : base(deserializing) { } 34 private StartSymbol(StartSymbol original, Cloner cloner) : base(original, cloner) { } 35 public StartSymbol() : base(StartSymbol.StartSymbolName, StartSymbol.StartSymbolDescription) { } 36 37 public override IDeepCloneable Clone(Cloner cloner) { 38 return new StartSymbol(this, cloner); 39 } 34 40 35 41 public override SymbolicExpressionTreeNode CreateTreeNode() { -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/Symbol.cs
r4477 r4722 47 47 #endregion 48 48 49 [StorableConstructor] 50 protected Symbol(bool deserializing) : base(deserializing) { } 51 protected Symbol(Symbol original, Cloner cloner) 52 : base(original, cloner) { 53 initialFrequency = original.initialFrequency; 54 } 49 55 protected Symbol() 50 56 : base() { … … 57 63 } 58 64 59 [StorableConstructor]60 protected Symbol(bool deserializing) : base(deserializing) { }61 65 62 66 public virtual SymbolicExpressionTreeNode CreateTreeNode() { 63 67 return new SymbolicExpressionTreeNode(this); 64 }65 66 public override IDeepCloneable Clone(Cloner cloner) {67 Symbol clone = (Symbol)base.Clone(cloner);68 clone.initialFrequency = initialFrequency;69 return clone;70 68 } 71 69
Note: See TracChangeset
for help on using the changeset viewer.