Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/28/11 20:04:51 (13 years ago)
Author:
gkronber
Message:

#1411 added evaluated nodes parameter to symbolic data analysis evaluators.

File:
1 edited

Legend:

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

    r5823 r5851  
    4444    private const string EvaluationPartitionParameterName = "EvaluationPartition";
    4545    private const string RelativeNumberOfEvaluatedSamplesParameterName = "RelativeNumberOfEvaluatedSamples";
     46    private const string EvaluatedNodesParameterName = "EvaluatedNodes";
    4647
    4748    public override bool CanChangeName { get { return false; } }
     
    5657    public ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> SymbolicDataAnalysisTreeInterpreterParameter {
    5758      get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[SymbolicDataAnalysisTreeInterpreterParameterName]; }
     59    }
     60    public ILookupParameter<DoubleValue> EvaluatedNodesParameter {
     61      get { return (ILookupParameter<DoubleValue>)Parameters[EvaluatedNodesParameterName]; }
    5862    }
    5963    public IValueLookupParameter<T> ProblemDataParameter {
     
    8387      Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicDataAnalysisTreeInterpreterParameterName, "The interpreter that should be used to calculate the output values of the symbolic data analysis tree."));
    8488      Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic data analysis solution encoded as a symbolic expression tree."));
     89      Parameters.Add(new LookupParameter<DoubleValue>(EvaluatedNodesParameterName, "The total number of evaluated symbolic expression tree nodes."));
    8590      Parameters.Add(new ValueLookupParameter<T>(ProblemDataParameterName, "The problem data on which the symbolic data analysis solution should be evaluated."));
    8691      Parameters.Add(new ValueLookupParameter<IntRange>(EvaluationPartitionParameterName, "The start index of the dataset partition on which the symbolic data analysis solution should be evaluated."));
     
    102107        .Where(i => i < testPartitionStart || testPartitionEnd <= i);
    103108    }
     109
     110    protected void AddEvaluatedNodes(double numberOfNodes) {
     111      if (EvaluatedNodesParameter.ActualValue == null) EvaluatedNodesParameter.ActualValue = new DoubleValue();
     112      double curEvaluatedNodes = EvaluatedNodesParameter.ActualValue.Value;
     113      EvaluatedNodesParameter.ActualValue = new DoubleValue(curEvaluatedNodes + numberOfNodes);
     114    }
    104115  }
    105116}
Note: See TracChangeset for help on using the changeset viewer.