Changeset 5686 for branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/ReplaceBranchManipulation.cs
- Timestamp:
- 03/15/11 13:34:38 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/ReplaceBranchManipulation.cs
r5569 r5686 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 22 using System.Linq; 25 23 using HeuristicLab.Common; 26 24 using HeuristicLab.Core; 27 25 using HeuristicLab.Data; 26 using HeuristicLab.Parameters; 28 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 using HeuristicLab.Parameters;30 28 31 29 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding { … … 77 75 let maxDepth = maxTreeDepth - symbolicExpressionTree.Depth + subtree.GetDepth() 78 76 // find possible symbols for the node (also considering the existing branches below it) 79 let allowedSymbols = (from symbol in parent.Grammar.GetAllowed Symbols(parent.Symbol, subtreeIndex)77 let allowedSymbols = (from symbol in parent.Grammar.GetAllowedChildSymbols(parent.Symbol, subtreeIndex) 80 78 // do not replace symbol with the same symbol 81 79 where symbol.Name != subtree.Symbol.Name 82 where parent.Grammar.GetMin ExpressionDepth(symbol) <= maxDepth83 where parent.Grammar.GetMin ExpressionLength(symbol) <= maxLength80 where parent.Grammar.GetMinimumExpressionDepth(symbol) <= maxDepth 81 where parent.Grammar.GetMinimumExpressionLength(symbol) <= maxLength 84 82 select symbol) 85 83 .ToList() … … 107 105 selectedManipulationPoint.Parent.RemoveSubTree(selectedManipulationPoint.Index); 108 106 selectedManipulationPoint.Parent.InsertSubTree(selectedManipulationPoint.Index, seedNode); 109 seedNode = ProbabilisticTreeCreator.PTC2(random, seedNode, selectedManipulationPoint.MaxLength, selectedManipulationPoint.MaxDepth, 0, 0);107 ProbabilisticTreeCreator.PTC2(random, seedNode, selectedManipulationPoint.MaxLength, selectedManipulationPoint.MaxDepth); 110 108 } 111 109 }
Note: See TracChangeset
for help on using the changeset viewer.