Changeset 13867 for branches/HeuristicLab.Problems.GeneticProgramming.BloodGlucosePrediction/RealInsulineVariableTreeNode.cs
- Timestamp:
- 05/31/16 17:05:49 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.GeneticProgramming.BloodGlucosePrediction/RealInsulineVariableTreeNode.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 [Storable] 42 private double weight; 43 public double Weight { 44 get { return weight; } 45 set { weight = value; } 46 } 40 47 [StorableConstructor] 41 48 protected RealInsulineVariableTreeNode(bool deserializing) : base(deserializing) { } … … 43 50 : base(original, cloner) { 44 51 rowOffset = original.rowOffset; 52 weight = original.weight; 45 53 } 46 54 protected RealInsulineVariableTreeNode() { } … … 54 62 base.ResetLocalParameters(random); 55 63 rowOffset = random.Next(Symbol.MinRowOffset, Symbol.MaxRowOffset + 1); 64 weight = NormalDistributedRandom.NextDouble(random, 0, 10); 56 65 } 57 66 … … 63 72 rowOffset = Math.Max(rowOffset, Symbol.MinRowOffset); 64 73 rowOffset = Math.Min(rowOffset, Symbol.MaxRowOffset); 74 weight += NormalDistributedRandom.NextDouble(random, 0, 1.0 * shakingFactor); 65 75 } 66 76 … … 70 80 71 81 public override string ToString() { 72 return "realIns(k" + rowOffset + ")";82 return string.Format("{0:N3}*realIns(k{1})", weight, rowOffset); 73 83 } 74 84 }
Note: See TracChangeset
for help on using the changeset viewer.