Changeset 11494 for trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Grammars
- Timestamp:
- 10/24/14 16:45:06 (10 years ago)
- Location:
- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Grammars
- Files:
-
- 2 added
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Grammars/SymbolicExpressionGrammar.cs
r11490 r11494 110 110 set { defunSymbol = (Defun)value; } 111 111 } 112 113 private readonly ISymbolicExpressionTreeGrammar emptyGrammar; 112 114 #endregion 113 115 … … 117 119 RegisterSymbolEvents(symbol); 118 120 } 121 119 122 [StorableConstructor] 120 protected SymbolicExpressionGrammar(bool deserializing) : base(deserializing) { } 123 protected SymbolicExpressionGrammar(bool deserializing) 124 : base(deserializing) { 125 emptyGrammar = new EmptySymbolicExpressionTreeGrammar(this); 126 } 121 127 protected SymbolicExpressionGrammar(SymbolicExpressionGrammar original, Cloner cloner) 122 128 : base(original, cloner) { 129 emptyGrammar = new EmptySymbolicExpressionTreeGrammar(this); 130 123 131 foreach (ISymbol symbol in symbols.Values) 124 132 RegisterSymbolEvents(symbol); … … 134 142 } 135 143 136 p ublicSymbolicExpressionGrammar(string name, string description)144 protected SymbolicExpressionGrammar(string name, string description) 137 145 : base(name, description) { 146 emptyGrammar = new EmptySymbolicExpressionTreeGrammar(this); 147 138 148 programRootSymbol = new ProgramRootSymbol(); 139 149 AddSymbol(programRootSymbol); … … 160 170 AddAllowedChildSymbol(programRootSymbol, defunSymbol, argumentIndex); 161 171 } 172 } 173 174 public ISymbolicExpressionTreeGrammar CreateExpressionTreeGrammar() { 175 if (MaximumFunctionDefinitions == 0) return emptyGrammar; 176 else return new SymbolicExpressionTreeGrammar(this); 162 177 } 163 178 -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Grammars/SymbolicExpressionGrammarBase.cs
r11490 r11494 64 64 65 65 private bool suppressEvents; 66 protected Dictionary<string, ISymbol> symbols;67 protected Dictionary<string, Tuple<int, int>> symbolSubtreeCount;68 protected Dictionary<string, List<string>> allowedChildSymbols;69 protected Dictionary<Tuple<string, int>, List<string>> allowedChildSymbolsPerIndex;66 protected internal Dictionary<string, ISymbol> symbols; 67 protected internal Dictionary<string, Tuple<int, int>> symbolSubtreeCount; 68 protected internal Dictionary<string, List<string>> allowedChildSymbols; 69 protected internal Dictionary<Tuple<string, int>, List<string>> allowedChildSymbolsPerIndex; 70 70 71 71 public override bool CanChangeName {
Note: See TracChangeset
for help on using the changeset viewer.