Changeset 11494 for trunk/sources
- Timestamp:
- 10/24/14 16:45:06 (10 years ago)
- Location:
- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4
- Files:
-
- 2 added
- 2 edited
- 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 { -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj
r10562 r11494 136 136 <Compile Include="Formatters\SymbolicExpressionTreeGraphvizFormatter.cs" /> 137 137 <Compile Include="Formatters\SymbolicExpressionTreeHierarchicalFormatter.cs" /> 138 <Compile Include="Grammars\EmptySymbolicExpressionTreeGrammar.cs" /> 138 139 <Compile Include="Interfaces\IReadOnlySymbol.cs" /> 139 140 <Compile Include="Interfaces\ISymbolicExpressionGrammar.cs" /> … … 166 167 <Compile Include="Manipulators\SymbolicExpressionTreeManipulator.cs" /> 167 168 <Compile Include="Plugin.cs" /> 168 <Compile Include=" SymbolicExpressionGrammarBase.cs" />169 <Compile Include=" SymbolicExpressionGrammar.cs" />170 <Compile Include=" SymbolicExpressionTreeGrammar.cs" />169 <Compile Include="Grammars\SymbolicExpressionGrammarBase.cs" /> 170 <Compile Include="Grammars\SymbolicExpressionGrammar.cs" /> 171 <Compile Include="Grammars\SymbolicExpressionTreeGrammar.cs" /> 171 172 <Compile Include="SymbolicExpressionTreeTopLevelNode.cs" /> 172 173 <Compile Include="Crossovers\SubtreeCrossover.cs"> -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionGrammar.cs
r11171 r11494 48 48 void StartGrammarManipulation(); 49 49 void FinishedGrammarManipulation(); 50 51 ISymbolicExpressionTreeGrammar CreateExpressionTreeGrammar(); 50 52 } 51 53 }
Note: See TracChangeset
for help on using the changeset viewer.