Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/20/21 17:39:48 (3 years ago)
Author:
dpiringe
Message:

#3026

  • fixed a bug in Runner: the zip-method created wrong pairs (because the lists are unordered)
  • fixed a bug in SymbolicRegressionSolutionFormatterBase: the method now checks the target type as well
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.App/Runner.cs

    r17834 r18026  
    55using System.Threading;
    66using System.Threading.Tasks;
     7using HeuristicLab.Core;
    78using HeuristicLab.Optimization;
    89using Newtonsoft.Json.Linq;
     
    5354
    5455        // zip and filter the results with the ResultJsonItems
    55         var filteredResults = configuredResultItems.Zip(
    56           run.Results.Where(x => configuredResultItems.Any(y => y.Name == x.Key)),
    57           (x, y) => new { Item = x, Value = y.Value });
     56        var filteredResults = new List<Tuple<IResultJsonItem, IItem>>();
     57        foreach(var resultItem in configuredResultItems) {
     58          foreach(var result in run.Results) {
     59            if(resultItem.Name == result.Key) {
     60              filteredResults.Add(Tuple.Create(resultItem, result.Value));
     61            }
     62          }
     63        }
    5864
    5965        // add results to the JObject
    6066        foreach(var result in filteredResults) {
    61           var formatter = GetResultFormatter(result.Item.ResultFormatterType);
    62           obj.Add(result.Item.Name, formatter.Format(result.Value));
     67          var formatter = GetResultFormatter(result.Item1.ResultFormatterType);
     68          obj.Add(result.Item1.Name, formatter.Format(result.Item2));
    6369        }
    6470      }
Note: See TracChangeset for help on using the changeset viewer.