Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/12/21 15:24:18 (3 years ago)
Author:
dpiringe
Message:

#3026

  • added ResultFormatter to add an extra layer of result transformation logic (converting a result value to a string with a defined logic, e.g. MatlabResultFormatter for ISymbolicRegressionSolution)
  • extended the IResultJsonItem with two properties for result formatting
  • added a new control to selected a result formatter for a result value
  • refactored the Runner for the new result formatting process
File:
1 edited

Legend:

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

    r17828 r17834  
    11using System;
    2 using System.Collections.Generic;
    32using System.Linq;
    4 using System.Text;
    5 using System.Threading.Tasks;
    63using HeuristicLab.Core;
    74using HeuristicLab.Optimization;
     
    1411
    1512    public override bool CanConvertType(Type t) =>
    16       t.GetInterfaces().Any(x => x == typeof(IResultParameter));
     13      t.GetInterfaces().Any(x => x == ConvertableType);
    1714
    1815    public override IJsonItem Extract(IItem value, IJsonItemConverter root) {
    1916      IResultParameter res = value as IResultParameter;
     17      var formatter = ResultFormatter.ForType(res.DataType).Last();
    2018      return new ResultJsonItem() {
    2119        Name = res.ActualName,
    22         Description = res.Description
     20        Description = res.Description,
     21        ResultFormatterType = formatter.GetType().FullName,
     22        ValueType = res.DataType
    2323      };
    2424    }
Note: See TracChangeset for help on using the changeset viewer.