Changeset 7615 for branches/HeuristicLab.TimeSeries/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeNode.cs
- Timestamp:
- 03/15/12 09:11:17 (13 years ago)
- Location:
- branches/HeuristicLab.TimeSeries
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.TimeSeries
-
branches/HeuristicLab.TimeSeries/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeNode.cs
r7268 r7615 125 125 } 126 126 127 public int GetBranchLevel(ISymbolicExpressionTreeNode child) { 128 return GetBranchLevel(this, child); 129 } 130 131 private static int GetBranchLevel(ISymbolicExpressionTreeNode root, ISymbolicExpressionTreeNode point) { 132 if (root == point) 133 return 0; 134 foreach (var subtree in root.Subtrees) { 135 int branchLevel = GetBranchLevel(subtree, point); 136 if (branchLevel < int.MaxValue) 137 return 1 + branchLevel; 138 } 139 return int.MaxValue; 140 } 141 127 142 public virtual void ResetLocalParameters(IRandom random) { } 128 143 public virtual void ShakeLocalParameters(IRandom random, double shakingFactor) { }
Note: See TracChangeset
for help on using the changeset viewer.