Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/19/15 16:12:20 (10 years ago)
Author:
ascheibe
Message:

#2328 improved handling of batchruns in Hive

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Clients.Hive/3.3/HiveTasks/OptimizerHiveTask.cs

    r12012 r12041  
    234234      itemTaskLock.EnterWriteLock();
    235235      try {
    236         if (batchRun.Optimizer == null) {
    237           batchRun.Optimizer = (IOptimizer)optimizerTask.Item; // only set the first optimizer as Optimizer. if every time the Optimizer would be set, the runs would be cleared each time
    238         }
    239         foreach (IRun run in optimizerTask.Item.Runs) {
    240           if (!batchRun.Runs.Contains(run)) {
     236        if (optimizerTask.Item is IAlgorithm) {
     237          // only set the first optimizer as Optimizer. if every time the Optimizer would be set, the runs would be cleared each time
     238          if (batchRun.Optimizer == null) {
     239            batchRun.Optimizer = (IOptimizer)optimizerTask.Item.Clone();
     240            batchRun.Optimizer.Runs.Clear();
     241          }
     242
     243          foreach (IRun run in optimizerTask.Item.Runs) {
     244            run.Name = GetNewRunName(run, batchRun.Runs);
     245            batchRun.Optimizer.Runs.Add(run);
     246          }
     247        } else {
     248          // only set the first optimizer as Optimizer. if every time the Optimizer would be set, the runs would be cleared each time
     249          if (batchRun.Optimizer == null) {
     250            batchRun.Optimizer = optimizerTask.Item;
     251          }
     252          foreach (IRun run in optimizerTask.Item.Runs) {
     253            if (batchRun.Runs.Contains(run)) continue;
    241254            run.Name = GetNewRunName(run, batchRun.Runs);
    242255            batchRun.Runs.Add(run);
Note: See TracChangeset for help on using the changeset viewer.