- Timestamp:
- 02/12/21 15:24:18 (4 years ago)
- Location:
- branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/AlgorithmConverter.cs
r17828 r17834 30 30 IAlgorithm algorithm = value as IAlgorithm; 31 31 foreach (var res in algorithm.Results) { 32 item.AddChildren(root.Extract(res, root)); 33 /* 32 34 item.AddChildren(new ResultJsonItem() { 33 35 Name = res.Name, 34 36 Description = res.Description 35 }); 37 });*/ 36 38 } 37 39 item.AddChildren(root.Extract(algorithm.Problem, root)); -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/BaseConverter.cs
r17828 r17834 20 20 public abstract IJsonItem Extract(IItem value, IJsonItemConverter root); 21 21 22 22 23 #region Helper 23 24 24 protected IItem Instantiate(Type type, params object[] args) => 25 25 (IItem)Activator.CreateInstance(type,args); -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/RegressionProblemDataConverter.cs
r17828 r17834 66 66 67 67 // check data 68 if(!dataset. RowNames.Any(x => x == targetVariable.Value)) {68 if(!dataset.ColumnNames.Any(x => x == targetVariable.Value)) { 69 69 throw new Exception($"The value of the target variable ('{targetVariable.Value}') has no matching row name value of the dataset."); 70 70 } 71 71 72 72 foreach(var v in allowedInputVariables.Value) { 73 if(!dataset. RowNames.Any(x => x == v))73 if(!dataset.ColumnNames.Any(x => x == v)) 74 74 throw new Exception($"The value of the input variable ('{v}') has no matching row name value of the dataset."); 75 75 } … … 106 106 var dictTmp = new Dictionary<string, IList>(); 107 107 int c = 0; 108 foreach (var col in item. RowNames) {108 foreach (var col in item.ColumnNames) { 109 109 dictTmp.Add(col, new List<double>(item.Value[c])); 110 110 ++c; … … 116 116 117 117 var variableNames = dataset.GetType().GetField(VariableNames, flags); 118 variableNames.SetValue(dataset, item. RowNames);118 variableNames.SetValue(dataset, item.ColumnNames); 119 119 120 120 var dataInfo = dataset.GetType().GetField(VariableValues, flags); … … 162 162 163 163 // add list items and set their check state (based on allowed input variables) 164 foreach(var i in matrix. RowNames) {164 foreach(var i in matrix.ColumnNames) { 165 165 bool isChecked = false; 166 166 foreach(var x in item.Value) -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ResultParameterConverter.cs
r17828 r17834 1 1 using System; 2 using System.Collections.Generic;3 2 using System.Linq; 4 using System.Text;5 using System.Threading.Tasks;6 3 using HeuristicLab.Core; 7 4 using HeuristicLab.Optimization; … … 14 11 15 12 public override bool CanConvertType(Type t) => 16 t.GetInterfaces().Any(x => x == typeof(IResultParameter));13 t.GetInterfaces().Any(x => x == ConvertableType); 17 14 18 15 public override IJsonItem Extract(IItem value, IJsonItemConverter root) { 19 16 IResultParameter res = value as IResultParameter; 17 var formatter = ResultFormatter.ForType(res.DataType).Last(); 20 18 return new ResultJsonItem() { 21 19 Name = res.ActualName, 22 Description = res.Description 20 Description = res.Description, 21 ResultFormatterType = formatter.GetType().FullName, 22 ValueType = res.DataType 23 23 }; 24 24 }
Note: See TracChangeset
for help on using the changeset viewer.