Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4110


Ignore:
Timestamp:
07/27/10 11:28:39 (14 years ago)
Author:
mkommend
Message:

added runs of optimzers to the result collection (ticket #1111)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization/3.3/Experiment.cs

    r3716 r4110  
    243243        DeregisterOptimizerEvents(item.Value);
    244244      }
    245       foreach (IndexedItem<IOptimizer> item in e.Items) {
    246         RegisterOptimizerEvents(item.Value);
    247         item.Value.Prepare();
    248       }
     245      foreach (IndexedItem<IOptimizer> item in e.Items)
     246        AddOptimizer(item.Value);
    249247    }
    250248    private void Optimizers_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<IOptimizer>> e) {
    251       foreach (IndexedItem<IOptimizer> item in e.Items) {
    252         RegisterOptimizerEvents(item.Value);
    253         item.Value.Prepare();
    254       }
     249      foreach (IndexedItem<IOptimizer> item in e.Items)
     250        AddOptimizer(item.Value);
    255251    }
    256252    private void Optimizers_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<IOptimizer>> e) {
     
    263259        DeregisterOptimizerEvents(item.Value);
    264260      }
    265       foreach (IndexedItem<IOptimizer> item in e.Items) {
    266         RegisterOptimizerEvents(item.Value);
    267         item.Value.Prepare();
    268       }
     261      foreach (IndexedItem<IOptimizer> item in e.Items)
     262        AddOptimizer(item.Value);
     263    }
     264    private void AddOptimizer(IOptimizer optimizer) {
     265      RegisterOptimizerEvents(optimizer);
     266      Runs.AddRange(optimizer.Runs);
     267      optimizer.Prepare();
    269268    }
    270269
Note: See TracChangeset for help on using the changeset viewer.