Index: /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Individuals/MultiSolution.cs
===================================================================
--- /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Individuals/MultiSolution.cs	(revision 13358)
+++ /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Individuals/MultiSolution.cs	(revision 13359)
@@ -35,6 +35,4 @@
     protected IScope Scope { get; private set; }
 
-    private readonly Dictionary<string, ISolution> solutions;
-
     [StorableConstructor]
     private CombinedSolution(bool deserializing) : base(deserializing) { }
@@ -44,11 +42,8 @@
       Encoding = cloner.Clone(original.Encoding);
       Scope = cloner.Clone(original.Scope);
-      solutions = original.solutions.ToDictionary(x => x.Key, x => cloner.Clone(x.Value));
     }
     public CombinedSolution(IScope scope, MultiEncoding encoding) {
       Encoding = encoding;
       Scope = scope;
-      solutions = encoding.Encodings.Select(e => new { Name = e.Name, Solution = ScopeUtil.GetSolution(scope, e) })
-                                    .ToDictionary(x => x.Name, x => x.Solution);
     }
 
@@ -58,13 +53,6 @@
 
     public ISolution this[string name] {
-      get {
-        ISolution result;
-        if (!solutions.TryGetValue(name, out result)) throw new ArgumentException(string.Format("{0} is not part of the specified encoding.", name));
-        return result;
-      }
-      set {
-        if (!solutions.ContainsKey(name)) throw new ArgumentException(string.Format("{0} is not part of the specified encoding.", name));
-        solutions[name] = value;
-      }
+      get { return ScopeUtil.GetSolution(Scope, name); }
+      set { ScopeUtil.CopySolutionToScope(Scope, name, value); }
     }
 
@@ -80,13 +68,6 @@
     }
 
-    public TSolution GetSolution<TSolution>() where TSolution : class, ISolution {
-      TSolution solution;
-      try {
-        solution = (TSolution)solutions.SingleOrDefault(s => s.Value is TSolution).Value;
-      } catch (InvalidOperationException) {
-        throw new InvalidOperationException(string.Format("The solution uses multiple {0} .", typeof(TSolution).GetPrettyName()));
-      }
-      if (solution == null) throw new InvalidOperationException(string.Format("The solution does not use a {0}.", typeof(TSolution).GetPrettyName()));
-      return solution;
+    public TSolution GetSolution<TSolution>(string name) where TSolution : class, ISolution {
+      return (TSolution)ScopeUtil.GetSolution(Scope, name);
     }
   }
Index: /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Interfaces/IEncodingOperator.cs
===================================================================
--- /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Interfaces/IEncodingOperator.cs	(revision 13358)
+++ /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Interfaces/IEncodingOperator.cs	(revision 13359)
@@ -23,5 +23,5 @@
 
 namespace HeuristicLab.Optimization {
-  public interface IEncodingOperator<TSolution> : IOperator where TSolution : class, ISolution{
+  public interface IEncodingOperator<TSolution> : IOperator where TSolution : class, ISolution {
     ILookupParameter<IEncoding<TSolution>> EncodingParameter { get; }
   }
Index: /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Interfaces/IMultiEncodingOperator.cs
===================================================================
--- /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Interfaces/IMultiEncodingOperator.cs	(revision 13358)
+++ /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Interfaces/IMultiEncodingOperator.cs	(revision 13359)
@@ -24,5 +24,8 @@
 namespace HeuristicLab.Optimization {
   public interface IMultiEncodingOperator : IOperator {
-    MultiEncoding Encoding { get; set; }
+    ILookupParameter<CombinedSolution> SolutionParameter { get; }
+
+    void AddEncoding(IEncoding encoding);
+    bool RemoveEncoding(IEncoding encoding);
   }
 }
Index: /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/MultiEncoding.cs
===================================================================
--- /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/MultiEncoding.cs	(revision 13358)
+++ /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/MultiEncoding.cs	(revision 13359)
@@ -33,10 +33,10 @@
   public sealed class MultiEncoding : Encoding<CombinedSolution> {
 
-    private readonly ItemCollection<IEncoding> encodings;
+    private ItemCollection<IEncoding> encodings;
 
     [Storable]
     private IEnumerable<IEncoding> StorableEncodings {
       get { return encodings; }
-      set { encodings.AddRange(value); }
+      set { encodings = new ItemCollection<IEncoding>(value); }
     }
 
@@ -46,8 +46,5 @@
 
     [StorableConstructor]
-    private MultiEncoding(bool deserializing)
-      : base(deserializing) {
-      encodings = new ItemCollection<IEncoding>();
-    }
+    private MultiEncoding(bool deserializing) : base(deserializing) { }
     public override IDeepCloneable Clone(Cloner cloner) { return new MultiEncoding(this, cloner); }
     private MultiEncoding(MultiEncoding original, Cloner cloner)
@@ -58,7 +55,7 @@
       : base("MultiEncoding") {
       encodings = new ItemCollection<IEncoding>();
-      SolutionCreator = new MultiEncodingCreator() { Encoding = this };
+      SolutionCreator = new MultiEncodingCreator() { SolutionParameter = { ActualName = Name } };
       foreach (var @operator in ApplicationManager.Manager.GetInstances<IMultiEncodingOperator>()) {
-        @operator.Encoding = this;
+        @operator.SolutionParameter.ActualName = Name;
         AddOperator(@operator);
       }
@@ -70,4 +67,8 @@
       encodings.Add(encoding);
       Parameters.AddRange(encoding.Parameters);
+
+      foreach (var @operator in Operators.OfType<IMultiEncodingOperator>())
+        @operator.AddEncoding(encoding);
+
       return this;
     }
@@ -76,8 +77,15 @@
       var success = encodings.Remove(encoding);
       Parameters.RemoveRange(encoding.Parameters);
+
+      foreach (var @operator in Operators.OfType<IMultiEncodingOperator>())
+        @operator.RemoveEncoding(encoding);
+
       return success;
     }
 
-    public override void ConfigureOperators(IEnumerable<IOperator> operators) { }
+    public override void ConfigureOperators(IEnumerable<IOperator> operators) {
+      foreach (var encOp in operators.OfType<IMultiEncodingOperator>())
+        encOp.SolutionParameter.ActualName = Name;
+    }
   }
 }
Index: /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Operators/MultiEncodingCreator.cs
===================================================================
--- /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Operators/MultiEncodingCreator.cs	(revision 13358)
+++ /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Operators/MultiEncodingCreator.cs	(revision 13359)
@@ -24,5 +24,4 @@
 using HeuristicLab.Common;
 using HeuristicLab.Core;
-using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
 
@@ -41,5 +40,5 @@
     }
 
-    protected override void AddEncoding(IEncoding encoding) {
+    public override void AddEncoding(IEncoding encoding) {
       base.AddEncoding(encoding);
       var parameter = GetParameter(encoding);
@@ -48,5 +47,5 @@
     }
 
-    protected override bool RemoveEncoding(IEncoding encoding) {
+    public override bool RemoveEncoding(IEncoding encoding) {
       var success = base.RemoveEncoding(encoding);
       encoding.SolutionCreatorChanged -= Encoding_SolutionCreatorChanged;
@@ -66,6 +65,6 @@
 
     public override IOperation InstrumentedApply() {
-      CombinedSolutionParameter.ActualValue = new CombinedSolution(ExecutionContext.Scope, Encoding);
-      return base.Apply();
+      SolutionParameter.ActualValue = new CombinedSolution(ExecutionContext.Scope, (MultiEncoding)EncodingParameter.ActualValue);
+      return base.InstrumentedApply();
     }
   }
Index: /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Operators/MultiEncodingCrossover.cs
===================================================================
--- /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Operators/MultiEncodingCrossover.cs	(revision 13358)
+++ /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Operators/MultiEncodingCrossover.cs	(revision 13359)
@@ -22,5 +22,4 @@
 using HeuristicLab.Common;
 using HeuristicLab.Core;
-using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
 
@@ -39,6 +38,6 @@
 
     public override IOperation InstrumentedApply() {
-      CombinedSolutionParameter.ActualValue = new CombinedSolution(ExecutionContext.Scope, Encoding);
-      return base.Apply();
+      SolutionParameter.ActualValue = new CombinedSolution(ExecutionContext.Scope, (MultiEncoding)EncodingParameter.ActualValue);
+      return base.InstrumentedApply();
     }
   }
Index: /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Operators/MultiEncodingOperator.cs
===================================================================
--- /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Operators/MultiEncodingOperator.cs	(revision 13358)
+++ /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Operators/MultiEncodingOperator.cs	(revision 13359)
@@ -21,7 +21,5 @@
 
 using System;
-using System.Collections.Generic;
 using System.Linq;
-using HeuristicLab.Collections;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -32,66 +30,20 @@
 namespace HeuristicLab.Optimization {
   [StorableClass]
-  public abstract class MultiEncodingOperator<T> : InstrumentedOperator, IMultiEncodingOperator where T : class, IOperator {
-    [Storable]
-    private MultiEncoding encoding;
-    public MultiEncoding Encoding {
-      get { return encoding; }
-      set {
-        if (value == null) throw new ArgumentNullException("Encoding must not be null.");
-        if (value == encoding) return;
-        if (encoding != null) DeregisterEventHandlers();
-        encoding = value;
-        CombinedSolutionParameter.ActualName = encoding.Name;
-        RegisterEventHandlers();
-      }
+  public abstract class MultiEncodingOperator<T> : InstrumentedOperator, IEncodingOperator<CombinedSolution>, IMultiEncodingOperator where T : class, IOperator {
+    public ILookupParameter<CombinedSolution> SolutionParameter {
+      get { return (ILookupParameter<CombinedSolution>)Parameters["Solution"]; }
     }
 
-    public ILookupParameter<CombinedSolution> CombinedSolutionParameter {
-      get { return (ILookupParameter<CombinedSolution>)Parameters["CombinedSolution"]; }
+    public ILookupParameter<IEncoding<CombinedSolution>> EncodingParameter {
+      get { return (ILookupParameter<IEncoding<CombinedSolution>>)Parameters["Encoding"]; }
     }
 
     [StorableConstructor]
     protected MultiEncodingOperator(bool deserializing) : base(deserializing) { }
-    protected MultiEncodingOperator(MultiEncodingOperator<T> original, Cloner cloner)
-      : base(original, cloner) {
-      encoding = cloner.Clone(original.encoding);
-      RegisterEventHandlers();
-    }
+    protected MultiEncodingOperator(MultiEncodingOperator<T> original, Cloner cloner) : base(original, cloner) { }
     protected MultiEncodingOperator()
       : base() {
-      Parameters.Add(new LookupParameter<CombinedSolution>("CombinedSolution", "The combined solution that gets created."));
-    }
-
-    [StorableHook(HookType.AfterDeserialization)]
-    private void AfterDeserialization() {
-      RegisterEventHandlers();
-    }
-
-    private void RegisterEventHandlers() {
-      encoding.Encodings.ItemsAdded += EncodingsOnItemsChanged;
-      encoding.Encodings.CollectionReset += EncodingsOnItemsChanged;
-      encoding.Encodings.ItemsRemoved += EncodingsOnItemsRemoved;
-      foreach (var enc in encoding.Encodings)
-        enc.OperatorsChanged += Encoding_OperatorsChanged;
-    }
-
-    private void DeregisterEventHandlers() {
-      encoding.Encodings.ItemsAdded -= EncodingsOnItemsChanged;
-      encoding.Encodings.CollectionReset -= EncodingsOnItemsChanged;
-      encoding.Encodings.ItemsRemoved -= EncodingsOnItemsRemoved;
-      foreach (var enc in encoding.Encodings)
-        enc.OperatorsChanged -= Encoding_OperatorsChanged;
-    }
-
-    private void EncodingsOnItemsChanged(object sender, CollectionItemsChangedEventArgs<IEncoding> e) {
-      foreach (var enc in e.Items)
-        AddEncoding(enc);
-      foreach (var enc in e.OldItems)
-        RemoveEncoding(enc);
-    }
-
-    private void EncodingsOnItemsRemoved(object sender, CollectionItemsChangedEventArgs<IEncoding> e) {
-      foreach (var enc in e.Items)
-        RemoveEncoding(enc);
+      Parameters.Add(new LookupParameter<CombinedSolution>("Solution", "The solution that gets created."));
+      Parameters.Add(new LookupParameter<IEncoding<CombinedSolution>>("Encoding", "The encoding."));
     }
 
@@ -101,5 +53,5 @@
     }
 
-    protected virtual void AddEncoding(IEncoding encoding) {
+    public virtual void AddEncoding(IEncoding encoding) {
       if (Parameters.ContainsKey(encoding.Name)) throw new ArgumentException(string.Format("Encoding {0} was already added.", encoding.Name));
 
@@ -111,5 +63,5 @@
     }
 
-    protected virtual bool RemoveEncoding(IEncoding encoding) {
+    public virtual bool RemoveEncoding(IEncoding encoding) {
       if (!Parameters.ContainsKey(encoding.Name)) throw new ArgumentException(string.Format("Encoding {0} was not added to the MultiEncoding.", encoding.Name));
       encoding.OperatorsChanged -= Encoding_OperatorsChanged;
Index: /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Operators/ScopeUtil.cs
===================================================================
--- /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Operators/ScopeUtil.cs	(revision 13358)
+++ /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Operators/ScopeUtil.cs	(revision 13359)
@@ -23,4 +23,5 @@
 
 using System;
+using HeuristicLab.Common;
 using HeuristicLab.Core;
 
@@ -30,5 +31,9 @@
     public static TSolution CopySolutionToScope<TSolution>(IScope scope, IEncoding<TSolution> encoding, TSolution solution)
       where TSolution : class,ISolution {
-      var name = encoding.Name;
+      return CopySolutionToScope(scope, encoding.Name, solution);
+    }
+
+    public static TSolution CopySolutionToScope<TSolution>(IScope scope, string name, TSolution solution)
+      where TSolution : class,ISolution {
       var copy = (TSolution)solution.Clone();
       if (!scope.Variables.ContainsKey(name)) scope.Variables.Add(new Variable(name, copy));
@@ -42,14 +47,18 @@
       if (!scope.Variables.ContainsKey(name)) throw new ArgumentException(string.Format(" {0} cannot be found in the provided scope.", name));
       var value = scope.Variables[name].Value as TSolution;
-      if (value == null) throw new InvalidOperationException(string.Format("Value of {0} is null.", name));
+      if (value == null) throw new InvalidOperationException(string.Format("Value of {0} is null or not of type {1}.", name, typeof(TSolution).GetPrettyName()));
       return value;
     }
 
     public static ISolution GetSolution(IScope scope, IEncoding encoding) {
-      var name = encoding.Name;
-      if (!scope.Variables.ContainsKey(name)) throw new ArgumentException(string.Format(" {0} cannot be found in the provided scope.", name));
-      var value = scope.Variables[name].Value as ISolution;
-      if (value == null) throw new InvalidOperationException(string.Format("Value of {0} is null.", name));
-      return value;
+      return GetSolution(scope, encoding.Name);
+    }
+
+    public static ISolution GetSolution(IScope scope, string name) {
+      IVariable variable;
+      if (!scope.Variables.TryGetValue(name, out variable)) throw new ArgumentException(string.Format("{0} cannot be found in the provided scope.", name));
+      var solution = variable.Value as ISolution;
+      if (solution == null) throw new InvalidOperationException(string.Format("{0} is null or not of type ISolution.", name));
+      return solution;
     }
 
