Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/09/11 10:45:50 (13 years ago)
Author:
gkronber
Message:

#1557 implemented parallel evaluation in analyzers using ParallelEnumerable extension methods.

File:
1 edited

Legend:

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

    r5907 r6728  
    7676      ISymbolicExpressionTree bestTree = null;
    7777      ISymbolicExpressionTree[] tree = SymbolicExpressionTree.ToArray();
    78       double[] quality = new double[tree.Length];
    7978      var evaluator = EvaluatorParameter.ActualValue;
     79      var problemData = ProblemDataParameter.ActualValue;
    8080      IEnumerable<int> rows = GenerateRowsToEvaluate();
    8181      if (!rows.Any()) return base.Apply();
    8282
    8383      IExecutionContext childContext = (IExecutionContext)ExecutionContext.CreateChildOperation(evaluator);
     84      var quality = tree
     85        .AsParallel()
     86        .Select(t => evaluator.Evaluate(childContext, t, problemData, rows))
     87        .ToArray();
     88
    8489      for (int i = 0; i < tree.Length; i++) {
    85         quality[i] = evaluator.Evaluate(childContext, tree[i], ProblemDataParameter.ActualValue, rows);
    8690        if (IsBetter(quality[i], bestQuality, Maximization.Value)) {
    8791          bestQuality = quality[i];
Note: See TracChangeset for help on using the changeset viewer.