- Timestamp:
- 02/17/20 17:29:52 (5 years ago)
- Location:
- branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonTemplateInstantiator.cs
r17439 r17442 25 25 } 26 26 27 public static IOptimizer Instantiate(string templateFile) => 28 Instantiate(templateFile, null, out IEnumerable<string> allowedResultNames); 29 30 31 public static IOptimizer Instantiate(string templateFile, out IEnumerable<string> allowedResultNames) => 32 Instantiate(templateFile, null, out allowedResultNames); 33 34 35 27 36 /// <summary> 28 37 /// Instantiate an IAlgorithm object with a template and config. … … 31 40 /// <param name="configFile">Config file (json) for the template.</param> 32 41 /// <returns>confugrated IOptimizer object</returns> 33 public static IOptimizer Instantiate(string templateFile, string configFile = "") {42 public static IOptimizer Instantiate(string templateFile, string configFile, out IEnumerable<string> allowedResultNames) { 34 43 InstData instData = new InstData() { 35 44 Objects = new Dictionary<string, IJsonItem>() … … 63 72 JsonItemConverter.Inject(optimizer, optimizerData); 64 73 74 allowedResultNames = CollectResults(instData); 75 65 76 return optimizer; 66 77 } … … 70 81 private static object GetValueFromJObject(JObject obj) => 71 82 obj[nameof(IJsonItem.Value)]?.ToObject<object>(); 83 84 private static IEnumerable<string> CollectResults(InstData instData) { 85 IList<string> res = new List<string>(); 86 foreach(JObject obj in instData.Template[Constants.Results]) { 87 res.Add(obj.Property("Name").Value.ToString()); 88 } 89 return res; 90 } 72 91 73 92 private static void CollectParameterizedItems(InstData instData) { -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/SingleLineArrayJsonWriter.cs
r17406 r17442 8 8 /// It collapses arrays into a single line. 9 9 /// </summary> 10 internalclass SingleLineArrayJsonWriter : JsonTextWriter {10 public class SingleLineArrayJsonWriter : JsonTextWriter { 11 11 private bool isRangeArray = false; 12 12 public override void WriteStartArray() {
Note: See TracChangeset
for help on using the changeset viewer.