Free cookie consent management tool by TermsFeed Policy Generator

source: branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/ResultFormatter/SymbolicRegressionSolutionFormatterBase.cs @ 17843

Last change on this file since 17843 was 17843, checked in by dpiringe, 2 years ago

#3026

  • removed property ConvertableType from all converters
  • removed the option to fixate or loosen the path of JsonItems (obsolete)
  • added a abstract formatter SymbolicRegressionSolutionFormatterBase as base formatter for ISymbolicRegressionSolution
  • unified the construction of exporter controls
  • code cleanup
File size: 820 bytes
Line 
1using System;
2using System.Linq;
3using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
4using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression;
5
6namespace HeuristicLab.JsonInterface {
7  public abstract class SymbolicRegressionSolutionFormatterBase : ResultFormatter {
8    public override int Priority => 5;
9
10    public override bool CanFormatType(Type t) {
11      var interfaces = t.GetInterfaces();
12      return t.GetInterfaces().Any(x => x == typeof(ISymbolicRegressionSolution));
13    }
14
15    protected abstract ISymbolicExpressionTreeStringFormatter SymbolicExpressionTreeStringFormatter { get; }
16
17    public override string Format(object o) => SymbolicExpressionTreeStringFormatter.Format((ISymbolicExpressionTree)((ISymbolicRegressionSolution)o).Model.SymbolicExpressionTree);
18  }
19}
Note: See TracBrowser for help on using the repository browser.