Changeset 18100 for branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars
- Timestamp:
- 12/01/21 13:40:55 (3 years ago)
- Location:
- branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/ArithmeticExpressionGrammar.cs
r18093 r18100 49 49 var mul = new Multiplication(); 50 50 var div = new Division(); 51 var constant = new Num(); 52 constant.MinValue = -20; 53 constant.MaxValue = 20; 54 var number = new RealConstant(); 51 var number = new Number(); 55 52 number.MinValue = -20; 56 53 number.MaxValue = 20; 54 var constant = new Constant(); 57 55 var variableSymbol = new HeuristicLab.Problems.DataAnalysis.Symbolic.Variable(); 58 56 var binFactorVariableSymbol = new BinaryFactorVariable(); 59 57 var factorVariableSymbol = new FactorVariable(); 60 58 61 var allSymbols = new List<Symbol>() { add, sub, mul, div, constant, number, variableSymbol, binFactorVariableSymbol, factorVariableSymbol };59 var allSymbols = new List<Symbol>() { add, sub, mul, div, number, constant, variableSymbol, binFactorVariableSymbol, factorVariableSymbol }; 62 60 var functionSymbols = new List<Symbol>() { add, sub, mul, div }; 63 61 … … 68 66 SetSubtreeCount(funSymb, 1, 3); 69 67 } 68 SetSubtreeCount(number, 0, 0); 70 69 SetSubtreeCount(constant, 0, 0); 71 SetSubtreeCount(number, 0, 0);72 70 SetSubtreeCount(variableSymbol, 0, 0); 73 71 SetSubtreeCount(binFactorVariableSymbol, 0, 0); -
branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/FullFunctionalExpressionGrammar.cs
r18093 r18100 118 118 variableCondition.InitialFrequency = 0.0; 119 119 120 var constant = new Num();121 constant.MinValue = -20;122 constant.MaxValue = 20;120 var number = new Number(); 121 number.MinValue = -20; 122 number.MaxValue = 20; 123 123 var variableSymbol = new HeuristicLab.Problems.DataAnalysis.Symbolic.Variable(); 124 124 var binFactorVariable = new BinaryFactorVariable(); … … 130 130 autoregressiveVariable.Enabled = false; 131 131 132 var number = new RealConstant(); 133 number.MinValue = -20; 134 number.MaxValue = 20; 132 var constant = new Constant(); 135 133 136 134 var allSymbols = new List<Symbol>() { add, sub, mul, div, aq, mean, abs, sin, cos, tan, log, square, cube, pow, sqrt, cubeRoot, root, exp, tanh, 137 135 airyA, airyB, bessel, cosineIntegral, dawson, erf, expIntegralEi, fresnelCosineIntegral, fresnelSineIntegral, gamma, hypCosineIntegral, hypSineIntegral, norm, psi, sineIntegral, 138 @if, gt, lt, and, or, not,xor, timeLag, integral, derivative, constant, number, variableSymbol, binFactorVariable, factorVariable, laggedVariable,autoregressiveVariable, variableCondition };136 @if, gt, lt, and, or, not,xor, timeLag, integral, derivative, number, constant, variableSymbol, binFactorVariable, factorVariable, laggedVariable,autoregressiveVariable, variableCondition }; 139 137 var unaryFunctionSymbols = new List<Symbol>() { abs, square, sqrt, cube, cubeRoot, sin, cos, tan, log, exp, tanh, not, timeLag, integral, derivative, 140 138 airyA, airyB, bessel, cosineIntegral, dawson, erf, expIntegralEi, fresnelCosineIntegral, fresnelSineIntegral, gamma, hypCosineIntegral, hypSineIntegral, norm, psi, sineIntegral … … 143 141 var binaryFunctionSymbols = new List<Symbol>() { pow, root, gt, lt, aq, variableCondition }; 144 142 var ternarySymbols = new List<Symbol>() { add, sub, mul, div, mean, and, or, xor }; 145 var terminalSymbols = new List<Symbol>() { variableSymbol, binFactorVariable, factorVariable, constant, number, laggedVariable, autoregressiveVariable };143 var terminalSymbols = new List<Symbol>() { variableSymbol, binFactorVariable, factorVariable, number, constant, laggedVariable, autoregressiveVariable }; 146 144 147 145 foreach (var symb in allSymbols) -
branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/LinearScalingGrammar.cs
r18093 r18100 66 66 var abs = new Absolute(); 67 67 var aq = new AnalyticQuotient(); 68 var constant = new Num(); 69 constant.MinValue = -20; 70 constant.MaxValue = 20; 71 var number = new RealConstant(); 68 var number = new Number(); 72 69 number.MinValue = -20; 73 70 number.MaxValue = 20; 71 var constant = new Constant(); 74 72 var variableSymbol = new Variable(); 75 73 … … 81 79 //all other symbols 82 80 var allSymbols = new List<Symbol> { 83 add, sub, mul, div, constant, number, variableSymbol, sin, cos, tan, log, square, sqrt, cube, cbrt, exp,81 add, sub, mul, div, number, constant, variableSymbol, sin, cos, tan, log, square, sqrt, cube, cbrt, exp, 84 82 tanh, aq, abs 85 83 }; … … 89 87 var realValueSymbols = new List<Symbol> { 90 88 add, sub, mul, div, sin, cos, tan, tanh, exp, log, aq, abs, square, cube, sqrt, cbrt, 91 variableSymbol, constant, number89 variableSymbol, number, constant 92 90 }; 93 91 … … 116 114 //Define childs for offset 117 115 AddAllowedChildSymbol(offset, scaling, 0); 118 AddAllowedChildSymbol(offset, constant, 1);116 AddAllowedChildSymbol(offset, number, 1); 119 117 120 118 //Define childs for scaling 121 119 foreach (var symb in allSymbols) AddAllowedChildSymbol(scaling, symb, 0); 122 AddAllowedChildSymbol(scaling, constant, 1);120 AddAllowedChildSymbol(scaling, number, 1); 123 121 124 122 //Define childs for realvalue symbols -
branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentExpressionGrammar.cs
r18093 r18100 105 105 var derivative = new Derivative(); 106 106 107 var constant = new Num(); 108 constant.MinValue = -20; 109 constant.MaxValue = 20; 110 var number = new RealConstant(); 107 var number = new Number(); 111 108 number.MinValue = -20; 112 109 number.MaxValue = 20; 110 var constant = new Constant(); 113 111 var variableSymbol = new Variable(); 114 112 var binFactorVariable = new BinaryFactorVariable(); … … 124 122 var specialFunctions = new GroupSymbol(SpecialFunctionsName, new List<ISymbol> { abs, airyA, airyB, bessel, cosineIntegral, dawson, erf, expIntegralEi, 125 123 fresnelCosineIntegral,fresnelSineIntegral,gamma,hypCosineIntegral,hypSineIntegral,norm, psi, sineIntegral, analyticalQuotient}); 126 var terminalSymbols = new GroupSymbol(TerminalsName, new List<ISymbol> { constant, number, variableSymbol, binFactorVariable, factorVariable });124 var terminalSymbols = new GroupSymbol(TerminalsName, new List<ISymbol> { number, constant, variableSymbol, binFactorVariable, factorVariable }); 127 125 var realValuedSymbols = new GroupSymbol(RealValuedSymbolsName, new List<ISymbol>() { arithmeticSymbols, trigonometricSymbols, exponentialAndLogarithmicSymbols, specialFunctions, terminalSymbols }); 128 126 … … 196 194 AddAllowedChildSymbol(powerSymbols, laggedVariable, 0); 197 195 AddAllowedChildSymbol(powerSymbols, autoregressiveVariable, 0); 198 AddAllowedChildSymbol(powerSymbols, constant, 1);196 AddAllowedChildSymbol(powerSymbols, number, 1); 199 197 200 198 AddAllowedChildSymbol(square, realValuedSymbols, 0);
Note: See TracChangeset
for help on using the changeset viewer.