Changeset 9350 for branches/OaaS/HeuristicLab.Services.Optimization.Controller/HL/HiveScenarioManager.cs
- Timestamp:
- 04/10/13 13:29:24 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OaaS/HeuristicLab.Services.Optimization.Controller/HL/HiveScenarioManager.cs
r9324 r9350 21 21 using System.Data; 22 22 using HeuristicLab.Services.Optimization.ControllerService.General; 23 using HeuristicLab.Services.Optimization.ControllerService.Parameters.HL; 23 24 24 25 namespace HeuristicLab.Services.Optimization.ControllerService { 25 public class ScenarioEntity : TableServiceEntity { 26 26 public class ScenarioEntity : TableServiceEntity { 27 27 public ScenarioEntity() { 28 28 } … … 41 41 42 42 public class HiveScenarioManager : IScenarioManager { 43 private static HLParameterMapper parameterMapper = new HLParameterMapper(); 43 44 private static IScenarioMapper tspMapper; 44 45 private static object lockable; … … 297 298 var value = run.Results[key]; 298 299 Parameter result = MapHiveDataType(key, value); 299 resultValues.Add(result); 300 resultValues.Add(result); 300 301 } 301 302 taskRun.Results = resultValues; 303 IList<Parameter> inputParameters = new List<Model.Parameter>(); 304 foreach (var key in run.Parameters.Keys) { 305 var value = run.Parameters[key]; 306 Parameter param = MapHiveDataType(key, value); 307 inputParameters.Add(param); 308 } 309 // crawl the copied experiment of the job 310 //taskRun.Experiment = dal.JobDao.FindByJobId(id); 311 taskRun.InputParameters = inputParameters; 302 312 runs.Add(taskRun); 303 313 } … … 310 320 311 321 private Parameter MapHiveDataType(string name, IItem item) { 312 Parameter result = new Parameter(); 322 323 if (parameterMapper.IsHandlerAvailable(item)) { 324 return parameterMapper.Map(name, item); 325 } 326 327 var result = new Parameter(); 313 328 result.Type = ParameterType.String; 314 329 //TODO: How shall we handle dll specific datatypes? … … 349 364 matrixValue[i][j] = matrix[j, i]; 350 365 } 351 } 366 } 367 matrixValue = transpose(matrixValue); 352 368 result.Value = new HeuristicLab.Services.Optimization.ControllerService.Model.DecimalMatrix() { Name = name, Value = matrixValue, RowNames = (matrix.ColumnNames.Count() > 0 ? matrix.ColumnNames.ToArray() : null) }; 353 369 } … … 408 424 } 409 425 else { 410 result.Value = new HeuristicLab.Services.Optimization.ControllerService.Model.StringValue() { Name = name, Value = "Cannot be displayedas string" };426 result.Value = new HeuristicLab.Services.Optimization.ControllerService.Model.StringValue() { Name = name, Value = item.ItemName != null ? item.ItemName + " (Cannot be displayed properly as string)" : "Cannot be displayed properly as string" }; 411 427 } 412 428 // TODO: Add workaround for TSP
Note: See TracChangeset
for help on using the changeset viewer.