Index: trunk/sources/HeuristicLab.Optimization/3.3/BatchRun.cs
===================================================================
--- trunk/sources/HeuristicLab.Optimization/3.3/BatchRun.cs	(revision 4114)
+++ trunk/sources/HeuristicLab.Optimization/3.3/BatchRun.cs	(revision 4115)
@@ -27,4 +27,5 @@
 using HeuristicLab.Data;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using System.Collections.Generic;
 
 namespace HeuristicLab.Optimization {
@@ -80,7 +81,15 @@
       set {
         if (algorithm != value) {
-          if (algorithm != null) DeregisterAlgorithmEvents();
+          if (algorithm != null) {
+            DeregisterAlgorithmEvents();
+            IEnumerable<IRun> runs = algorithm.Runs;
+            algorithm = null; //necessary to avoid removing the runs from the old algorithm
+            Runs.RemoveRange(runs);
+          }
           algorithm = value;
-          if (algorithm != null) RegisterAlgorithmEvents();
+          if (algorithm != null) {
+            RegisterAlgorithmEvents();
+            Runs.AddRange(algorithm.Runs);
+          }
           OnAlgorithmChanged();
           Prepare();
@@ -324,8 +333,11 @@
     private void RegisterRunsEvents() {
       runs.CollectionReset += new CollectionItemsChangedEventHandler<IRun>(Runs_CollectionReset);
+      runs.ItemsAdded += new CollectionItemsChangedEventHandler<IRun>(Runs_ItemsAdded);
       runs.ItemsRemoved += new CollectionItemsChangedEventHandler<IRun>(Runs_ItemsRemoved);
     }
+
     private void DeregisterRunsEvents() {
       runs.CollectionReset -= new CollectionItemsChangedEventHandler<IRun>(Runs_CollectionReset);
+      runs.ItemsAdded -= new CollectionItemsChangedEventHandler<IRun>(Runs_ItemsAdded);
       runs.ItemsRemoved -= new CollectionItemsChangedEventHandler<IRun>(Runs_ItemsRemoved);
     }
@@ -345,4 +357,12 @@
       }
     }
+    private void Runs_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IRun> e) {
+      foreach (IRun run in e.Items) {
+        IItem item;
+        run.Results.TryGetValue("Execution Time", out item);
+        TimeSpanValue executionTime = item as TimeSpanValue;
+        if (executionTime != null) ExecutionTime += executionTime.Value;
+      }
+    }
     private void Runs_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IRun> e) {
       foreach (IRun run in e.Items) {
Index: trunk/sources/HeuristicLab.Optimization/3.3/Experiment.cs
===================================================================
--- trunk/sources/HeuristicLab.Optimization/3.3/Experiment.cs	(revision 4114)
+++ trunk/sources/HeuristicLab.Optimization/3.3/Experiment.cs	(revision 4115)
@@ -240,7 +240,6 @@
     }
     private void Optimizers_CollectionReset(object sender, CollectionItemsChangedEventArgs<IndexedItem<IOptimizer>> e) {
-      foreach (IndexedItem<IOptimizer> item in e.OldItems) {
-        DeregisterOptimizerEvents(item.Value);
-      }
+      foreach (IndexedItem<IOptimizer> item in e.OldItems)
+        RemoveOptimizer(item.Value);
       foreach (IndexedItem<IOptimizer> item in e.Items)
         AddOptimizer(item.Value);
@@ -251,12 +250,10 @@
     }
     private void Optimizers_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<IOptimizer>> e) {
-      foreach (IndexedItem<IOptimizer> item in e.Items) {
-        DeregisterOptimizerEvents(item.Value);
-      }
+      foreach (IndexedItem<IOptimizer> item in e.Items)
+        RemoveOptimizer(item.Value);
     }
     private void Optimizers_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedItem<IOptimizer>> e) {
-      foreach (IndexedItem<IOptimizer> item in e.OldItems) {
-        DeregisterOptimizerEvents(item.Value);
-      }
+      foreach (IndexedItem<IOptimizer> item in e.OldItems)
+        RemoveOptimizer(item.Value);
       foreach (IndexedItem<IOptimizer> item in e.Items)
         AddOptimizer(item.Value);
@@ -266,4 +263,8 @@
       Runs.AddRange(optimizer.Runs);
       optimizer.Prepare();
+    }
+    private void RemoveOptimizer(IOptimizer optimizer) {
+      DeregisterOptimizerEvents(optimizer);
+      Runs.RemoveRange(optimizer.Runs);
     }
 
