Changeset 17880


Ignore:
Timestamp:
03/12/21 08:30:42 (16 months ago)
Author:
chaider
Message:

#3073

  • Added AQ to IntervalArithmeticGrammar
  • Fixed bug in IABoundsEstimator
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  
    2828      #region Symbols
    2929
    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();
     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();
    4444      var constant = new Constant();
     45      var aq = new AnalyticQuotient();
    4546      constant.MinValue = -20;
    4647      constant.MaxValue = 20;
     
    5051
    5152      //Special symbols
    52       var offset  = new Addition {Name      = "Offset"};
     53      var offset = new Addition {Name = "Offset"};
    5354      var scaling = new Multiplication {Name = "Scaling"};
    5455      //all other symbols
    5556      var allSymbols = new List<Symbol> {
    5657        add, sub, mul, div, constant, variableSymbol, sin, cos, tan, log, pow, square, root, sqrt, exp,
    57         tanh
     58        tanh, aq
    5859      };
    5960
    60       var arithmeticSymbols                = new List<Symbol> {add, sub, mul, div};
    61       var trigonometricSymbols             = new List<Symbol> {sin, cos, tan, tanh};
     61      var arithmeticSymbols = new List<Symbol> {add, sub, mul, div};
     62      var trigonometricSymbols = new List<Symbol> {sin, cos, tan, tanh};
    6263      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};
    6466      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};
    6668
    6769
     
    8688      SetSubtreeCount(square, 1, 1);
    8789      SetSubtreeCount(sqrt, 1, 1);
     90      SetSubtreeCount(aq, 2, 2);
    8891
    8992      #endregion
     
    117120        AddAllowedChildSymbol(sqrt, c, 0);
    118121      }
     122
     123      //define child for aq
     124      foreach (var c in realValueSymbols) {
     125        AddAllowedChildSymbol(aq, c, 0);
     126        AddAllowedChildSymbol(aq, c, 1);
     127      }
     128
    119129      #endregion
    120130
    121131      Symbols.First(s => s is Power).Enabled = false;
    122132      Symbols.First(s => s is Root).Enabled = false;
     133      Symbols.First(s => s is AnalyticQuotient).Enabled = false;
    123134    }
    124135  }
  • branches/3073_IA_constraint_splitting/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/IABoundsEstimator.cs

    r17773 r17880  
    513513          minimization: true, stopAtLimit: true, limit: constraint.Interval.LowerBound);
    514514
    515         return lowerBound <= constraint.Interval.LowerBound
     515        return lowerBound >= constraint.Interval.LowerBound
    516516          ? 0.0
    517517          : Math.Abs(lowerBound - constraint.Interval.LowerBound);
Note: See TracChangeset for help on using the changeset viewer.