Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/02/21 16:42:16 (3 years ago)
Author:
dpiringe
Message:

#3026

  • added a first version of a new feature called ResultCollectionPostProcessors, which should transform/process the results of an optimizer run
    • created a new interface IResultCollectionPostProcessor
    • created a new class SymRegPythonPostProcessor, which formats all ISymbolicRegressionSolution with the usage of the SymbolicDataAnalysisExpressionPythonFormatter
    • changed the generation and instantiation of templates to handle this new feature
    • the template files contains a new area PostProcessors
    • added functionality in Runner to use these new type of result processing
    • added a new tab in ExportJsonDialog to configure PostProcessors
File:
1 edited

Legend:

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

    r18040 r18046  
    66using HEAL.Attic;
    77using HeuristicLab.Optimization;
     8using HeuristicLab.PluginInfrastructure;
    89using Newtonsoft.Json.Linq;
    910
     
    1314      Optimizer = optimizer;
    1415      ConfiguredResultItems = configuredResultItems;
     16      PostProcessors = Enumerable.Empty<IResultCollectionPostProcessor>();
     17    }
     18
     19    public InstantiatorResult(IOptimizer optimizer, IEnumerable<IResultJsonItem> configuredResultItems, IEnumerable<IResultCollectionPostProcessor> postProcessors) {
     20      Optimizer = optimizer;
     21      ConfiguredResultItems = configuredResultItems;
     22      PostProcessors = postProcessors;
    1523    }
    1624
    1725    public IOptimizer Optimizer { get; }
    1826    public IEnumerable<IResultJsonItem> ConfiguredResultItems { get; }
     27    public IEnumerable<IResultCollectionPostProcessor> PostProcessors { get; }
    1928  }
    2029
     
    8594      JsonItemConverter.Inject(optimizer, rootItem);
    8695
    87       return new InstantiatorResult(optimizer, CollectResults());
     96      IList<IResultCollectionPostProcessor> postProcessorList = new List<IResultCollectionPostProcessor>();
     97      var postProcessors = ApplicationManager.Manager.GetInstances<IResultCollectionPostProcessor>();
     98      foreach (JObject obj in Template["PostProcessors"]) {
     99        //string name = obj.Property("Name").Value.ToString();
     100        foreach(var proc in postProcessors) {
     101          if (proc.GetType().Name == obj["Name"].ToString())
     102            postProcessorList.Add(proc);
     103        }
     104      }
     105
     106      return new InstantiatorResult(optimizer, CollectResults(), postProcessorList);
    88107    }
    89108
Note: See TracChangeset for help on using the changeset viewer.