Changeset 4929 for branches/OKB/HeuristicLab.Clients.OKB-3.3/OKBClient.cs
- Timestamp:
- 11/25/10 02:51:45 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OKB/HeuristicLab.Clients.OKB-3.3/OKBClient.cs
r4918 r4929 323 323 324 324 #region Run Methods 325 public bool AddRun(long algorithmId, long problemId, HeuristicLab.Optimization.Run run) { 326 try { 327 IAlgorithm algorithm = run.Algorithm; 325 public bool AddRun(long algorithmId, long problemId, IAlgorithm algorithm) { 326 try { 328 327 IProblem problem = algorithm.Problem; 329 328 … … 346 345 r.ClientId = Guid.NewGuid(); 347 346 r.FinishedDate = DateTime.Now; 348 r.RandomSeed = ((IntValue)((IValueParameter) run.Parameters["Seed"]).Value).Value;347 r.RandomSeed = ((IntValue)((IValueParameter)algorithm.Parameters["Seed"]).Value).Value; 349 348 r.ResultValues = resultValues.ToArray(); 350 349 r.Store(); … … 361 360 List<AlgorithmParameterValue> values = new List<AlgorithmParameterValue>(); 362 361 foreach (IValueParameter param in item.Parameters.OfType<IValueParameter>()) { 363 if (param.GetsCollected && (param.Value != null) ) {362 if (param.GetsCollected && (param.Value != null) && (param.Name != "Seed")) { 364 363 AlgorithmParameter p = parameters.FirstOrDefault(x => x.Name == prefix + param.Name); 365 364 if (p == null) { … … 376 375 value.AlgorithmParameterId = p.Id; 377 376 value.DataTypeId = ConvertToDataType(param.Value.GetType()).Id; 377 values.Add(value); 378 378 } 379 379 … … 424 424 value.ProblemParameterId = p.Id; 425 425 value.DataTypeId = ConvertToDataType(param.Value.GetType()).Id; 426 values.Add(value); 426 427 } 427 428 … … 457 458 List<ResultValue> values = new List<ResultValue>(); 458 459 foreach (IResult result in algorithm.Results) { 459 if ((result.Value != null) && (results.FirstOrDefault(x => x.Name == result.Name) == null)) { 460 Result r = new Result(); 461 r.Name = result.Name; 462 r.Alias = result.Name; 463 r.Description = result.Description; 464 r.AlgorithmId = algorithmId; 465 r.DataTypeId = ConvertToDataType(result.DataType).Id; 466 r.Store(); 467 results.Add(r); 460 if (result.Value != null) { 461 Result r = results.FirstOrDefault(x => x.Name == result.Name); 462 if (r == null) { 463 r = new Result(); 464 r.Name = result.Name; 465 r.Alias = result.Name; 466 r.Description = result.Description; 467 r.AlgorithmId = algorithmId; 468 r.DataTypeId = ConvertToDataType(result.DataType).Id; 469 r.Store(); 470 results.Add(r); 471 } 472 ResultValue value = CreateResultValue(result.Value); 473 value.ResultId = r.Id; 474 value.DataTypeId = ConvertToDataType(result.Value.GetType()).Id; 475 values.Add(value); 468 476 } 469 477 } 470 478 return values; 471 479 } 472 private ResultValue CreateRes iötValue(IItem item) {480 private ResultValue CreateResultValue(IItem item) { 473 481 if (item is BoolValue) { 474 482 ResultBoolValue value = new ResultBoolValue();
Note: See TracChangeset
for help on using the changeset viewer.