- Timestamp:
- 04/01/11 13:45:24 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/ProbabilisticTreeCreator.cs
r5809 r5925 153 153 } else { 154 154 var allowedSymbols = (from s in parent.Grammar.Symbols 155 where s.InitialFrequency > 0.0 155 156 where parent.Grammar.IsAllowedChildSymbol(parent.Symbol, s, argumentIndex) 156 157 where parent.Grammar.GetMinimumExpressionDepth(s) + extensionDepth - 1 < maxDepth … … 200 201 // determine possible symbols that will lead to the smallest possible tree 201 202 var possibleSymbols = (from s in parent.Grammar.GetAllowedChildSymbols(parent.Symbol, childIndex) 203 where s.InitialFrequency > 0.0 202 204 group s by parent.Grammar.GetMinimumExpressionLength(s) into g 203 205 orderby g.Key … … 239 241 for (int i = 0; i < maxArity; i++) { 240 242 aggregatedLongestExpressionLength += (from s in node.Grammar.GetAllowedChildSymbols(node.Symbol, i) 243 where s.InitialFrequency > 0.0 241 244 select node.Grammar.GetMaximumExpressionLength(s)).Max(); 242 if (aggregatedLongestExpressionLength < targetLength) minArity = i ;245 if (aggregatedLongestExpressionLength < targetLength) minArity = i + 1; 243 246 else break; 244 247 } … … 249 252 for (int i = 0; i < maxArity; i++) { 250 253 aggregatedShortestExpressionLength += (from s in node.Grammar.GetAllowedChildSymbols(node.Symbol, i) 254 where s.InitialFrequency > 0.0 251 255 select node.Grammar.GetMinimumExpressionLength(s)).Min(); 252 256 if (aggregatedShortestExpressionLength > targetLength) { -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/ChangeNodeTypeManipulation.cs
r5809 r5925 53 53 // do not replace the existing symbol with itself 54 54 where symbol.Name != subtree.Symbol.Name 55 where symbol.InitialFrequency > 0 55 56 where existingSubtreeCount <= parent.Grammar.GetMaximumSubtreeCount(symbol) 56 57 where existingSubtreeCount >= parent.Grammar.GetMinimumSubtreeCount(symbol) -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/ReplaceBranchManipulation.cs
r5809 r5925 78 78 // do not replace symbol with the same symbol 79 79 where symbol.Name != subtree.Symbol.Name 80 where symbol.InitialFrequency > 0 80 81 where parent.Grammar.GetMinimumExpressionDepth(symbol) <= maxDepth 81 82 where parent.Grammar.GetMinimumExpressionLength(symbol) <= maxLength
Note: See TracChangeset
for help on using the changeset viewer.