Changeset 14878 for branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars
- Timestamp:
- 04/19/17 16:53:09 (8 years ago)
- Location:
- branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic
- Property svn:mergeinfo changed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/ArithmeticExpressionGrammar.cs
r14312 r14878 53 53 constant.MaxValue = 20; 54 54 var variableSymbol = new HeuristicLab.Problems.DataAnalysis.Symbolic.Variable(); 55 var binFactorVariableSymbol = new BinaryFactorVariable(); 56 var factorVariableSymbol = new FactorVariable(); 55 57 56 var allSymbols = new List<Symbol>() { add, sub, mul, div, constant, variableSymbol 58 var allSymbols = new List<Symbol>() { add, sub, mul, div, constant, variableSymbol, binFactorVariableSymbol, factorVariableSymbol}; 57 59 var functionSymbols = new List<Symbol>() { add, sub, mul, div }; 58 60 … … 65 67 SetSubtreeCount(constant, 0, 0); 66 68 SetSubtreeCount(variableSymbol, 0, 0); 69 SetSubtreeCount(binFactorVariableSymbol, 0, 0); 70 SetSubtreeCount(factorVariableSymbol, 0, 0); 67 71 68 72 // allow each symbol as child of the start symbol -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/FullFunctionalExpressionGrammar.cs
r14312 r14878 115 115 constant.MaxValue = 20; 116 116 var variableSymbol = new HeuristicLab.Problems.DataAnalysis.Symbolic.Variable(); 117 var binFactorVariable = new BinaryFactorVariable(); 118 var factorVariable = new FactorVariable(); 117 119 var laggedVariable = new LaggedVariable(); 118 120 laggedVariable.InitialFrequency = 0.0; … … 123 125 var allSymbols = new List<Symbol>() { add, sub, mul, div, mean, sin, cos, tan, log, square, pow, sqrt, root, exp, 124 126 airyA, airyB, bessel, cosineIntegral, dawson, erf, expIntegralEi, fresnelCosineIntegral, fresnelSineIntegral, gamma, hypCosineIntegral, hypSineIntegral, norm, psi, sineIntegral, 125 @if, gt, lt, and, or, not,xor, timeLag, integral, derivative, constant, variableSymbol, laggedVariable,autoregressiveVariable, variableCondition };127 @if, gt, lt, and, or, not,xor, timeLag, integral, derivative, constant, variableSymbol, binFactorVariable, factorVariable, laggedVariable,autoregressiveVariable, variableCondition }; 126 128 var unaryFunctionSymbols = new List<Symbol>() { square, sqrt, sin, cos, tan, log, exp, not, timeLag, integral, derivative, 127 129 airyA, airyB, bessel, cosineIntegral, dawson, erf, expIntegralEi, fresnelCosineIntegral, fresnelSineIntegral, gamma, hypCosineIntegral, hypSineIntegral, norm, psi, sineIntegral … … 130 132 var binaryFunctionSymbols = new List<Symbol>() { pow, root, gt, lt, variableCondition }; 131 133 var ternarySymbols = new List<Symbol>() { add, sub, mul, div, mean, and, or, xor }; 132 var terminalSymbols = new List<Symbol>() { variableSymbol, constant, laggedVariable, autoregressiveVariable };134 var terminalSymbols = new List<Symbol>() { variableSymbol, binFactorVariable, factorVariable, constant, laggedVariable, autoregressiveVariable }; 133 135 134 136 foreach (var symb in allSymbols) -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentExpressionGrammar.cs
r14312 r14878 26 26 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols;29 28 30 29 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { … … 88 87 var psi = new Psi(); 89 88 var sineIntegral = new SineIntegral(); 90 var passthrough = new Passthrough();91 89 92 90 var @if = new IfThenElse(); … … 107 105 constant.MaxValue = 20; 108 106 var variableSymbol = new Variable(); 107 var binFactorVariable = new BinaryFactorVariable(); 108 var factorVariable = new FactorVariable(); 109 109 var laggedVariable = new LaggedVariable(); 110 110 var autoregressiveVariable = new AutoregressiveTargetVariable(); … … 115 115 var trigonometricSymbols = new GroupSymbol(TrigonometricFunctionsName, new List<ISymbol>() { sin, cos, tan }); 116 116 var exponentialAndLogarithmicSymbols = new GroupSymbol(ExponentialFunctionsName, new List<ISymbol> { exp, log }); 117 var specialFunctions = new GroupSymbol(SpecialFunctionsName, new List<ISymbol> { airyA, airyB, bessel, cosineIntegral, dawson, erf, expIntegralEi, 118 fresnelCosineIntegral,fresnelSineIntegral,gamma,hypCosineIntegral,hypSineIntegral,norm, psi, sineIntegral , passthrough});119 var terminalSymbols = new GroupSymbol(TerminalsName, new List<ISymbol> { constant, variableSymbol });117 var specialFunctions = new GroupSymbol(SpecialFunctionsName, new List<ISymbol> { airyA, airyB, bessel, cosineIntegral, dawson, erf, expIntegralEi, 118 fresnelCosineIntegral,fresnelSineIntegral,gamma,hypCosineIntegral,hypSineIntegral,norm, psi, sineIntegral}); 119 var terminalSymbols = new GroupSymbol(TerminalsName, new List<ISymbol> { constant, variableSymbol, binFactorVariable, factorVariable }); 120 120 var realValuedSymbols = new GroupSymbol(RealValuedSymbolsName, new List<ISymbol>() { arithmeticSymbols, trigonometricSymbols, exponentialAndLogarithmicSymbols, specialFunctions, terminalSymbols }); 121 121 … … 159 159 SetSubtreeCount(laggedVariable, 0, 0); 160 160 SetSubtreeCount(autoregressiveVariable, 0, 0); 161 SetSubtreeCount(passthrough, 1, 1);162 161 #endregion 163 162 … … 228 227 AddAllowedChildSymbol(derivative, powerSymbols); 229 228 AddAllowedChildSymbol(derivative, conditionSymbols); 230 231 AddAllowedChildSymbol(passthrough, realValuedSymbols);232 AddAllowedChildSymbol(passthrough, powerSymbols);233 AddAllowedChildSymbol(passthrough, conditionSymbols);234 AddAllowedChildSymbol(passthrough, timeSeriesSymbols);235 AddAllowedChildSymbol(passthrough, specialFunctions);236 229 #endregion 237 230 }
Note: See TracChangeset
for help on using the changeset viewer.