Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/01/21 13:40:55 (3 years ago)
Author:
chaider
Message:

#3140

  • some more refactoring
  • added possibility to set value of num nodes in infix parser
  • changed displaying style of number
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicClassificationPruningOperator.cs

    r17180 r18100  
    101101      for (int i = 0; i < nodes.Count; ++i) {
    102102        var node = nodes[i];
    103         if (node is ConstantTreeNode) continue;
     103        if (node is NumberTreeNode) continue;
    104104
    105105        double impactValue, replacementValue, newQualityForImpactsCalculation;
     
    109109        if (!pruneOnlyZeroImpactNodes && impactValue > nodeImpactThreshold) continue;
    110110
    111         var constantNode = (ConstantTreeNode)node.Grammar.GetSymbol("Constant").CreateTreeNode();
    112         constantNode.Value = replacementValue;
     111        var numberNode = (NumberTreeNode)node.Grammar.GetSymbol("Number").CreateTreeNode();
     112        numberNode.Value = replacementValue;
    113113
    114         ReplaceWithConstant(node, constantNode);
     114        ReplaceWithConstant(node, numberNode);
    115115        i += node.GetLength() - 1; // skip subtrees under the node that was folded
    116116
Note: See TracChangeset for help on using the changeset viewer.