Index: trunk/sources/HeuristicLab.Optimization/3.3/Experiment.cs
===================================================================
--- trunk/sources/HeuristicLab.Optimization/3.3/Experiment.cs	(revision 3276)
+++ trunk/sources/HeuristicLab.Optimization/3.3/Experiment.cs	(revision 3280)
@@ -62,17 +62,8 @@
     }
 
+    [Storable]
     private OptimizerList optimizers;
-    [Storable]
     public OptimizerList Optimizers {
       get { return optimizers; }
-      private set {
-        if (optimizers != value) {
-          if (optimizers != null) DeregisterOptimizersEvents();
-          optimizers = value;
-          if (optimizers != null) RegisterOptimizersEvents();
-          foreach (IOptimizer optimizer in optimizers)
-            RegisterOptimizerEvents(optimizer);
-        }
-      }
     }
 
@@ -87,32 +78,54 @@
     public Experiment()
       : base() {
+      name = ItemName;
+      description = ItemDescription;
       executionState = ExecutionState.Stopped;
       executionTime = TimeSpan.Zero;
-      Optimizers = new OptimizerList();
+      optimizers = new OptimizerList();
       runs = new RunCollection();
       stopPending = false;
-    }
-    public Experiment(string name) : base(name) {
+      Initialize();
+    }
+    public Experiment(string name)
+      : base(name) {
+      description = ItemDescription;
       executionState = ExecutionState.Stopped;
       executionTime = TimeSpan.Zero;
-      Optimizers = new OptimizerList();
+      optimizers = new OptimizerList();
       runs = new RunCollection();
       stopPending = false;
-    }
-    public Experiment(string name, string description) : base(name, description) {
+      Initialize();
+    }
+    public Experiment(string name, string description)
+      : base(name, description) {
       executionState = ExecutionState.Stopped;
       executionTime = TimeSpan.Zero;
-      Optimizers = new OptimizerList();
+      optimizers = new OptimizerList();
       runs = new RunCollection();
       stopPending = false;
+      Initialize();
+    }
+    [StorableConstructor]
+    private Experiment(bool deserializing)
+      : base(deserializing) {
+      stopPending = false;
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void Initialize() {
+      RegisterOptimizersEvents();
+      foreach (IOptimizer optimizer in optimizers)
+        RegisterOptimizerEvents(optimizer);
     }
 
     public override IDeepCloneable Clone(Cloner cloner) {
+      if (ExecutionState == ExecutionState.Started) throw new InvalidOperationException(string.Format("Clone not allowed in execution state \"{0}\".", ExecutionState));
       Experiment clone = (Experiment)base.Clone(cloner);
       clone.executionState = executionState;
       clone.executionTime = executionTime;
-      clone.Optimizers = (OptimizerList)cloner.Clone(optimizers);
+      clone.optimizers = (OptimizerList)cloner.Clone(optimizers);
       clone.runs = (RunCollection)cloner.Clone(runs);
       clone.stopPending = stopPending;
+      clone.Initialize();
       return clone;
     }
@@ -244,7 +257,7 @@
       optimizer.Started += new EventHandler(optimizer_Started);
       optimizer.Stopped += new EventHandler(optimizer_Stopped);
-      optimizer.Runs.CollectionReset += new CollectionItemsChangedEventHandler<Run>(optimizer_Runs_CollectionReset);
-      optimizer.Runs.ItemsAdded += new CollectionItemsChangedEventHandler<Run>(optimizer_Runs_ItemsAdded);
-      optimizer.Runs.ItemsRemoved += new CollectionItemsChangedEventHandler<Run>(optimizer_Runs_ItemsRemoved);
+      optimizer.Runs.CollectionReset += new CollectionItemsChangedEventHandler<IRun>(optimizer_Runs_CollectionReset);
+      optimizer.Runs.ItemsAdded += new CollectionItemsChangedEventHandler<IRun>(optimizer_Runs_ItemsAdded);
+      optimizer.Runs.ItemsRemoved += new CollectionItemsChangedEventHandler<IRun>(optimizer_Runs_ItemsRemoved);
     }
     private void DeregisterOptimizerEvents(IOptimizer optimizer) {
@@ -255,7 +268,7 @@
       optimizer.Started -= new EventHandler(optimizer_Started);
       optimizer.Stopped -= new EventHandler(optimizer_Stopped);
-      optimizer.Runs.CollectionReset -= new CollectionItemsChangedEventHandler<Run>(optimizer_Runs_CollectionReset);
-      optimizer.Runs.ItemsAdded -= new CollectionItemsChangedEventHandler<Run>(optimizer_Runs_ItemsAdded);
-      optimizer.Runs.ItemsRemoved -= new CollectionItemsChangedEventHandler<Run>(optimizer_Runs_ItemsRemoved);
+      optimizer.Runs.CollectionReset -= new CollectionItemsChangedEventHandler<IRun>(optimizer_Runs_CollectionReset);
+      optimizer.Runs.ItemsAdded -= new CollectionItemsChangedEventHandler<IRun>(optimizer_Runs_ItemsAdded);
+      optimizer.Runs.ItemsRemoved -= new CollectionItemsChangedEventHandler<IRun>(optimizer_Runs_ItemsRemoved);
     }
     private void optimizer_ExceptionOccurred(object sender, EventArgs<Exception> e) {
@@ -287,12 +300,12 @@
       }
     }
-    private void optimizer_Runs_CollectionReset(object sender, CollectionItemsChangedEventArgs<Run> e) {
+    private void optimizer_Runs_CollectionReset(object sender, CollectionItemsChangedEventArgs<IRun> e) {
       Runs.RemoveRange(e.OldItems);
       Runs.AddRange(e.Items);
     }
-    private void optimizer_Runs_ItemsAdded(object sender, CollectionItemsChangedEventArgs<Run> e) {
+    private void optimizer_Runs_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IRun> e) {
       Runs.AddRange(e.Items);
     }
-    private void optimizer_Runs_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<Run> e) {
+    private void optimizer_Runs_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IRun> e) {
       Runs.RemoveRange(e.Items);
     }
