Free cookie consent management tool by TermsFeed Policy Generator

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

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

Location:
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Evaluators
Files:
2 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}
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Evaluators/SymbolicDataAnalysisSingleObjectiveEvaluator.cs

    r5809 r5851  
    2020#endregion
    2121
     22using System.Linq;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
     
    3940    #endregion
    4041    #region properties
    41     public DoubleValue Quality {
    42       get { return QualityParameter.ActualValue; }
    43       set { QualityParameter.ActualValue = value; }
    44     }
    4542    public abstract bool Maximization { get; }
    4643    #endregion
     
    5653    }
    5754
    58 
    5955    public abstract double Evaluate(IExecutionContext context, ISymbolicExpressionTree tree, T problemData, IEnumerable<int> rows);
    6056  }
Note: See TracChangeset for help on using the changeset viewer.