Changeset 3269 for trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Symbols/ConstantTreeNode.cs
- Timestamp:
- 04/05/10 18:52:23 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Symbols/ConstantTreeNode.cs
r3258 r3269 24 24 using System.Collections.Generic; 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 using HeuristicLab.Core; 27 using HeuristicLab.Data; 28 using HeuristicLab.Random; 26 29 namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic.Symbols { 27 30 [StorableClass] 28 31 public sealed class ConstantTreeNode : SymbolicExpressionTreeTerminalNode { 32 public new Constant Symbol { 33 get { return (Constant)base.Symbol; } 34 } 29 35 public override bool HasLocalParameters { 30 36 get { … … 39 45 set { constantValue = value; } 40 46 } 41 42 47 // copy constructor 43 48 private ConstantTreeNode(ConstantTreeNode original) … … 48 53 public ConstantTreeNode(Constant constantSymbol) : base(constantSymbol) { } 49 54 55 public override void ResetLocalParameters(IRandom random) { 56 base.ResetLocalParameters(random); 57 var range = Symbol.MaxValue.Value - Symbol.MaxValue.Value; 58 Value = random.NextDouble() * range - Symbol.MinValue.Value; 59 } 60 50 61 public override object Clone() { 51 62 return new ConstantTreeNode(this);
Note: See TracChangeset
for help on using the changeset viewer.