Changeset 17880
- Timestamp:
- 03/12/21 08:30:42 (4 years ago)
- Location:
- branches/3073_IA_constraint_splitting/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3073_IA_constraint_splitting/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/IntervalArithmeticGrammar.cs
r17651 r17880 28 28 #region Symbols 29 29 30 var add 31 var sub 32 var mul 33 var div 34 var sin 35 var cos 36 var tan 37 var log 38 var pow 39 var square 40 var root 41 var sqrt 42 var exp 43 var tanh 30 var add = new Addition(); 31 var sub = new Subtraction(); 32 var mul = new Multiplication(); 33 var div = new Division(); 34 var sin = new Sine(); 35 var cos = new Cosine(); 36 var tan = new Tangent(); 37 var log = new Logarithm(); 38 var pow = new Power(); 39 var square = new Square(); 40 var root = new Root(); 41 var sqrt = new SquareRoot(); 42 var exp = new Exponential(); 43 var tanh = new HyperbolicTangent(); 44 44 var constant = new Constant(); 45 var aq = new AnalyticQuotient(); 45 46 constant.MinValue = -20; 46 47 constant.MaxValue = 20; … … 50 51 51 52 //Special symbols 52 var offset = new Addition {Name= "Offset"};53 var offset = new Addition {Name = "Offset"}; 53 54 var scaling = new Multiplication {Name = "Scaling"}; 54 55 //all other symbols 55 56 var allSymbols = new List<Symbol> { 56 57 add, sub, mul, div, constant, variableSymbol, sin, cos, tan, log, pow, square, root, sqrt, exp, 57 tanh 58 tanh, aq 58 59 }; 59 60 60 var arithmeticSymbols 61 var trigonometricSymbols 61 var arithmeticSymbols = new List<Symbol> {add, sub, mul, div}; 62 var trigonometricSymbols = new List<Symbol> {sin, cos, tan, tanh}; 62 63 var exponentialAndLogarithmicSymbols = new List<Symbol> {exp, log}; 63 var powerSymbols = new List<Symbol> {square, pow, sqrt, root}; 64 var powerSymbols = new List<Symbol> {square, pow, sqrt, root}; 65 var specialSymbols = new List<Symbol> {aq}; 64 66 var realValueSymbols = new List<Symbol> 65 {add, sub, mul, div, sin, cos, tan, tanh, exp, log, variableSymbol, constant };67 {add, sub, mul, div, sin, cos, tan, tanh, exp, log, variableSymbol, constant, aq}; 66 68 67 69 … … 86 88 SetSubtreeCount(square, 1, 1); 87 89 SetSubtreeCount(sqrt, 1, 1); 90 SetSubtreeCount(aq, 2, 2); 88 91 89 92 #endregion … … 117 120 AddAllowedChildSymbol(sqrt, c, 0); 118 121 } 122 123 //define child for aq 124 foreach (var c in realValueSymbols) { 125 AddAllowedChildSymbol(aq, c, 0); 126 AddAllowedChildSymbol(aq, c, 1); 127 } 128 119 129 #endregion 120 130 121 131 Symbols.First(s => s is Power).Enabled = false; 122 132 Symbols.First(s => s is Root).Enabled = false; 133 Symbols.First(s => s is AnalyticQuotient).Enabled = false; 123 134 } 124 135 } -
branches/3073_IA_constraint_splitting/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/IABoundsEstimator.cs
r17773 r17880 513 513 minimization: true, stopAtLimit: true, limit: constraint.Interval.LowerBound); 514 514 515 return lowerBound <= constraint.Interval.LowerBound515 return lowerBound >= constraint.Interval.LowerBound 516 516 ? 0.0 517 517 : Math.Abs(lowerBound - constraint.Interval.LowerBound);
Note: See TracChangeset
for help on using the changeset viewer.