Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/03/21 10:53:47 (3 years ago)
Author:
dpiringe
Message:

#3026

  • fixed the possibility for duplicated result entries in template generation
  • added a check for duplicated result entries in Runner to prevent an Key already exists exception (a user could manually manipulate the template file to generate this type of exception, thats the reason for a second check)
  • fixed the relative to absolute path transformation in JsonTemplateInstantiator
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/AlgorithmConverter.cs

    r17843 r18039  
    2828      IAlgorithm algorithm = value as IAlgorithm;
    2929      foreach (var res in algorithm.Results) {
    30         item.AddChildren(root.Extract(res, root));
    31         /*
    32         item.AddChildren(new ResultJsonItem() {
    33           Name = res.Name,
    34           Description = res.Description
    35         });*/
     30        var resultItem = root.Extract(res, root);
     31        // fetch all result parameter items
     32        var resultParameterItems =
     33          item.Where(x => x
     34          .GetType()
     35          .GetInterfaces()
     36          .Any(y => y == typeof(IResultJsonItem)));
     37        // check for duplicates (to prevent double result items,
     38        // which can occur with result parameters)
     39        if(!resultParameterItems.Any(x => x.Name == resultItem.Name))
     40          item.AddChildren(resultItem);
    3641      }
    3742      item.AddChildren(root.Extract(algorithm.Problem, root));
Note: See TracChangeset for help on using the changeset viewer.