Changeset 18039
- Timestamp:
- 08/03/21 10:53:47 (3 years ago)
- Location:
- branches/3026_IntegrationIntoSymSpace
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.App/Runner.cs
r18026 r18039 66 66 foreach(var result in filteredResults) { 67 67 var formatter = GetResultFormatter(result.Item1.ResultFormatterType); 68 obj.Add(result.Item1.Name, formatter.Format(result.Item2)); 68 if(!obj.ContainsKey(result.Item1.Name)) // to prevent duplicates 69 obj.Add(result.Item1.Name, formatter.Format(result.Item2)); 69 70 } 70 71 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/AlgorithmConverter.cs
r17843 r18039 28 28 IAlgorithm algorithm = value as IAlgorithm; 29 29 foreach (var res in algorithm.Results) { 30 item.AddChildren(root.Extract(res, root)); 31 /* 32 item.AddChildren(new ResultJsonItem() { 33 Name = res.Name, 34 Description = res.Description 35 });*/ 30 var resultItem = root.Extract(res, root); 31 // fetch all result parameter items 32 var resultParameterItems = 33 item.Where(x => x 34 .GetType() 35 .GetInterfaces() 36 .Any(y => y == typeof(IResultJsonItem))); 37 // check for duplicates (to prevent double result items, 38 // which can occur with result parameters) 39 if(!resultParameterItems.Any(x => x.Name == resultItem.Name)) 40 item.AddChildren(resultItem); 36 41 } 37 42 item.AddChildren(root.Extract(algorithm.Problem, root)); -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonTemplateInstantiator.cs
r18030 r18039 24 24 /// </summary> 25 25 public class JsonTemplateInstantiator { 26 27 #region Constants 28 private const string RelativePathCurrentDirectoryRegex = @"^(\.)"; 29 #endregion 26 30 27 31 #region Private Properties … … 52 56 53 57 // extract metadata information 54 string relativePath = Template[Constants.Metadata][Constants.HLFileLocation].ToString() ; // get relative path58 string relativePath = Template[Constants.Metadata][Constants.HLFileLocation].ToString().Trim(); // get relative path 55 59 // convert to absolute path 56 string hLFileLocation = Regex.Replace(relativePath, @"^(\.)", $"{Path.GetDirectoryName(templateFile)}"); 60 if (Regex.IsMatch(relativePath, RelativePathCurrentDirectoryRegex)) 61 relativePath = relativePath.Remove(0, 2); // remove first 2 chars -> indicates the current directory 62 63 string hLFileLocation = $"{Path.GetDirectoryName(templateFile)}{Path.DirectorySeparatorChar}{relativePath}"; 57 64 58 65 #region Deserialize HL File
Note: See TracChangeset
for help on using the changeset viewer.