Free cookie consent management tool by TermsFeed Policy Generator

Changeset 17752


Ignore:
Timestamp:
09/21/20 16:03:05 (4 years ago)
Author:
pfleck
Message:

#3040 Added subvector symbol to grammar

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentVectorExpressionGrammar.cs

    r17604 r17752  
    4949    private const string VectorSymbolsName = "Vector Symbols";
    5050
     51    private const string VectorManipulationSymbolsName = "Vector Manipulation Symbols";
     52
    5153    private const string RealValuedSymbolsName = "Real Valued Symbols";
    5254
     
    124126      #endregion
    125127
     128      #region vector manipulation symbol declaration
     129      var subvector = new SubVector() { EnableWindowing = true };
     130      #endregion
     131
    126132      #region group symbol declaration
    127133      var arithmeticSymbols = new GroupSymbol(ArithmeticFunctionsName, new List<ISymbol>() { add, sub, mul, div });
     
    142148      var vectorSymbols = new GroupSymbol(VectorSymbolsName, new List<ISymbol>() { vectorarithmeticSymbols, vectortrigonometricSymbols, vectorexponentialAndLogarithmicSymbols, vectorpowerSymbols, vectorterminalSymbols });
    143149
     150      var vectorManipulationSymbols = new GroupSymbol(VectorManipulationSymbolsName, new List<ISymbol>() { subvector });
     151
    144152      //var realValuedSymbols = new GroupSymbol(RealValuedSymbolsName, new List<ISymbol> { scalarSymbols, vectorSymbols });
    145 
    146 
    147153      #endregion
    148154
     
    150156      AddSymbol(scalarSymbols);
    151157      AddSymbol(vectorSymbols);
     158      AddSymbol(vectorManipulationSymbols);
    152159
    153160      #region subtree count configuration
     
    177184      SetSubtreeCount(vectorexponentialAndLogarithmicSymbols, 1, 1);
    178185      SetSubtreeCount(vectorterminalSymbols, 0, 0);
     186
     187      SetSubtreeCount(subvector, 1, 1);
    179188      #endregion
    180189
     
    189198      AddAllowedChildSymbol(root, constant, 1);
    190199      AddAllowedChildSymbol(aggregationSymbols, vectorSymbols);
     200      AddAllowedChildSymbol(statisticsSymbols, subvector);
    191201
    192202      AddAllowedChildSymbol(vectorarithmeticSymbols, vectorSymbols);
     
    197207      AddAllowedChildSymbol(vectorpower, constant, 1);
    198208      AddAllowedChildSymbol(vectorroot, constant, 1);
     209
     210      AddAllowedChildSymbol(subvector, vectorSymbols);
    199211      #endregion
    200212
     
    202214      var disabledByDefault = new[] {
    203215        TrigonometricFunctionsName, ExponentialFunctionsName, PowerFunctionsName,
    204         VectorTrigonometricFunctionsName, VectorExponentialFunctionsName, VectorPowerFunctionsName
     216        VectorTrigonometricFunctionsName, VectorExponentialFunctionsName, VectorPowerFunctionsName,
     217        VectorManipulationSymbolsName
    205218      };
    206219      foreach (var grp in Symbols.Where(sym => disabledByDefault.Contains(sym.Name)))
Note: See TracChangeset for help on using the changeset viewer.