Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/29/15 15:19:58 (9 years ago)
Author:
bburlacu
Message:

#2359: The changes in r12358 look fine to me. Added total number of pruned nodes in the analyzer's data table. Removed unused parameter names in the SymbolicDataAnalysisSingleObjectivePruningAnalyzer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionPruningOperator.cs

    r12359 r12361  
    4141    private const string PrunedSubtreesParameterName = "PrunedSubtrees";
    4242    private const string PrunedTreesParameterName = "PrunedTrees";
     43    private const string PrunedNodesParameterName = "PrunedNodes";
    4344    private const string FitnessCalculationPartitionParameterName = "FitnessCalculationPartition";
    4445    private const string NodeImpactThresholdParameterName = "ImpactThreshold";
     
    7172    public ILookupParameter<IntValue> PrunedTreesParameter {
    7273      get { return (ILookupParameter<IntValue>)Parameters[PrunedTreesParameterName]; }
     74    }
     75    public ILookupParameter<IntValue> PrunedNodesParameter {
     76      get { return (ILookupParameter<IntValue>)Parameters[PrunedNodesParameterName]; }
    7377    }
    7478    public IFixedValueParameter<DoubleValue> NodeImpactThresholdParameter {
     
    111115      Parameters.Add(new LookupParameter<ISymbolicDataAnalysisModel>(SymbolicDataAnalysisModelParameterName));
    112116      Parameters.Add(new LookupParameter<IntRange>(FitnessCalculationPartitionParameterName));
     117      Parameters.Add(new LookupParameter<IntValue>(PrunedNodesParameterName, "A counter of how many nodes were pruned."));
    113118      Parameters.Add(new LookupParameter<IntValue>(PrunedSubtreesParameterName, "A counter of how many subtrees were replaced."));
    114119      Parameters.Add(new LookupParameter<IntValue>(PrunedTreesParameterName, "A counter of how many trees were pruned."));
     
    139144      var prunedSubtrees = 0;
    140145      var prunedTrees = 0;
     146      var prunedNodes = 0;
    141147
    142148      double quality = Evaluate(model);
     
    155161        constantNode.Value = replacementValue;
    156162
     163        var length = node.GetLength();
    157164        ReplaceWithConstant(node, constantNode);
    158         i += node.GetLength() - 1; // skip subtrees under the node that was folded
     165        i += length - 1; // skip subtrees under the node that was folded
    159166
    160167        quality -= impactValue;
    161168        prunedSubtrees++;
     169        prunedNodes += length;
    162170      }
    163171
     
    165173      PrunedSubtreesParameter.ActualValue = new IntValue(prunedSubtrees);
    166174      PrunedTreesParameter.ActualValue = new IntValue(prunedTrees);
     175      PrunedNodesParameter.ActualValue = new IntValue(prunedNodes);
    167176      QualityParameter.ActualValue.Value = quality;
    168177
Note: See TracChangeset for help on using the changeset viewer.