- Timestamp:
- 04/03/12 08:20:22 (13 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/FullFunctionalExpressionGrammar.cs
r7695 r7696 61 61 var sqrt = new SquareRoot(); 62 62 sqrt.InitialFrequency = 0.0; 63 var airyA = new AiryA(); 64 var airyB = new AiryB(); 65 var bessel = new Bessel(); 66 var cosineIntegral = new CosineIntegral(); 67 var dawson = new Dawson(); 68 var erf = new Erf(); 69 var expIntegralEi = new ExponentialIntegralEi(); 70 var fresnelCosineIntegral = new FresnelCosineIntegral(); 71 var fresnelSineIntegral = new FresnelSineIntegral(); 72 var gamma = new Gamma(); 73 var hypCosineIntegral = new HyperbolicCosineIntegral(); 74 var hypSineIntegral = new HyperbolicSineIntegral(); 75 var norm = new Norm(); 76 var psi = new Psi(); 77 var sineIntegral = new SineIntegral(); 78 63 79 var exp = new Exponential(); 64 80 var @if = new IfThenElse(); … … 86 102 laggedVariable.InitialFrequency = 0.0; 87 103 88 var allSymbols = new List<Symbol>() { add, sub, mul, div, mean, sin, cos, tan, log, square, pow, sqrt, root, exp, @if, gt, lt, and, or, not, timeLag, integral, derivative, constant, variableSymbol, laggedVariable, variableCondition }; 89 var unaryFunctionSymbols = new List<Symbol>() { square, sqrt, sin, cos, tan, log, exp, not, timeLag, integral, derivative }; 104 var allSymbols = new List<Symbol>() { add, sub, mul, div, mean, sin, cos, tan, log, square, pow, sqrt, root, exp, 105 airyA, airyB, bessel, cosineIntegral, dawson, erf, expIntegralEi, fresnelCosineIntegral, fresnelSineIntegral, gamma, hypCosineIntegral, hypSineIntegral, norm, psi, sineIntegral, 106 @if, gt, lt, and, or, not, timeLag, integral, derivative, constant, variableSymbol, laggedVariable, variableCondition }; 107 var unaryFunctionSymbols = new List<Symbol>() { square, sqrt, sin, cos, tan, log, exp, not, timeLag, integral, derivative, 108 airyA, airyB, bessel, cosineIntegral, dawson, erf, expIntegralEi, fresnelCosineIntegral, fresnelSineIntegral, gamma, hypCosineIntegral, hypSineIntegral, norm, psi, sineIntegral 109 }; 90 110 91 111 var binaryFunctionSymbols = new List<Symbol>() { pow, root, gt, lt, variableCondition }; 92 var functionSymbols = new List<Symbol>() { add, sub, mul, div, mean, and, or };112 var ternarySymbols = new List<Symbol>() { add, sub, mul, div, mean, and, or }; 93 113 var terminalSymbols = new List<Symbol>() { variableSymbol, constant, laggedVariable }; 94 114 … … 96 116 AddSymbol(symb); 97 117 98 foreach (var funSymb in functionSymbols) {118 foreach (var funSymb in ternarySymbols) { 99 119 SetSubtreeCount(funSymb, 1, 3); 100 120 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentExpressionGrammar.cs
r7695 r7696 40 40 private const string BooleanOperatorsName = "Boolean Operators"; 41 41 private const string ConditionalSymbolsName = "ConditionalSymbols"; 42 private const string SpecialFunctionsName = "Special Functions"; 42 43 private const string TimeSeriesSymbolsName = "Time Series Symbols"; 43 44 … … 69 70 var sqrt = new SquareRoot(); 70 71 var exp = new Exponential(); 72 73 var airyA = new AiryA(); 74 var airyB = new AiryB(); 75 var bessel = new Bessel(); 76 var cosineIntegral = new CosineIntegral(); 77 var dawson = new Dawson(); 78 var erf = new Erf(); 79 var expIntegralEi = new ExponentialIntegralEi(); 80 var fresnelCosineIntegral = new FresnelCosineIntegral(); 81 var fresnelSineIntegral = new FresnelSineIntegral(); 82 var gamma = new Gamma(); 83 var hypCosineIntegral = new HyperbolicCosineIntegral(); 84 var hypSineIntegral = new HyperbolicSineIntegral(); 85 var norm = new Norm(); 86 var psi = new Psi(); 87 var sineIntegral = new SineIntegral(); 88 71 89 var @if = new IfThenElse(); 72 90 var gt = new GreaterThan(); … … 92 110 var trigonometricSymbols = new GroupSymbol(TrigonometricFunctionsName, new List<ISymbol>() { sin, cos, tan }); 93 111 var exponentialAndLogarithmicSymbols = new GroupSymbol(ExponentialFunctionsName, new List<ISymbol> { exp, log }); 112 var specialFunctions = new GroupSymbol(SpecialFunctionsName, new List<ISymbol> { airyA, airyB, bessel, cosineIntegral, dawson, erf, expIntegralEi, 113 fresnelCosineIntegral,fresnelSineIntegral,gamma,hypCosineIntegral,hypSineIntegral,norm, psi, sineIntegral}); 94 114 var terminalSymbols = new GroupSymbol(TerminalsName, new List<ISymbol> { constant, variableSymbol }); 95 var realValuedSymbols = new GroupSymbol(RealValuedSymbolsName, new List<ISymbol>() { arithmeticSymbols, trigonometricSymbols, exponentialAndLogarithmicSymbols, terminalSymbols });115 var realValuedSymbols = new GroupSymbol(RealValuedSymbolsName, new List<ISymbol>() { arithmeticSymbols, trigonometricSymbols, exponentialAndLogarithmicSymbols, specialFunctions, terminalSymbols }); 96 116 97 117 var powerSymbols = new GroupSymbol(PowerFunctionsName, new List<ISymbol> { square, pow, sqrt, root }); … … 118 138 SetSubtreeCount(sqrt, 1, 1); 119 139 SetSubtreeCount(exponentialAndLogarithmicSymbols, 1, 1); 140 SetSubtreeCount(specialFunctions, 1, 1); 120 141 SetSubtreeCount(terminalSymbols, 0, 0); 121 142 … … 141 162 AddAllowedChildSymbol(realValuedSymbols, conditionSymbols); 142 163 AddAllowedChildSymbol(realValuedSymbols, timeSeriesSymbols); 164 AddAllowedChildSymbol(realValuedSymbols, specialFunctions); 143 165 144 166 AddAllowedChildSymbol(powerSymbols, variableSymbol, 0); … … 186 208 187 209 public void ConfigureAsDefaultRegressionGrammar() { 188 Symbols.Where(s => s is Average).First().Enabled = false; 189 Symbols.Where(s => s.Name == TrigonometricFunctionsName).First().Enabled = false; 190 Symbols.Where(s => s.Name == PowerFunctionsName).First().Enabled = false; 191 Symbols.Where(s => s.Name == ConditionalSymbolsName).First().Enabled = false; 192 Symbols.Where(s => s.Name == TimeSeriesSymbolsName).First().Enabled = false; 210 Symbols.First(s => s is Average).Enabled = false; 211 Symbols.First(s => s.Name == TrigonometricFunctionsName).Enabled = false; 212 Symbols.First(s => s.Name == PowerFunctionsName).Enabled = false; 213 Symbols.First(s => s.Name == SpecialFunctionsName).Enabled = false; 214 Symbols.First(s => s.Name == ConditionalSymbolsName).Enabled = false; 215 Symbols.First(s => s.Name == TimeSeriesSymbolsName).Enabled = false; 193 216 } 194 217 195 218 public void ConfigureAsDefaultClassificationGrammar() { 196 Symbols.Where(s => s is Average).First().Enabled = false; 197 Symbols.Where(s => s is VariableCondition).First().Enabled = false; 198 Symbols.Where(s => s.Name == TrigonometricFunctionsName).First().Enabled = false; 199 Symbols.Where(s => s.Name == ExponentialFunctionsName).First().Enabled = false; 200 Symbols.Where(s => s.Name == PowerFunctionsName).First().Enabled = false; 201 Symbols.Where(s => s.Name == TimeSeriesSymbolsName).First().Enabled = false; 219 Symbols.First(s => s is Average).Enabled = false; 220 Symbols.First(s => s is VariableCondition).Enabled = false; 221 Symbols.First(s => s.Name == TrigonometricFunctionsName).Enabled = false; 222 Symbols.First(s => s.Name == ExponentialFunctionsName).Enabled = false; 223 Symbols.First(s => s.Name == SpecialFunctionsName).Enabled = false; 224 Symbols.First(s => s.Name == PowerFunctionsName).Enabled = false; 225 Symbols.First(s => s.Name == TimeSeriesSymbolsName).Enabled = false; 202 226 } 203 227 }
Note: See TracChangeset
for help on using the changeset viewer.