Changeset 9459


Ignore:
Timestamp:
05/07/13 13:05:27 (8 years ago)
Author:
mkommend
Message:

#1081: Updated TypeCoherentGrammar to take time-series, power, and condition symbols into account.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentExpressionGrammar.cs

    r9456 r9459  
    158158      #region allowed child symbols configuration
    159159      AddAllowedChildSymbol(StartSymbol, realValuedSymbols);
     160      AddAllowedChildSymbol(StartSymbol, powerSymbols);
     161      AddAllowedChildSymbol(StartSymbol, conditionSymbols);
     162      AddAllowedChildSymbol(StartSymbol, timeSeriesSymbols);
     163      AddAllowedChildSymbol(StartSymbol, specialFunctions);
     164
    160165      AddAllowedChildSymbol(DefunSymbol, realValuedSymbols);
     166      AddAllowedChildSymbol(DefunSymbol, powerSymbols);
     167      AddAllowedChildSymbol(DefunSymbol, conditionSymbols);
     168      AddAllowedChildSymbol(DefunSymbol, timeSeriesSymbols);
     169      AddAllowedChildSymbol(DefunSymbol, specialFunctions);
    161170
    162171      AddAllowedChildSymbol(realValuedSymbols, realValuedSymbols);
     
    168177      AddAllowedChildSymbol(powerSymbols, variableSymbol, 0);
    169178      AddAllowedChildSymbol(powerSymbols, laggedVariable, 0);
     179      AddAllowedChildSymbol(powerSymbols, autoregressiveVariable, 0);
    170180      AddAllowedChildSymbol(powerSymbols, constant, 1);
     181
    171182      AddAllowedChildSymbol(square, realValuedSymbols, 0);
     183      AddAllowedChildSymbol(square, conditionSymbols, 0);
     184      AddAllowedChildSymbol(square, timeSeriesSymbols, 0);
     185
    172186      AddAllowedChildSymbol(sqrt, realValuedSymbols, 0);
     187      AddAllowedChildSymbol(sqrt, conditionSymbols, 0);
     188      AddAllowedChildSymbol(sqrt, timeSeriesSymbols, 0);
    173189
    174190      AddAllowedChildSymbol(@if, comparisonSymbols, 0);
     
    235251      Symbols.First(s => s.Name == SpecialFunctionsName).Enabled = false;
    236252
     253
    237254      Symbols.First(s => s.Name == TimeSeriesSymbolsName).Enabled = true;
    238255      Symbols.First(s => s is Derivative).Enabled = false;
Note: See TracChangeset for help on using the changeset viewer.