- Timestamp:
- 11/08/10 11:20:08 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/GlobalSymbolicExpressionGrammar.cs
r4722 r4742 98 98 } 99 99 100 SetMinSubtreeCount(StartSymbol, minFunctionDefinitions + 1); 101 SetMaxSubtreeCount(StartSymbol, maxFunctionDefinitions + 1); 102 SetMinSubtreeCount(defunSymbol, 1); 100 SetMinSubtreeCount(StartSymbol, minFunctionDefinitions + 1); // min number of ADF + 1 for RPB 101 SetMaxSubtreeCount(StartSymbol, maxFunctionDefinitions + 1); // max number of ADF + 1 for RPB 102 // defun can have only one child 103 SetMinSubtreeCount(defunSymbol, 1); 103 104 SetMaxSubtreeCount(defunSymbol, 1); 105 104 106 105 107 // the start symbol of the mainBranchGrammar is allowed as the result producing branch 106 108 SetAllowedChild(StartSymbol, Symbols.Where(s => s.Name == mainBranchGrammar.StartSymbol.Name).First(), 0); 109 110 // defuns are allowed as children on the same level and after RPB 111 for (int i = 0; i < maxFunctionDefinitions; i++) { 112 // +1 because RPB has index 0 113 SetAllowedChild(StartSymbol, defunSymbol, i + 1); 114 } 107 115 108 116 // every symbol of the mainBranchGrammar that is allowed as child of the start symbol is also allowed as direct child of defun
Note: See TracChangeset
for help on using the changeset viewer.