Changeset 17843 for branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/ResultFormatter
- Timestamp:
- 02/23/21 16:36:44 (4 years ago)
- Location:
- branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/ResultFormatter
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/ResultFormatter/MatlabResultFormatter.cs
r17834 r17843 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading.Tasks; 6 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 1 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 7 2 using HeuristicLab.Problems.DataAnalysis.Symbolic; 8 using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression;9 3 10 4 namespace HeuristicLab.JsonInterface { 11 public class MatlabResultFormatter : ResultFormatter { 12 public override int Priority => 5; 13 14 public override bool CanFormatType(Type t) { 15 var interfaces = t.GetInterfaces(); 16 return t.GetInterfaces().Any(x => x == typeof(ISymbolicRegressionSolution)); 17 } 18 19 private ISymbolicExpressionTreeStringFormatter MatlabFormatter => new SymbolicDataAnalysisExpressionMATLABFormatter(); 20 21 public override string Format(object o) => MatlabFormatter.Format((ISymbolicExpressionTree)((ISymbolicRegressionSolution)o).Model.SymbolicExpressionTree); 5 public class MatlabResultFormatter : SymbolicRegressionSolutionFormatterBase { 6 protected override ISymbolicExpressionTreeStringFormatter SymbolicExpressionTreeStringFormatter 7 => new SymbolicDataAnalysisExpressionMATLABFormatter(); 22 8 } 23 9 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/ResultFormatter/ResultFormatter.cs
r17834 r17843 12 12 public abstract class ResultFormatter : IResultFormatter { 13 13 public abstract int Priority { get; } 14 15 14 public abstract bool CanFormatType(Type t); 16 15 public abstract string Format(object o);
Note: See TracChangeset
for help on using the changeset viewer.