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/ResultFormatters/SymbolicRegressionSolutionFormatterBase.cs

    r17843 r18026  
    1010    public override bool CanFormatType(Type t) {
    1111      var interfaces = t.GetInterfaces();
    12       return t.GetInterfaces().Any(x => x == typeof(ISymbolicRegressionSolution));
     12      var symRegSolutionType = typeof(ISymbolicRegressionSolution);
     13      return t == symRegSolutionType || interfaces.Any(x => x == symRegSolutionType);
    1314    }
    1415
    1516    protected abstract ISymbolicExpressionTreeStringFormatter SymbolicExpressionTreeStringFormatter { get; }
    1617
    17     public override string Format(object o) => SymbolicExpressionTreeStringFormatter.Format((ISymbolicExpressionTree)((ISymbolicRegressionSolution)o).Model.SymbolicExpressionTree);
     18    public override string Format(object o) => SymbolicExpressionTreeStringFormatter.Format(((ISymbolicRegressionSolution)o).Model.SymbolicExpressionTree);
    1819  }
    1920}
Note: See TracChangeset for help on using the changeset viewer.