- Timestamp:
- 03/31/11 11:22:28 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Evaluators/SymbolicDataAnalysisEvaluator.cs
r5864 r5906 44 44 private const string EvaluationPartitionParameterName = "EvaluationPartition"; 45 45 private const string RelativeNumberOfEvaluatedSamplesParameterName = "RelativeNumberOfEvaluatedSamples"; 46 private const string EvaluatedNodesParameterName = "EvaluatedNodes";47 46 48 47 public override bool CanChangeName { get { return false; } } … … 57 56 public ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> SymbolicDataAnalysisTreeInterpreterParameter { 58 57 get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[SymbolicDataAnalysisTreeInterpreterParameterName]; } 59 }60 public ILookupParameter<DoubleValue> EvaluatedNodesParameter {61 get { return (ILookupParameter<DoubleValue>)Parameters[EvaluatedNodesParameterName]; }62 58 } 63 59 public IValueLookupParameter<T> ProblemDataParameter { … … 87 83 Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicDataAnalysisTreeInterpreterParameterName, "The interpreter that should be used to calculate the output values of the symbolic data analysis tree.")); 88 84 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."));90 85 Parameters.Add(new ValueLookupParameter<T>(ProblemDataParameterName, "The problem data on which the symbolic data analysis solution should be evaluated.")); 91 86 Parameters.Add(new ValueLookupParameter<IntRange>(EvaluationPartitionParameterName, "The start index of the dataset partition on which the symbolic data analysis solution should be evaluated.")); … … 107 102 .Where(i => i < testPartitionStart || testPartitionEnd <= i); 108 103 } 109 110 protected void AddEvaluatedNodes(double numberOfNodes) {111 if (EvaluatedNodesParameter.ActualValue == null) {112 // variable for evaluated nodes does not exist yet113 // search global scope114 var scope = ExecutionContext.Scope;115 while (scope.Parent != null) scope = scope.Parent;116 // add variable into global scope117 scope.Variables.Add(new HeuristicLab.Core.Variable(EvaluatedNodesParameter.ActualName, new DoubleValue()));118 }119 double curEvaluatedNodes = EvaluatedNodesParameter.ActualValue.Value;120 EvaluatedNodesParameter.ActualValue = new DoubleValue(curEvaluatedNodes + numberOfNodes);121 }122 104 } 123 105 }
Note: See TracChangeset
for help on using the changeset viewer.