Changeset 18046 for branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonTemplateInstantiator.cs
- Timestamp:
- 09/02/21 16:42:16 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonTemplateInstantiator.cs
r18040 r18046 6 6 using HEAL.Attic; 7 7 using HeuristicLab.Optimization; 8 using HeuristicLab.PluginInfrastructure; 8 9 using Newtonsoft.Json.Linq; 9 10 … … 13 14 Optimizer = optimizer; 14 15 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; 15 23 } 16 24 17 25 public IOptimizer Optimizer { get; } 18 26 public IEnumerable<IResultJsonItem> ConfiguredResultItems { get; } 27 public IEnumerable<IResultCollectionPostProcessor> PostProcessors { get; } 19 28 } 20 29 … … 85 94 JsonItemConverter.Inject(optimizer, rootItem); 86 95 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); 88 107 } 89 108
Note: See TracChangeset
for help on using the changeset viewer.