[15765] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
[15712] | 3 | using System.Linq;
|
---|
[15861] | 4 | using System.Security.Cryptography;
|
---|
[15712] | 5 | using System.Threading;
|
---|
| 6 | using HeuristicLab.Algorithms.DataAnalysis.SymRegGrammarEnumeration.GrammarEnumeration;
|
---|
[15821] | 7 | using HeuristicLab.Collections;
|
---|
[15712] | 8 | using HeuristicLab.Common;
|
---|
| 9 | using HeuristicLab.Core;
|
---|
| 10 | using HeuristicLab.Data;
|
---|
| 11 | using HeuristicLab.Optimization;
|
---|
[15722] | 12 | using HeuristicLab.Parameters;
|
---|
[15712] | 13 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
| 14 | using HeuristicLab.Problems.DataAnalysis;
|
---|
| 15 |
|
---|
| 16 | namespace HeuristicLab.Algorithms.DataAnalysis.SymRegGrammarEnumeration {
|
---|
| 17 | [Item("Grammar Enumeration Symbolic Regression", "Iterates all possible model structures for a fixed grammar.")]
|
---|
| 18 | [StorableClass]
|
---|
| 19 | [Creatable(CreatableAttribute.Categories.DataAnalysisRegression, Priority = 250)]
|
---|
| 20 | public class GrammarEnumerationAlgorithm : FixedDataAnalysisAlgorithm<IRegressionProblem> {
|
---|
[15746] | 21 | #region properties and result names
|
---|
[15803] | 22 | private readonly string SearchStructureSizeName = "Search Structure Size";
|
---|
| 23 | private readonly string GeneratedPhrasesName = "Generated/Archived Phrases";
|
---|
[15746] | 24 | private readonly string GeneratedSentencesName = "Generated Sentences";
|
---|
| 25 | private readonly string DistinctSentencesName = "Distinct Sentences";
|
---|
| 26 | private readonly string PhraseExpansionsName = "Phrase Expansions";
|
---|
[15860] | 27 | private readonly string AverageSentenceComplexityName = "Avg. Sentence Complexity among Distinct";
|
---|
[15821] | 28 | private readonly string OverwrittenSentencesName = "Sentences overwritten";
|
---|
| 29 | private readonly string AnalyzersParameterName = "Analyzers";
|
---|
[15824] | 30 | private readonly string ExpansionsPerSecondName = "Expansions per second";
|
---|
[15712] | 31 |
|
---|
[15746] | 32 |
|
---|
[15861] | 33 | private readonly string OptimizeConstantsParameterName = "Optimize Constants";
|
---|
[15746] | 34 | private readonly string SearchDataStructureParameterName = "Search Data Structure";
|
---|
[15860] | 35 | private readonly string MaxComplexityParameterName = "Max. Complexity";
|
---|
[15722] | 36 | private readonly string GuiUpdateIntervalParameterName = "GUI Update Interval";
|
---|
[15765] | 37 |
|
---|
[15746] | 38 | public override bool SupportsPause { get { return false; } }
|
---|
[15712] | 39 |
|
---|
[15861] | 40 | protected IValueParameter<BoolValue> OptimizeConstantsParameter {
|
---|
| 41 | get { return (IValueParameter<BoolValue>)Parameters[OptimizeConstantsParameterName]; }
|
---|
| 42 | }
|
---|
| 43 |
|
---|
| 44 | public bool OptimizeConstants {
|
---|
| 45 | get { return OptimizeConstantsParameter.Value.Value; }
|
---|
| 46 | set { OptimizeConstantsParameter.Value.Value = value; }
|
---|
| 47 | }
|
---|
| 48 |
|
---|
[15860] | 49 | protected IValueParameter<IntValue> MaxComplexityParameter {
|
---|
| 50 | get { return (IValueParameter<IntValue>)Parameters[MaxComplexityParameterName]; }
|
---|
[15712] | 51 | }
|
---|
[15860] | 52 | public int MaxComplexity {
|
---|
| 53 | get { return MaxComplexityParameter.Value.Value; }
|
---|
| 54 | set { MaxComplexityParameter.Value.Value = value; }
|
---|
[15722] | 55 | }
|
---|
[15712] | 56 |
|
---|
[15723] | 57 | protected IValueParameter<IntValue> GuiUpdateIntervalParameter {
|
---|
| 58 | get { return (IValueParameter<IntValue>)Parameters[GuiUpdateIntervalParameterName]; }
|
---|
[15722] | 59 | }
|
---|
| 60 | public int GuiUpdateInterval {
|
---|
| 61 | get { return GuiUpdateIntervalParameter.Value.Value; }
|
---|
[15723] | 62 | set { GuiUpdateIntervalParameter.Value.Value = value; }
|
---|
[15722] | 63 | }
|
---|
[15712] | 64 |
|
---|
[15746] | 65 | protected IValueParameter<EnumValue<StorageType>> SearchDataStructureParameter {
|
---|
| 66 | get { return (IValueParameter<EnumValue<StorageType>>)Parameters[SearchDataStructureParameterName]; }
|
---|
[15723] | 67 | }
|
---|
[15746] | 68 | public StorageType SearchDataStructure {
|
---|
| 69 | get { return SearchDataStructureParameter.Value.Value; }
|
---|
| 70 | set { SearchDataStructureParameter.Value.Value = value; }
|
---|
[15723] | 71 | }
|
---|
| 72 |
|
---|
[15821] | 73 | public IFixedValueParameter<ReadOnlyCheckedItemCollection<IGrammarEnumerationAnalyzer>> AnalyzersParameter {
|
---|
| 74 | get { return (IFixedValueParameter<ReadOnlyCheckedItemCollection<IGrammarEnumerationAnalyzer>>)Parameters[AnalyzersParameterName]; }
|
---|
| 75 | }
|
---|
| 76 |
|
---|
| 77 | public ICheckedItemCollection<IGrammarEnumerationAnalyzer> Analyzers {
|
---|
| 78 | get { return AnalyzersParameter.Value; }
|
---|
| 79 | }
|
---|
| 80 |
|
---|
[15824] | 81 | public SymbolString BestTrainingSentence { get; set; } // Currently set in RSquaredEvaluator: quite hacky, but makes testing much easier for now...
|
---|
[15722] | 82 | #endregion
|
---|
[15712] | 83 |
|
---|
[15860] | 84 | public Dictionary<int, int> DistinctSentencesComplexity { get; private set; } // Semantically distinct sentences and their length in a run.
|
---|
[15812] | 85 | public HashSet<int> ArchivedPhrases { get; private set; }
|
---|
[15821] | 86 | internal SearchDataStore OpenPhrases { get; private set; } // Stack/Queue/etc. for fetching the next node in the search tree.
|
---|
[15812] | 87 |
|
---|
[15821] | 88 | #region execution stats
|
---|
| 89 | public int AllGeneratedSentencesCount { get; private set; }
|
---|
[15746] | 90 |
|
---|
[15821] | 91 | public int OverwrittenSentencesCount { get; private set; } // It is not guaranteed that shorter solutions are found first.
|
---|
| 92 | // When longer solutions are overwritten with shorter ones,
|
---|
| 93 | // this counter is increased.
|
---|
| 94 | public int PhraseExpansionCount { get; private set; } // Number, how many times a nonterminal symbol is replaced with a production rule.
|
---|
| 95 | #endregion
|
---|
| 96 |
|
---|
[15800] | 97 | public Grammar Grammar { get; private set; }
|
---|
[15712] | 98 |
|
---|
[15765] | 99 |
|
---|
[15722] | 100 | #region ctors
|
---|
| 101 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
| 102 | return new GrammarEnumerationAlgorithm(this, cloner);
|
---|
| 103 | }
|
---|
[15712] | 104 |
|
---|
[15722] | 105 | public GrammarEnumerationAlgorithm() {
|
---|
[15723] | 106 | Problem = new RegressionProblem() {
|
---|
[15800] | 107 | ProblemData = new HeuristicLab.Problems.Instances.DataAnalysis.NguyenFunctionNine(seed: 1234).GenerateRegressionData()
|
---|
[15723] | 108 | };
|
---|
| 109 |
|
---|
[15861] | 110 | Parameters.Add(new ValueParameter<BoolValue>(OptimizeConstantsParameterName, "Run constant optimization in sentence evaluation.", new BoolValue(true)));
|
---|
[15860] | 111 | Parameters.Add(new ValueParameter<IntValue>(MaxComplexityParameterName, "The maximum number of variable symbols in a sentence.", new IntValue(5)));
|
---|
[15843] | 112 | Parameters.Add(new ValueParameter<IntValue>(GuiUpdateIntervalParameterName, "Number of generated sentences, until GUI is refreshed.", new IntValue(100000)));
|
---|
[15784] | 113 | Parameters.Add(new ValueParameter<EnumValue<StorageType>>(SearchDataStructureParameterName, new EnumValue<StorageType>(StorageType.Stack)));
|
---|
[15821] | 114 |
|
---|
| 115 | var availableAnalyzers = new IGrammarEnumerationAnalyzer[] {
|
---|
| 116 | new SearchGraphVisualizer(),
|
---|
[15824] | 117 | new SentenceLogger(),
|
---|
| 118 | new RSquaredEvaluator()
|
---|
[15821] | 119 | };
|
---|
| 120 | Parameters.Add(new FixedValueParameter<ReadOnlyCheckedItemCollection<IGrammarEnumerationAnalyzer>>(
|
---|
| 121 | AnalyzersParameterName,
|
---|
| 122 | new CheckedItemCollection<IGrammarEnumerationAnalyzer>(availableAnalyzers).AsReadOnly()));
|
---|
| 123 |
|
---|
| 124 | foreach (var analyzer in Analyzers) {
|
---|
| 125 | Analyzers.SetItemCheckedState(analyzer, false);
|
---|
| 126 | }
|
---|
| 127 | Analyzers.CheckedItemsChanged += AnalyzersOnCheckedItemsChanged;
|
---|
[15824] | 128 | Analyzers.SetItemCheckedState(Analyzers.First(analyzer => analyzer is RSquaredEvaluator), true);
|
---|
[15842] | 129 | Analyzers.SetItemCheckedState(Analyzers.First(analyzer => analyzer is SentenceLogger), true);
|
---|
[15722] | 130 | }
|
---|
[15712] | 131 |
|
---|
[15746] | 132 | public GrammarEnumerationAlgorithm(GrammarEnumerationAlgorithm original, Cloner cloner) : base(original, cloner) { }
|
---|
[15722] | 133 | #endregion
|
---|
[15712] | 134 |
|
---|
[15722] | 135 | protected override void Run(CancellationToken cancellationToken) {
|
---|
[15746] | 136 | #region init
|
---|
| 137 | InitResults();
|
---|
[15723] | 138 |
|
---|
[15861] | 139 | Analyzers.OfType<RSquaredEvaluator>().First().OptimizeConstants = OptimizeConstants;
|
---|
| 140 |
|
---|
[15812] | 141 | ArchivedPhrases = new HashSet<int>();
|
---|
| 142 |
|
---|
[15860] | 143 | DistinctSentencesComplexity = new Dictionary<int, int>();
|
---|
[15821] | 144 | AllGeneratedSentencesCount = 0;
|
---|
| 145 | OverwrittenSentencesCount = 0;
|
---|
| 146 | PhraseExpansionCount = 0;
|
---|
[15746] | 147 |
|
---|
[15724] | 148 | Grammar = new Grammar(Problem.ProblemData.AllowedInputVariables.ToArray());
|
---|
[15712] | 149 |
|
---|
[15746] | 150 | OpenPhrases = new SearchDataStore(SearchDataStructure); // Select search strategy
|
---|
[15734] | 151 | var phrase0 = new SymbolString(new[] { Grammar.StartSymbol });
|
---|
[15832] | 152 | var phrase0Hash = Grammar.Hasher.CalcHashCode(phrase0);
|
---|
[15746] | 153 | #endregion
|
---|
[15712] | 154 |
|
---|
[15883] | 155 | OpenPhrases.Store(phrase0Hash, 0.0, phrase0);
|
---|
[15821] | 156 | while (OpenPhrases.Count > 0) {
|
---|
| 157 | if (cancellationToken.IsCancellationRequested) break;
|
---|
[15746] | 158 |
|
---|
[15821] | 159 | StoredSymbolString fetchedPhrase = OpenPhrases.GetNext();
|
---|
| 160 | SymbolString currPhrase = fetchedPhrase.SymbolString;
|
---|
[15722] | 161 |
|
---|
[15821] | 162 | OnPhraseFetched(fetchedPhrase.Hash, currPhrase);
|
---|
[15765] | 163 |
|
---|
[15821] | 164 | ArchivedPhrases.Add(fetchedPhrase.Hash);
|
---|
[15726] | 165 |
|
---|
[15821] | 166 | // expand next nonterminal symbols
|
---|
[15827] | 167 | int nonterminalSymbolIndex = currPhrase.NextNonterminalIndex();
|
---|
| 168 | NonterminalSymbol expandedSymbol = (NonterminalSymbol)currPhrase[nonterminalSymbolIndex];
|
---|
[15834] | 169 | var appliedProductions = Grammar.Productions[expandedSymbol];
|
---|
[15734] | 170 |
|
---|
[15827] | 171 | for (int i = 0; i < appliedProductions.Count; i++) {
|
---|
[15821] | 172 | PhraseExpansionCount++;
|
---|
[15734] | 173 |
|
---|
[15827] | 174 | SymbolString newPhrase = currPhrase.DerivePhrase(nonterminalSymbolIndex, appliedProductions[i]);
|
---|
[15860] | 175 | int newPhraseComplexity = Grammar.GetComplexity(newPhrase);
|
---|
[15712] | 176 |
|
---|
[15860] | 177 | if (newPhraseComplexity <= MaxComplexity) {
|
---|
[15832] | 178 | var phraseHash = Grammar.Hasher.CalcHashCode(newPhrase);
|
---|
[15765] | 179 |
|
---|
[15827] | 180 | OnPhraseDerived(fetchedPhrase.Hash, fetchedPhrase.SymbolString, phraseHash, newPhrase, expandedSymbol, appliedProductions[i]);
|
---|
[15800] | 181 |
|
---|
[15821] | 182 | if (newPhrase.IsSentence()) {
|
---|
| 183 | AllGeneratedSentencesCount++;
|
---|
| 184 |
|
---|
[15827] | 185 | OnSentenceGenerated(fetchedPhrase.Hash, fetchedPhrase.SymbolString, phraseHash, newPhrase, expandedSymbol, appliedProductions[i]);
|
---|
[15821] | 186 |
|
---|
[15883] | 187 | // Is the best solution found? (only if RSquaredEvaluator is activated)
|
---|
[15907] | 188 | if (Results.ContainsKey(RSquaredEvaluator.BestTrainingQualityResultName)) {
|
---|
| 189 | double r2 = ((DoubleValue)Results[RSquaredEvaluator.BestTrainingQualityResultName].Value).Value;
|
---|
| 190 | if (r2.IsAlmost(1.0)) {
|
---|
| 191 | UpdateView(force: true);
|
---|
| 192 | return;
|
---|
| 193 | }
|
---|
[15883] | 194 | }
|
---|
| 195 |
|
---|
[15860] | 196 | if (!DistinctSentencesComplexity.ContainsKey(phraseHash) || DistinctSentencesComplexity[phraseHash] > newPhraseComplexity) {
|
---|
| 197 | if (DistinctSentencesComplexity.ContainsKey(phraseHash)) OverwrittenSentencesCount++; // for analysis only
|
---|
[15821] | 198 |
|
---|
[15860] | 199 | DistinctSentencesComplexity[phraseHash] = newPhraseComplexity;
|
---|
[15827] | 200 | OnDistinctSentenceGenerated(fetchedPhrase.Hash, fetchedPhrase.SymbolString, phraseHash, newPhrase, expandedSymbol, appliedProductions[i]);
|
---|
[15746] | 201 | }
|
---|
[15821] | 202 | UpdateView();
|
---|
| 203 |
|
---|
| 204 | } else if (!OpenPhrases.Contains(phraseHash) && !ArchivedPhrases.Contains(phraseHash)) {
|
---|
[15883] | 205 | double phrasePriority = GetPriority(newPhrase);
|
---|
| 206 | OpenPhrases.Store(phraseHash, phrasePriority, newPhrase);
|
---|
[15712] | 207 | }
|
---|
| 208 | }
|
---|
| 209 | }
|
---|
| 210 | }
|
---|
[15812] | 211 | UpdateView(force: true);
|
---|
[15746] | 212 | }
|
---|
[15723] | 213 |
|
---|
[15883] | 214 | protected double GetPriority(SymbolString phrase) {
|
---|
[15907] | 215 | double complexity = (double)Grammar.GetComplexity(phrase);
|
---|
| 216 |
|
---|
| 217 | double length = phrase.Count();
|
---|
| 218 | double relLength = (length - 2) / (MaxComplexity * 7);
|
---|
| 219 | double r2 = Grammar.EvaluatePhrase(phrase, Problem.ProblemData, OptimizeConstants);
|
---|
| 220 | double error = 1.0 - r2;
|
---|
| 221 |
|
---|
| 222 | double variables = 0;
|
---|
| 223 | for (int i = 0; i < phrase.Count(); i++) {
|
---|
| 224 | if (phrase[i] is VariableTerminalSymbol) variables++;
|
---|
| 225 | }
|
---|
| 226 |
|
---|
| 227 | double variableRatio = 1.0 - variables / complexity;
|
---|
| 228 |
|
---|
| 229 | return 1.5*relLength + error;
|
---|
[15883] | 230 | }
|
---|
| 231 |
|
---|
[15821] | 232 | #region Visualization in HL
|
---|
[15746] | 233 | // Initialize entries in result set.
|
---|
| 234 | private void InitResults() {
|
---|
[15803] | 235 | Results.Add(new Result(GeneratedPhrasesName, new IntValue(0)));
|
---|
| 236 | Results.Add(new Result(SearchStructureSizeName, new IntValue(0)));
|
---|
[15746] | 237 | Results.Add(new Result(GeneratedSentencesName, new IntValue(0)));
|
---|
| 238 | Results.Add(new Result(DistinctSentencesName, new IntValue(0)));
|
---|
| 239 | Results.Add(new Result(PhraseExpansionsName, new IntValue(0)));
|
---|
[15821] | 240 | Results.Add(new Result(OverwrittenSentencesName, new IntValue(0)));
|
---|
[15860] | 241 | Results.Add(new Result(AverageSentenceComplexityName, new DoubleValue(1.0)));
|
---|
[15824] | 242 | Results.Add(new Result(ExpansionsPerSecondName, "In Thousand expansions per second", new IntValue(0)));
|
---|
[15712] | 243 | }
|
---|
[15746] | 244 |
|
---|
| 245 | // Update the view for intermediate results in an algorithm run.
|
---|
| 246 | private int updates;
|
---|
[15812] | 247 | private void UpdateView(bool force = false) {
|
---|
[15746] | 248 | updates++;
|
---|
| 249 |
|
---|
[15812] | 250 | if (force || updates % GuiUpdateInterval == 1) {
|
---|
[15803] | 251 | ((IntValue)Results[GeneratedPhrasesName].Value).Value = ArchivedPhrases.Count;
|
---|
| 252 | ((IntValue)Results[SearchStructureSizeName].Value).Value = OpenPhrases.Count;
|
---|
[15821] | 253 | ((IntValue)Results[GeneratedSentencesName].Value).Value = AllGeneratedSentencesCount;
|
---|
[15860] | 254 | ((IntValue)Results[DistinctSentencesName].Value).Value = DistinctSentencesComplexity.Count;
|
---|
[15821] | 255 | ((IntValue)Results[PhraseExpansionsName].Value).Value = PhraseExpansionCount;
|
---|
[15860] | 256 | ((DoubleValue)Results[AverageSentenceComplexityName].Value).Value = DistinctSentencesComplexity.Select(pair => pair.Value).Average();
|
---|
[15821] | 257 | ((IntValue)Results[OverwrittenSentencesName].Value).Value = OverwrittenSentencesCount;
|
---|
[15824] | 258 | ((IntValue)Results[ExpansionsPerSecondName].Value).Value = (int)((PhraseExpansionCount /
|
---|
| 259 | ExecutionTime.TotalSeconds) / 1000.0);
|
---|
[15746] | 260 | }
|
---|
| 261 | }
|
---|
[15821] | 262 | #endregion
|
---|
[15746] | 263 |
|
---|
[15821] | 264 | #region events
|
---|
| 265 | private void AnalyzersOnCheckedItemsChanged(object sender, CollectionItemsChangedEventArgs<IGrammarEnumerationAnalyzer> collectionItemsChangedEventArgs) {
|
---|
| 266 | foreach (IGrammarEnumerationAnalyzer grammarEnumerationAnalyzer in collectionItemsChangedEventArgs.Items) {
|
---|
| 267 | if (Analyzers.ItemChecked(grammarEnumerationAnalyzer)) {
|
---|
| 268 | grammarEnumerationAnalyzer.Register(this);
|
---|
| 269 | } else {
|
---|
| 270 | grammarEnumerationAnalyzer.Deregister(this);
|
---|
[15746] | 271 | }
|
---|
| 272 | }
|
---|
[15821] | 273 | }
|
---|
[15746] | 274 |
|
---|
[15821] | 275 | public event EventHandler<PhraseEventArgs> PhraseFetched;
|
---|
| 276 | private void OnPhraseFetched(int hash, SymbolString symbolString) {
|
---|
| 277 | if (PhraseFetched != null) {
|
---|
| 278 | PhraseFetched(this, new PhraseEventArgs(hash, symbolString));
|
---|
[15746] | 279 | }
|
---|
| 280 | }
|
---|
[15812] | 281 |
|
---|
[15821] | 282 | public event EventHandler<PhraseAddedEventArgs> PhraseDerived;
|
---|
| 283 | private void OnPhraseDerived(int parentHash, SymbolString parentSymbolString, int addedHash, SymbolString addedSymbolString, Symbol expandedSymbol, Production expandedProduction) {
|
---|
| 284 | if (PhraseDerived != null) {
|
---|
| 285 | PhraseDerived(this, new PhraseAddedEventArgs(parentHash, parentSymbolString, addedHash, addedSymbolString, expandedSymbol, expandedProduction));
|
---|
| 286 | }
|
---|
[15803] | 287 | }
|
---|
[15765] | 288 |
|
---|
[15821] | 289 | public event EventHandler<PhraseAddedEventArgs> SentenceGenerated;
|
---|
| 290 | private void OnSentenceGenerated(int parentHash, SymbolString parentSymbolString, int addedHash, SymbolString addedSymbolString, Symbol expandedSymbol, Production expandedProduction) {
|
---|
| 291 | if (SentenceGenerated != null) {
|
---|
| 292 | SentenceGenerated(this, new PhraseAddedEventArgs(parentHash, parentSymbolString, addedHash, addedSymbolString, expandedSymbol, expandedProduction));
|
---|
| 293 | }
|
---|
| 294 | }
|
---|
| 295 |
|
---|
| 296 | public event EventHandler<PhraseAddedEventArgs> DistinctSentenceGenerated;
|
---|
| 297 | private void OnDistinctSentenceGenerated(int parentHash, SymbolString parentSymbolString, int addedHash, SymbolString addedSymbolString, Symbol expandedSymbol, Production expandedProduction) {
|
---|
| 298 | if (DistinctSentenceGenerated != null) {
|
---|
| 299 | DistinctSentenceGenerated(this, new PhraseAddedEventArgs(parentHash, parentSymbolString, addedHash, addedSymbolString, expandedSymbol, expandedProduction));
|
---|
| 300 | }
|
---|
| 301 | }
|
---|
| 302 |
|
---|
| 303 | #endregion
|
---|
| 304 |
|
---|
[15712] | 305 | }
|
---|
[15821] | 306 |
|
---|
| 307 | #region events for analysis
|
---|
| 308 |
|
---|
| 309 | public class PhraseEventArgs : EventArgs {
|
---|
| 310 | public int Hash { get; }
|
---|
| 311 |
|
---|
| 312 | public SymbolString Phrase { get; }
|
---|
| 313 |
|
---|
| 314 | public PhraseEventArgs(int hash, SymbolString phrase) {
|
---|
| 315 | Hash = hash;
|
---|
| 316 | Phrase = phrase;
|
---|
| 317 | }
|
---|
| 318 | }
|
---|
| 319 |
|
---|
| 320 | public class PhraseAddedEventArgs : EventArgs {
|
---|
| 321 | public int ParentHash { get; }
|
---|
| 322 | public int NewHash { get; }
|
---|
| 323 |
|
---|
| 324 | public SymbolString ParentPhrase { get; }
|
---|
| 325 | public SymbolString NewPhrase { get; }
|
---|
| 326 |
|
---|
| 327 | public Symbol ExpandedSymbol { get; }
|
---|
| 328 |
|
---|
| 329 | public Production ExpandedProduction { get; }
|
---|
| 330 |
|
---|
| 331 | public PhraseAddedEventArgs(int parentHash, SymbolString parentPhrase, int newHash, SymbolString newPhrase, Symbol expandedSymbol, Production expandedProduction) {
|
---|
| 332 | ParentHash = parentHash;
|
---|
| 333 | ParentPhrase = parentPhrase;
|
---|
| 334 | NewHash = newHash;
|
---|
| 335 | NewPhrase = newPhrase;
|
---|
| 336 | ExpandedSymbol = expandedSymbol;
|
---|
| 337 | ExpandedProduction = expandedProduction;
|
---|
| 338 | }
|
---|
| 339 | }
|
---|
| 340 |
|
---|
| 341 | #endregion
|
---|
[15712] | 342 | } |
---|