Changeset 13867 for branches/HeuristicLab.Problems.GeneticProgramming.BloodGlucosePrediction/RealGlucoseVariableTreeNode.cs
- Timestamp:
- 05/31/16 17:05:49 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.GeneticProgramming.BloodGlucosePrediction/RealGlucoseVariableTreeNode.cs
r13865 r13867 25 25 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Random; 27 28 28 29 namespace HeuristicLab.Problems.GeneticProgramming.GlucosePrediction { … … 38 39 set { rowOffset = value; } 39 40 } 41 42 [Storable] 43 private double weight; 44 public double Weight { 45 get { return weight; } 46 set { weight = value; } 47 } 40 48 [StorableConstructor] 41 49 protected RealGlucoseVariableTreeNode(bool deserializing) : base(deserializing) { } … … 43 51 : base(original, cloner) { 44 52 rowOffset = original.rowOffset; 53 weight = original.weight; 45 54 } 46 55 protected RealGlucoseVariableTreeNode() { } … … 54 63 base.ResetLocalParameters(random); 55 64 rowOffset = random.Next(Symbol.MinRowOffset, Symbol.MaxRowOffset + 1); 65 weight = NormalDistributedRandom.NextDouble(random, 0, 10); 56 66 } 57 67 … … 63 73 rowOffset = Math.Max(rowOffset, Symbol.MinRowOffset); 64 74 rowOffset = Math.Min(rowOffset, Symbol.MaxRowOffset); 75 weight += NormalDistributedRandom.NextDouble(random, 0, 1.0 * shakingFactor); 65 76 } 66 77 … … 70 81 71 82 public override string ToString() { 72 return "realGluc(k" + rowOffset + ")";83 return string.Format("{0:N3} * realGluc(k{1})", weight, rowOffset); 73 84 } 74 85 }
Note: See TracChangeset
for help on using the changeset viewer.