Changeset 5786 for branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/HiveJobClient.cs
- Timestamp:
- 03/22/11 11:36:53 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/HiveJobClient.cs
r5779 r5786 77 77 DergisterOptimizerEvents(); 78 78 optimizerJob = value; 79 if (optimizerJob.ExecutionState == ExecutionState.Stopped) {80 IsFinishedOptimizerDownloaded = true;81 }79 //if (optimizerJob.ExecutionState == ExecutionState.Stopped) { 80 // IsFinishedOptimizerDownloaded = true; 81 //} 82 82 RegisterOptimizerEvents(); 83 83 OnOptimizerJobChanged(); … … 91 91 } 92 92 93 private bool isFinishedOptimizerDownloaded;94 public bool IsFinishedOptimizerDownloaded {95 get { return isFinishedOptimizerDownloaded; }96 set {97 if (isFinishedOptimizerDownloaded != value) {98 isFinishedOptimizerDownloaded = value;99 OnIsFinishedOptimizerDownloadedChanged();100 }101 }102 }93 //private bool isFinishedOptimizerDownloaded; 94 //public bool IsFinishedOptimizerDownloaded { 95 // get { return isFinishedOptimizerDownloaded; } 96 // set { 97 // if (isFinishedOptimizerDownloaded != value) { 98 // isFinishedOptimizerDownloaded = value; 99 // OnIsFinishedOptimizerDownloadedChanged(); 100 // } 101 // } 102 //} 103 103 104 104 private bool syncJobsWithOptimizers = true; … … 331 331 } 332 332 if (childIsFinishedOptimizerDownloaded) { 333 child.IsFinishedOptimizerDownloaded = true;333 //child.IsFinishedOptimizerDownloaded = true; // todo: clean up with childIsFinishedOptimizerDownloaded 334 334 } 335 335 syncJobsWithOptimizers = true; … … 345 345 } 346 346 foreach (IRun run in optimizerJob.Optimizer.Runs) { 347 if (!batchRun.Runs.Contains(run)) 347 if (!batchRun.Runs.Contains(run)) { 348 run.Name = GetNewRunName(run, batchRun.Runs); 348 349 batchRun.Runs.Add(run); 350 } 351 } 352 } 353 354 /// <summary> 355 /// Parses the run numbers out of runs and renames the run to the next number 356 /// </summary> 357 private static string GetNewRunName(IRun run, RunCollection runs) { 358 int idx = run.Name.IndexOf("Run ") + 4; 359 360 if (idx == -1 || runs.Count == 0) 361 return run.Name; 362 363 int maxRunNumber = int.MinValue; 364 foreach (IRun r in runs) { 365 int number = GetRunNumber(r.Name); 366 maxRunNumber = Math.Max(maxRunNumber, number); 367 } 368 369 return run.Name.Substring(0, idx) + (maxRunNumber + 1).ToString(); 370 } 371 372 /// <summary> 373 /// Parses the number of a Run out of its name. Example "Genetic Algorithm Run 3" -> 3 374 /// </summary> 375 private static int GetRunNumber(string runName) { 376 int idx = runName.IndexOf("Run ") + 4; 377 if (idx == -1) { 378 return 0; 379 } else { 380 return int.Parse(runName.Substring(idx, runName.Length - idx)); 349 381 } 350 382 } … … 403 435 if (lightweightJob != null) { 404 436 job.Id = lightweightJob.Id; 405 job. Id = lightweightJob.Id;437 job.ParentJobId = lightweightJob.ParentJobId; 406 438 job.ExecutionTime = lightweightJob.ExecutionTime; 407 439 job.State = lightweightJob.State; 408 440 job.StateLog = new List<StateLog>(lightweightJob.StateLog); 409 // what about parentJob 441 job.Command = lightweightJob.Command; 442 job.LastJobDataUpdate = lightweightJob.LastJobDataUpdate; 443 410 444 OnJobStateChanged(); 411 445 OnToStringChanged();
Note: See TracChangeset
for help on using the changeset viewer.