Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/24/21 13:40:39 (3 years ago)
Author:
chaider
Message:

#3041

  • Renaming Constant Symbol to Num, behaves like before
  • Adding new Symbol RealConstant (Constant), this symbol behaves now like a real constant, won't be changed by parameter optimization or manipulators
  • Refactored classes part1
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

    r17413 r18093  
    4949      var mul = new Multiplication();
    5050      var div = new Division();
    51       var constant = new Constant();
     51      var constant = new Num();
    5252      constant.MinValue = -20;
    5353      constant.MaxValue = 20;
     54      var number = new RealConstant();
     55      number.MinValue = -20;
     56      number.MaxValue = 20;
    5457      var variableSymbol = new HeuristicLab.Problems.DataAnalysis.Symbolic.Variable();
    5558      var binFactorVariableSymbol = new BinaryFactorVariable();
    5659      var factorVariableSymbol = new FactorVariable();
    5760
    58       var allSymbols = new List<Symbol>() { add, sub, mul, div, constant, variableSymbol, binFactorVariableSymbol, factorVariableSymbol };
     61      var allSymbols = new List<Symbol>() { add, sub, mul, div, constant, number, variableSymbol, binFactorVariableSymbol, factorVariableSymbol };
    5962      var functionSymbols = new List<Symbol>() { add, sub, mul, div };
    6063
     
    6669      }
    6770      SetSubtreeCount(constant, 0, 0);
     71      SetSubtreeCount(number, 0, 0);
    6872      SetSubtreeCount(variableSymbol, 0, 0);
    6973      SetSubtreeCount(binFactorVariableSymbol, 0, 0);
  • branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/FullFunctionalExpressionGrammar.cs

    r17413 r18093  
    118118      variableCondition.InitialFrequency = 0.0;
    119119
    120       var constant = new Constant();
     120      var constant = new Num();
    121121      constant.MinValue = -20;
    122122      constant.MaxValue = 20;
     
    130130      autoregressiveVariable.Enabled = false;
    131131
     132      var number = new RealConstant();
     133      number.MinValue = -20;
     134      number.MaxValue = 20;
     135
    132136      var allSymbols = new List<Symbol>() { add, sub, mul, div, aq, mean, abs, sin, cos, tan, log, square, cube, pow, sqrt, cubeRoot, root, exp, tanh,
    133137        airyA, airyB, bessel, cosineIntegral, dawson, erf, expIntegralEi, fresnelCosineIntegral, fresnelSineIntegral, gamma, hypCosineIntegral, hypSineIntegral, norm, psi, sineIntegral,
    134         @if, gt, lt, and, or, not,xor, timeLag, integral, derivative, constant, variableSymbol, binFactorVariable, factorVariable, laggedVariable,autoregressiveVariable, variableCondition };
     138        @if, gt, lt, and, or, not,xor, timeLag, integral, derivative, constant, number, variableSymbol, binFactorVariable, factorVariable, laggedVariable,autoregressiveVariable, variableCondition };
    135139      var unaryFunctionSymbols = new List<Symbol>() { abs, square, sqrt, cube, cubeRoot, sin, cos, tan, log, exp, tanh, not, timeLag, integral, derivative,
    136140        airyA, airyB, bessel, cosineIntegral, dawson, erf, expIntegralEi, fresnelCosineIntegral, fresnelSineIntegral, gamma, hypCosineIntegral, hypSineIntegral, norm, psi, sineIntegral
     
    139143      var binaryFunctionSymbols = new List<Symbol>() { pow, root, gt, lt, aq, variableCondition };
    140144      var ternarySymbols = new List<Symbol>() { add, sub, mul, div, mean, and, or, xor };
    141       var terminalSymbols = new List<Symbol>() { variableSymbol, binFactorVariable, factorVariable, constant, laggedVariable, autoregressiveVariable };
     145      var terminalSymbols = new List<Symbol>() { variableSymbol, binFactorVariable, factorVariable, constant, number, laggedVariable, autoregressiveVariable };
    142146
    143147      foreach (var symb in allSymbols)
  • branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/LinearScalingGrammar.cs

    r17958 r18093  
    6666      var abs = new Absolute();
    6767      var aq = new AnalyticQuotient();
    68       var constant = new Constant();
     68      var constant = new Num();
    6969      constant.MinValue = -20;
    7070      constant.MaxValue = 20;
     71      var number = new RealConstant();
     72      number.MinValue = -20;
     73      number.MaxValue = 20;
    7174      var variableSymbol = new Variable();
    7275
     
    7881      //all other symbols
    7982      var allSymbols = new List<Symbol> {
    80         add, sub, mul, div, constant, variableSymbol, sin, cos, tan, log, square, sqrt, cube, cbrt, exp,
     83        add, sub, mul, div, constant, number, variableSymbol, sin, cos, tan, log, square, sqrt, cube, cbrt, exp,
    8184        tanh, aq, abs
    8285      };
     
    8689      var realValueSymbols = new List<Symbol> {
    8790         add, sub, mul, div, sin, cos, tan, tanh, exp, log, aq, abs, square, cube, sqrt, cbrt,
    88          variableSymbol, constant,
     91         variableSymbol, constant, number
    8992        };
    9093
  • branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentExpressionGrammar.cs

    r17413 r18093  
    105105      var derivative = new Derivative();
    106106
    107       var constant = new Constant();
     107      var constant = new Num();
    108108      constant.MinValue = -20;
    109109      constant.MaxValue = 20;
     110      var number = new RealConstant();
     111      number.MinValue = -20;
     112      number.MaxValue = 20;
    110113      var variableSymbol = new Variable();
    111114      var binFactorVariable = new BinaryFactorVariable();
     
    121124      var specialFunctions = new GroupSymbol(SpecialFunctionsName, new List<ISymbol> { abs, airyA, airyB, bessel, cosineIntegral, dawson, erf, expIntegralEi,
    122125        fresnelCosineIntegral,fresnelSineIntegral,gamma,hypCosineIntegral,hypSineIntegral,norm, psi, sineIntegral, analyticalQuotient});
    123       var terminalSymbols = new GroupSymbol(TerminalsName, new List<ISymbol> { constant, variableSymbol, binFactorVariable, factorVariable });
     126      var terminalSymbols = new GroupSymbol(TerminalsName, new List<ISymbol> { constant, number, variableSymbol, binFactorVariable, factorVariable });
    124127      var realValuedSymbols = new GroupSymbol(RealValuedSymbolsName, new List<ISymbol>() { arithmeticSymbols, trigonometricSymbols, exponentialAndLogarithmicSymbols, specialFunctions, terminalSymbols });
    125128
Note: See TracChangeset for help on using the changeset viewer.