Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/24/21 13:40:39 (2 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
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/IntervalInterpreter.cs

    r17993 r18093  
    186186            break;
    187187          }
     188        case OpCodes.Number: {
     189            var constTreeNode = (NumTreeNode)currentInstr.dynamicNode;
     190            result = new Interval(constTreeNode.Value, constTreeNode.Value);
     191            break;
     192          }
    188193        case OpCodes.Constant: {
    189             var constTreeNode = (ConstantTreeNode)currentInstr.dynamicNode;
    190             result = new Interval(constTreeNode.Value, constTreeNode.Value);
    191             break;
     194          var constTreeNode = (RealConstantTreeNode)currentInstr.dynamicNode;
     195          result = new Interval(constTreeNode.Value, constTreeNode.Value);
     196          break;
    192197          }
    193198        case OpCodes.Add: {
     
    324329        if (
    325330          !(n.Symbol is Variable) &&
    326           !(n.Symbol is Constant) &&
     331          !(n.Symbol is Num) &&
    327332          !(n.Symbol is StartSymbol) &&
    328333          !(n.Symbol is Addition) &&
     
    346351        else if (n.Symbol is Power) {
    347352          // only integer exponents are supported
    348           var exp = n.GetSubtree(1) as ConstantTreeNode;
     353          var exp = n.GetSubtree(1) as NumTreeNode;
    349354          if (exp == null || exp.Value != Math.Truncate(exp.Value)) return false;
    350355        }
Note: See TracChangeset for help on using the changeset viewer.