Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/09/21 14:44:03 (3 years ago)
Author:
chaider
Message:

#3134 Added RunCollectionPartialDependencePlotView and changed UpdateAllSeriesDataAsync method in PartialDependencePlot to await all updates from the given enumeration

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/HeuristicLab.Problems.DataAnalysis.Views/3.4/Controls/PartialDependencePlot.cs

    r17939 r18051  
    453453    }
    454454
    455     private async Task<DoubleLimit> UpdateAllSeriesDataAsync(CancellationToken cancellationToken) {
     455    private Task<DoubleLimit> UpdateAllSeriesDataAsync(CancellationToken cancellationToken) {
    456456      var updateTasks = solutions.Select(solution => UpdateSeriesDataAsync(solution, cancellationToken));
    457457
    458       double min = double.MaxValue, max = double.MinValue;
    459       foreach (var update in updateTasks) {
    460         var limit = await update;
    461         if (limit.Lower < min) min = limit.Lower;
    462         if (limit.Upper > max) max = limit.Upper;
    463       }
    464 
    465       return new DoubleLimit(min, max);
     458      return Task.Run(() => {
     459        double min = double.MaxValue, max = double.MinValue;
     460        foreach (var update in updateTasks) {
     461          var limit = update.Result;
     462          if (limit.Lower < min) min = limit.Lower;
     463          if (limit.Upper > max) max = limit.Upper;
     464        }
     465
     466        return new DoubleLimit(min, max);
     467      }, cancellationToken);
    466468    }
    467469
Note: See TracChangeset for help on using the changeset viewer.