Changeset 4364 for trunk/sources/HeuristicLab.Problems.ExternalEvaluation.GP/3.3/Grammar/FullFunctionalExpressionGrammar.cs
- Timestamp:
- 09/03/10 13:26:02 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.ExternalEvaluation.GP/3.3/Grammar/FullFunctionalExpressionGrammar.cs
r4089 r4364 21 21 22 22 using System.Collections.Generic; 23 using System.Linq; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; … … 39 40 40 41 private void Initialize() { 42 var originalStart = StartSymbol; 43 if (!(originalStart is ProgramRootSymbol)) { 44 var root = new ProgramRootSymbol(); 45 AddSymbol(root); 46 SetMinSubtreeCount(root, 1); 47 SetMaxSubtreeCount(root, 1); 48 SetAllowedChild(root, originalStart, 0); 49 50 StartSymbol = root; 51 } 52 41 53 var add = new Addition(); 42 54 var sub = new Subtraction(); … … 90 102 // allow each symbol as child of the start symbol 91 103 foreach (var symb in allSymbols) { 92 SetAllowedChild( StartSymbol, symb, 0);104 SetAllowedChild(originalStart, symb, 0); 93 105 } 94 106
Note: See TracChangeset
for help on using the changeset viewer.