- Timestamp:
- 01/07/20 16:25:39 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JCGenerator.cs
r17379 r17394 35 35 // which have parameters aswell 36 36 AddInstantiableIItem(Constants.Algorithm, algorithm, genData); 37 //IsConvertable(algorithm, true);38 37 if (algorithm.Problem != null) // only when an problem exists 39 38 AddInstantiableIItem(Constants.Problem, algorithm.Problem, genData); … … 42 41 genData.Template[Constants.Parameters] = genData.JsonItems; 43 42 // serialize template and return string 44 return CustomJsonWriter.Serialize(genData.Template);43 return SingleLineArrayJsonWriter.Serialize(genData.Template); 45 44 } 46 45 47 46 #region Helper 48 private static bool IsConvertable(object obj, bool throwException = false) {49 bool tmp = ConvertableAttribute.IsConvertable(obj);50 if (throwException && tmp)51 throw new NotSupportedException($"Type {obj.GetType().GetPrettyName(false)} is not convertable!");52 return tmp;53 }54 47 55 48 private static void AddInstantiableIItem(string metaDataTagName, IItem item, GenData genData) { 56 49 JsonItem jsonItem = JsonItemConverter.Extract(item); 50 57 51 genData.Template[Constants.Metadata][metaDataTagName] = item.ItemName; 58 52 PopulateJsonItems(jsonItem, genData); … … 62 56 private static void PopulateJsonItems(JsonItem item, GenData genData) { 63 57 IEnumerable<JsonItem> tmpParameter = item.Children; 64 item.Children = null;65 58 66 59 if (item.Value != null || item.Range != null) {
Note: See TracChangeset
for help on using the changeset viewer.