- Timestamp:
- 01/11/11 15:03:46 (14 years ago)
- Location:
- branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Addition.cs
r4068 r5275 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols; … … 27 28 [Item("Addition", "Symbol that represents the + operator.")] 28 29 public sealed class Addition : Symbol { 30 [StorableConstructor] 31 private Addition(bool deserializing) : base(deserializing) { } 32 private Addition(Addition original, Cloner cloner) : base(original, cloner) { } 33 public override IDeepCloneable Clone(Cloner cloner) { 34 return new Addition(this, cloner); 35 } 29 36 public Addition() : base("Addition", "Symbol that represents the + operator.") { } 30 37 } -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/And.cs
r4068 r5275 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols; … … 27 28 [Item("And", "Symbol that represents the boolean AND operator.")] 28 29 public sealed class And : Symbol { 30 [StorableConstructor] 31 private And(bool deserializing) : base(deserializing) { } 32 private And(And original, Cloner cloner) : base(original, cloner) { } 33 public override IDeepCloneable Clone(Cloner cloner) { 34 return new And(this, cloner); 35 } 29 36 public And() : base("And", "Symbol that represents the boolean AND operator.") { } 30 37 } -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Average.cs
r4068 r5275 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols; … … 27 28 [Item("Average", "Symbol that represents the average (arithmetic mean) function.")] 28 29 public sealed class Average : Symbol { 30 [StorableConstructor] 31 private Average(bool deserializing) : base(deserializing) { } 32 private Average(Average original, Cloner cloner) : base(original, cloner) { } 33 public override IDeepCloneable Clone(Cloner cloner) { 34 return new Average(this, cloner); 35 } 29 36 public Average() : base("Average", "Symbol that represents the average (arithmetic mean) function.") { } 30 37 } -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Constant.cs
r4068 r5275 54 54 } 55 55 [Storable] 56 private double manipulator Nu;57 public double Manipulator Nu {58 get { return manipulator Nu; }56 private double manipulatorMu; 57 public double ManipulatorMu { 58 get { return manipulatorMu; } 59 59 set { 60 if (value != manipulator Nu) {61 manipulator Nu = value;60 if (value != manipulatorMu) { 61 manipulatorMu = value; 62 62 OnChanged(EventArgs.Empty); 63 63 } … … 77 77 } 78 78 #endregion 79 [StorableConstructor] 80 private Constant(bool deserializing) : base(deserializing) { } 81 private Constant(Constant original, Cloner cloner) 82 : base(original, cloner) { 83 minValue = original.minValue; 84 maxValue = original.maxValue; 85 manipulatorMu = original.manipulatorMu; 86 manipulatorSigma = original.manipulatorSigma; 87 } 79 88 public Constant() 80 89 : base("Constant", "Represents a constant value.") { 81 manipulator Nu = 0.0;90 manipulatorMu = 0.0; 82 91 manipulatorSigma = 1.0; 83 92 minValue = -20.0; … … 90 99 91 100 public override IDeepCloneable Clone(Cloner cloner) { 92 Constant clone = (Constant)base.Clone(cloner); 93 clone.minValue = minValue; 94 clone.maxValue = maxValue; 95 clone.manipulatorNu = manipulatorNu; 96 clone.manipulatorSigma = manipulatorSigma; 97 return clone; 101 return new Constant(this, cloner); 98 102 } 99 103 } -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/ConstantTreeNode.cs
r4068 r5275 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; … … 38 39 } 39 40 40 private ConstantTreeNode() : base() { } 41 [StorableConstructor] 42 private ConstantTreeNode(bool deserializing) : base(deserializing) { } 41 43 42 // copy constructor 43 private ConstantTreeNode(ConstantTreeNode original) 44 : base(original) { 44 private ConstantTreeNode(ConstantTreeNode original, Cloner cloner) 45 : base(original, cloner) { 45 46 constantValue = original.constantValue; 46 47 } 47 48 49 private ConstantTreeNode() : base() { } 48 50 public ConstantTreeNode(Constant constantSymbol) : base(constantSymbol) { } 49 51 … … 61 63 public override void ShakeLocalParameters(IRandom random, double shakingFactor) { 62 64 base.ShakeLocalParameters(random, shakingFactor); 63 double x = NormalDistributedRandom.NextDouble(random, Symbol.Manipulator Nu, Symbol.ManipulatorSigma);65 double x = NormalDistributedRandom.NextDouble(random, Symbol.ManipulatorMu, Symbol.ManipulatorSigma); 64 66 Value = Value + x * shakingFactor; 65 67 } 66 68 67 public override object Clone() {68 return new ConstantTreeNode(this );69 public override IDeepCloneable Clone(Cloner cloner) { 70 return new ConstantTreeNode(this, cloner); 69 71 } 70 72 -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Cosine.cs
r4068 r5275 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols; … … 27 28 [Item("Cosine", "Symbol that represents the cosine function.")] 28 29 public sealed class Cosine : Symbol { 30 [StorableConstructor] 31 private Cosine(bool deserializing) : base(deserializing) { } 32 private Cosine(Cosine original, Cloner cloner) : base(original, cloner) { } 33 public override IDeepCloneable Clone(Cloner cloner) { 34 return new Cosine(this, cloner); 35 } 29 36 public Cosine() : base("Cosine", "Symbol that represents the cosine function.") { } 30 37 } -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/DifferentialVariable.cs
r4193 r5275 28 28 [Item("DifferentialVariable", "Represents the differential of a variable value.")] 29 29 public sealed class DifferentialVariable : Variable { 30 [StorableConstructor] 31 private DifferentialVariable(bool deserializing) : base(deserializing) { } 32 private DifferentialVariable(DifferentialVariable original, Cloner cloner) 33 : base(original, cloner) { 34 } 30 35 public DifferentialVariable() 31 36 : base("DifferentialVariable", "Represents the differential of a variable value.") { … … 35 40 return new DifferentialVariableTreeNode(this); 36 41 } 37 38 42 public override IDeepCloneable Clone(Cloner cloner) { 39 DifferentialVariable clone = (DifferentialVariable)base.Clone(cloner); 40 return clone; 43 return new DifferentialVariable(this, cloner); 41 44 } 42 45 } -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/DifferentialVariableTreeNode.cs
r4193 r5275 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Common; 25 26 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols { 26 27 [StorableClass] … … 30 31 } 31 32 33 [StorableConstructor] 34 protected DifferentialVariableTreeNode(bool deserializing) : base(deserializing) { } 35 protected DifferentialVariableTreeNode(DifferentialVariableTreeNode original, Cloner cloner) 36 : base(original, cloner) { 37 } 32 38 private DifferentialVariableTreeNode() { } 33 34 // copy constructor35 private DifferentialVariableTreeNode(DifferentialVariableTreeNode original)36 : base(original) {37 }38 39 39 40 public DifferentialVariableTreeNode(DifferentialVariable differentialSymbol) : base(differentialSymbol) { } 40 41 41 42 42 public override object Clone() {43 return new DifferentialVariableTreeNode(this );43 public override IDeepCloneable Clone(Cloner cloner) { 44 return new DifferentialVariableTreeNode(this, cloner); 44 45 } 45 46 46 } 47 47 } -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Division.cs
r4068 r5275 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols; … … 27 28 [Item("Division", "Symbol that represents the / operator.")] 28 29 public sealed class Division : Symbol { 30 [StorableConstructor] 31 private Division(bool deserializing) : base(deserializing) { } 32 private Division(Division original, Cloner cloner) : base(original, cloner) { } 33 public override IDeepCloneable Clone(Cloner cloner) { 34 return new Division(this, cloner); 35 } 29 36 public Division() : base("Division", "Symbol that represents the / operator.") { } 30 37 } -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Exponential.cs
r4068 r5275 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols; … … 27 28 [Item("Exponential", "Symbol that represents the exponential function.")] 28 29 public sealed class Exponential : Symbol { 30 [StorableConstructor] 31 private Exponential(bool deserializing) : base(deserializing) { } 32 private Exponential(Exponential original, Cloner cloner) : base(original, cloner) { } 33 public override IDeepCloneable Clone(Cloner cloner) { 34 return new Exponential(this, cloner); 35 } 29 36 public Exponential() : base("Exponential", "Symbol that represents the exponential function.") { } 30 37 } -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/GreaterThan.cs
r4068 r5275 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols; … … 27 28 [Item("GreaterThan", "Symbol that represents a greater than relation.")] 28 29 public sealed class GreaterThan : Symbol { 30 [StorableConstructor] 31 private GreaterThan(bool deserializing) : base(deserializing) { } 32 private GreaterThan(GreaterThan original, Cloner cloner) : base(original, cloner) { } 33 public override IDeepCloneable Clone(Cloner cloner) { 34 return new GreaterThan(this, cloner); 35 } 29 36 public GreaterThan() : base("GreaterThan", "Symbol that represents a greater than relation.") { } 30 37 } -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/IfThenElse.cs
r4068 r5275 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols; … … 27 28 [Item("IfThenElse", "Symbol that represents a conditional operator.")] 28 29 public sealed class IfThenElse : Symbol { 30 [StorableConstructor] 31 private IfThenElse(bool deserializing) : base(deserializing) { } 32 private IfThenElse(IfThenElse original, Cloner cloner) : base(original, cloner) { } 33 public override IDeepCloneable Clone(Cloner cloner) { 34 return new IfThenElse(this, cloner); 35 } 29 36 public IfThenElse() : base("IfThenElse", "Symbol that represents a conditional operator.") { } 30 37 } -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/LaggedVariable.cs
r4068 r5275 40 40 set { maxLag = value; } 41 41 } 42 [StorableConstructor] 43 private LaggedVariable(bool deserializing) : base(deserializing) { } 44 private LaggedVariable(LaggedVariable original, Cloner cloner) 45 : base(original, cloner) { 46 minLag = original.minLag; 47 maxLag = original.maxLag; 48 } 42 49 public LaggedVariable() 43 50 : base("LaggedVariable", "Represents a variable value with a time offset.") { … … 50 57 51 58 public override IDeepCloneable Clone(Cloner cloner) { 52 LaggedVariable clone = (LaggedVariable)base.Clone(cloner); 53 clone.minLag = minLag; 54 clone.maxLag = maxLag; 55 return clone; 59 return new LaggedVariable(this, cloner); 56 60 } 57 61 } -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/LaggedVariableTreeNode.cs
r4068 r5275 21 21 22 22 using System; 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 36 37 } 37 38 38 private LaggedVariableTreeNode() { } 39 40 // copy constructor 41 private LaggedVariableTreeNode(LaggedVariableTreeNode original) 42 : base(original) { 39 [StorableConstructor] 40 private LaggedVariableTreeNode(bool deserializing) : base(deserializing) { } 41 private LaggedVariableTreeNode(LaggedVariableTreeNode original, Cloner cloner) 42 : base(original, cloner) { 43 43 lag = original.lag; 44 44 } 45 private LaggedVariableTreeNode() { } 45 46 46 47 public LaggedVariableTreeNode(LaggedVariable variableSymbol) : base(variableSymbol) { } … … 62 63 } 63 64 64 65 public override object Clone() { 66 return new LaggedVariableTreeNode(this); 65 public override IDeepCloneable Clone(Cloner cloner) { 66 return new LaggedVariableTreeNode(this, cloner); 67 67 } 68 68 -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/LessThan.cs
r4068 r5275 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols; … … 27 28 [Item("LessThan", "Symbol that represents a less than relation.")] 28 29 public sealed class LessThan : Symbol { 30 [StorableConstructor] 31 private LessThan(bool deserializing) : base(deserializing) { } 32 private LessThan(LessThan original, Cloner cloner) : base(original, cloner) { } 33 public override IDeepCloneable Clone(Cloner cloner) { 34 return new LessThan(this, cloner); 35 } 29 36 public LessThan() : base("LessThan", "Symbol that represents a less than relation.") { } 30 37 } -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Logarithm.cs
r4068 r5275 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols; … … 27 28 [Item("Logarithm", "Symbol that represents the logarithm function.")] 28 29 public sealed class Logarithm : Symbol { 30 [StorableConstructor] 31 private Logarithm(bool deserializing) : base(deserializing) { } 32 private Logarithm(Logarithm original, Cloner cloner) : base(original, cloner) { } 33 public override IDeepCloneable Clone(Cloner cloner) { 34 return new Logarithm(this, cloner); 35 } 29 36 public Logarithm() : base("Logarithm", "Symbol that represents the logarithm function.") { } 30 37 } -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Multiplication.cs
r4068 r5275 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols; … … 27 28 [Item("Multiplication", "Symbol that represents the * operator.")] 28 29 public sealed class Multiplication : Symbol { 30 [StorableConstructor] 31 private Multiplication(bool deserializing) : base(deserializing) { } 32 private Multiplication(Multiplication original, Cloner cloner) : base(original, cloner) { } 33 public override IDeepCloneable Clone(Cloner cloner) { 34 return new Multiplication(this, cloner); 35 } 29 36 public Multiplication() : base("Multiplication", "Symbol that represents the * operator.") { } 30 37 } -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Not.cs
r4068 r5275 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols; … … 27 28 [Item("Not", "Symbol that represents the boolean NOT operator.")] 28 29 public sealed class Not : Symbol { 30 [StorableConstructor] 31 private Not(bool deserializing) : base(deserializing) { } 32 private Not(Not original, Cloner cloner) : base(original, cloner) { } 33 public override IDeepCloneable Clone(Cloner cloner) { 34 return new Not(this, cloner); 35 } 29 36 public Not() : base("Not", "Symbol that represents the boolean NOT operator.") { } 30 37 } -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Or.cs
r4068 r5275 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols; … … 27 28 [Item("Or", "Symbol that represents the boolean OR operator.")] 28 29 public sealed class Or : Symbol { 30 [StorableConstructor] 31 private Or(bool deserializing) : base(deserializing) { } 32 private Or(Or original, Cloner cloner) : base(original, cloner) { } 33 public override IDeepCloneable Clone(Cloner cloner) { 34 return new Or(this, cloner); 35 } 29 36 public Or() : base("Or", "Symbol that represents the boolean OR operator.") { } 30 37 } -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Sine.cs
r4068 r5275 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols; … … 27 28 [Item("Sine", "Symbol that represents the sine function.")] 28 29 public sealed class Sine : Symbol { 30 [StorableConstructor] 31 private Sine(bool deserializing) : base(deserializing) { } 32 private Sine(Sine original, Cloner cloner) : base(original, cloner) { } 33 public override IDeepCloneable Clone(Cloner cloner) { 34 return new Sine(this, cloner); 35 } 29 36 public Sine() : base("Sine", "Symbol that represents the sine function.") { } 30 37 } -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Subtraction.cs
r4068 r5275 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols; … … 27 28 [Item("Subtraction", "Symbol that represents the - operator.")] 28 29 public sealed class Subtraction : Symbol { 30 [StorableConstructor] 31 private Subtraction(bool deserializing) : base(deserializing) { } 32 private Subtraction(Subtraction original, Cloner cloner) : base(original, cloner) { } 33 public override IDeepCloneable Clone(Cloner cloner) { 34 return new Subtraction(this, cloner); 35 } 29 36 public Subtraction() : base("Subtraction", "Symbol that represents the - operator.") { } 30 37 } -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Tangent.cs
r4068 r5275 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols; … … 27 28 [Item("Tangent", "Symbol that represents the tangent trigonometric function.")] 28 29 public sealed class Tangent : Symbol { 30 [StorableConstructor] 31 private Tangent(bool deserializing) : base(deserializing) { } 32 private Tangent(Tangent original, Cloner cloner) : base(original, cloner) { } 33 public override IDeepCloneable Clone(Cloner cloner) { 34 return new Tangent(this, cloner); 35 } 29 36 public Tangent() : base("Tangent", "Symbol that represents the tangent trigonometric function.") { } 30 37 } -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Variable.cs
r4068 r5275 33 33 #region Properties 34 34 [Storable] 35 private double weight Nu;36 public double Weight Nu {37 get { return weight Nu; }35 private double weightMu; 36 public double WeightMu { 37 get { return weightMu; } 38 38 set { 39 if (value != weight Nu) {40 weight Nu = value;39 if (value != weightMu) { 40 weightMu = value; 41 41 OnChanged(EventArgs.Empty); 42 42 } … … 56 56 } 57 57 [Storable] 58 private double weightManipulator Nu;59 public double WeightManipulator Nu {60 get { return weightManipulator Nu; }58 private double weightManipulatorMu; 59 public double WeightManipulatorMu { 60 get { return weightManipulatorMu; } 61 61 set { 62 if (value != weightManipulator Nu) {63 weightManipulator Nu = value;62 if (value != weightManipulatorMu) { 63 weightManipulatorMu = value; 64 64 OnChanged(EventArgs.Empty); 65 65 } … … 90 90 } 91 91 #endregion 92 [StorableConstructor] 93 protected Variable(bool deserializing) : base(deserializing) { 94 variableNames = new List<string>(); 95 } 96 protected Variable(Variable original, Cloner cloner) 97 : base(original, cloner) { 98 weightMu = original.weightMu; 99 weightSigma = original.weightSigma; 100 variableNames = new List<string>(original.variableNames); 101 weightManipulatorMu = original.weightManipulatorMu; 102 weightManipulatorSigma = original.weightManipulatorSigma; 103 } 92 104 public Variable() : this("Variable", "Represents a variable value.") { } 93 105 public Variable(string name, string description) 94 106 : base(name, description) { 95 weight Nu = 1.0;107 weightMu = 1.0; 96 108 weightSigma = 1.0; 97 weightManipulator Nu = 0.0;109 weightManipulatorMu = 0.0; 98 110 weightManipulatorSigma = 1.0; 99 111 variableNames = new List<string>(); … … 105 117 106 118 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; 119 return new Variable(this, cloner); 114 120 } 115 121 } -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/VariableTreeNode.cs
r4220 r5275 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 using HeuristicLab.Common;24 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 44 44 } 45 45 46 47 protected VariableTreeNode() { } 48 49 // copy constructor 50 protected VariableTreeNode(VariableTreeNode original) 51 : base(original) { 46 [StorableConstructor] 47 protected VariableTreeNode(bool deserializing) : base(deserializing) { } 48 protected VariableTreeNode(VariableTreeNode original, Cloner cloner) 49 : base(original, cloner) { 52 50 weight = original.weight; 53 51 variableName = original.variableName; 54 52 } 55 53 protected VariableTreeNode() { } 56 54 public VariableTreeNode(Variable variableSymbol) : base(variableSymbol) { } 57 55 … … 64 62 public override void ResetLocalParameters(IRandom random) { 65 63 base.ResetLocalParameters(random); 66 weight = NormalDistributedRandom.NextDouble(random, Symbol.Weight Nu, Symbol.WeightSigma);64 weight = NormalDistributedRandom.NextDouble(random, Symbol.WeightMu, Symbol.WeightSigma); 67 65 variableName = Symbol.VariableNames.SelectRandom(random); 68 66 } … … 70 68 public override void ShakeLocalParameters(IRandom random, double shakingFactor) { 71 69 base.ShakeLocalParameters(random, shakingFactor); 72 double x = NormalDistributedRandom.NextDouble(random, Symbol.WeightManipulator Nu, Symbol.WeightManipulatorSigma);70 double x = NormalDistributedRandom.NextDouble(random, Symbol.WeightManipulatorMu, Symbol.WeightManipulatorSigma); 73 71 weight = weight + x * shakingFactor; 74 72 variableName = Symbol.VariableNames.SelectRandom(random); 75 73 } 76 74 77 78 public override object Clone() { 79 return new VariableTreeNode(this); 75 public override IDeepCloneable Clone(Cloner cloner) { 76 return new VariableTreeNode(this, cloner); 80 77 } 81 78
Note: See TracChangeset
for help on using the changeset viewer.