Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/08/21 15:53:37 (3 years ago)
Author:
dpiringe
Message:

#3026

  • added a new protected virtual property in CheckedItemListView to be able to change the text of the groupBox
  • removed event handling in ResultCollectionPostProcessorControl and overwrote the new property GroupBoxText
  • added a new section in ExportJsonDialog for result collection processors
  • renamed IResultCollectionPostProcessor to IResultCollectionProcessor + all connected classes
  • added/changed the workflow of ResultCollectionProcessors in JsonTemplateGenerator and JsonTemplateInstantiator
    • also changed Constants.cs -> added a new section in template ResultCollectionProcessorItems
Location:
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/ResultCollectionProcessors
Files:
1 added
1 deleted
1 copied
1 moved

Legend:

Unmodified
Added
Removed
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/ResultCollectionProcessors/SymRegPythonProcessor.cs

    r18047 r18050  
    1111using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression;
    1212using HEAL.Attic;
     13using HeuristicLab.Data;
    1314
    1415namespace HeuristicLab.JsonInterface {
    1516  [StorableType("844F2887-B7A0-4BD4-89B8-F9155C65D214")]
    16   public class SymRegPythonPostProcessor : Item, IResultCollectionPostProcessor {
     17  public class SymRegPythonProcessor : ParameterizedNamedItem, IResultCollectionProcessor {
    1718
     19    #region Constructors & Cloning
    1820    [StorableConstructor]
    19     protected SymRegPythonPostProcessor(StorableConstructorFlag _) : base(_) {
     21    protected SymRegPythonProcessor(StorableConstructorFlag _) : base(_) { }
     22    public SymRegPythonProcessor() { }
     23    public SymRegPythonProcessor(SymRegPythonProcessor original, Cloner cloner) : base(original, cloner) { }
     24
     25    public override IDeepCloneable Clone(Cloner cloner) {
     26      return new SymRegPythonProcessor(this, cloner);
    2027    }
     28    #endregion
    2129
    22     public SymRegPythonPostProcessor() { }
    23     public SymRegPythonPostProcessor(SymRegPythonPostProcessor old, Cloner cloner) { }
    24 
    25     public void Apply(IObservableDictionary<string, IItem> results, IDictionary<string, string> output) {
     30    public void Apply(IObservableDictionary<string, IItem> results) {
    2631      var formatter = new SymbolicDataAnalysisExpressionPythonFormatter();
    27       foreach (var kvp in results) {
     32      var resultCopy = new ObservableDictionary<string, IItem>(results);
     33      foreach (var kvp in resultCopy) {
    2834        if (kvp.Value is ISymbolicRegressionSolution sol) {
    29           output.Add(kvp.Key, formatter.Format(sol.Model.SymbolicExpressionTree));
     35          results.Add($"{kvp.Key} - Python" , new StringValue(formatter.Format(sol.Model.SymbolicExpressionTree)));
    3036        }
    3137      }
    3238    }
    33 
    34     public override IDeepCloneable Clone(Cloner cloner) {
    35       return new SymRegPythonPostProcessor(this, cloner);
    36     }
    3739  }
    3840}
Note: See TracChangeset for help on using the changeset viewer.