Index: /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/MultiEncoding.cs
===================================================================
--- /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/MultiEncoding.cs	(revision 13364)
+++ /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/MultiEncoding.cs	(revision 13365)
@@ -84,4 +84,8 @@
     }
 
+    public void Clear() {
+      foreach (var enc in encodings.ToList()) Remove(enc);
+    }
+
     public override void ConfigureOperators(IEnumerable<IOperator> operators) {
       foreach (var encOp in operators.OfType<IMultiEncodingOperator>())
Index: /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Problem.cs
===================================================================
--- /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Problem.cs	(revision 13364)
+++ /branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Problem.cs	(revision 13365)
@@ -41,4 +41,7 @@
     }
 
+    //mkommend necessary for reuse of operators if the encoding changes
+    private TEncoding oldEncoding;
+
     public TEncoding Encoding {
       get { return EncodingParameter.Value; }
@@ -64,4 +67,5 @@
       Parameters.Add(new ValueParameter<TEncoding>("Encoding", "Describes the configuration of the encoding, what the variables are called, what type they are and their bounds if any."));
       if (Encoding != null) {
+        oldEncoding = Encoding;
         SolutionCreator = Encoding.SolutionCreator;
         Parameterize();
@@ -72,4 +76,5 @@
     protected Problem(Problem<TEncoding, TSolution, TEvaluator> original, Cloner cloner)
       : base(original, cloner) {
+      oldEncoding = cloner.Clone(original.oldEncoding);
       RegisterEvents();
     }
@@ -79,4 +84,5 @@
     [StorableHook(HookType.AfterDeserialization)]
     private void AfterDeserialization() {
+      oldEncoding = Encoding;
       RegisterEvents();
     }
@@ -96,6 +102,16 @@
 
     private void Parameterize() {
+      if (oldEncoding != null) {
+        AdaptEncodingOperators(oldEncoding, Encoding);
+        //var oldMultiEncoding = oldEncoding as MultiEncoding;
+        //if (oldMultiEncoding != null)
+        //  oldMultiEncoding.EncodingsChanged -= MultiEncodingOnEncodingsChanged;
+      }
+      oldEncoding = Encoding;
+
       foreach (var op in Operators.OfType<IEncodingOperator<TSolution>>())
         op.EncodingParameter.ActualName = EncodingParameter.Name;
+
+      SolutionCreator = Encoding.SolutionCreator;
 
       //var multiEncoding = Encoding as MultiEncoding;
@@ -108,6 +124,29 @@
     }
 
-    protected virtual void MultiEncodingOnEncodingsChanged(object sender, EventArgs e) {
-      OnOperatorsChanged();
+    private static void AdaptEncodingOperators(IEncoding oldEncoding, IEncoding newEncoding) {
+      if (oldEncoding.GetType() != newEncoding.GetType()) return;
+
+      if (oldEncoding.GetType() == typeof(MultiEncoding)) {
+        var oldMultiEncoding = (MultiEncoding)oldEncoding;
+        var newMultiEncoding = (MultiEncoding)newEncoding;
+        if (!oldMultiEncoding.Encodings.SequenceEqual(newMultiEncoding.Encodings, new TypeEqualityComparer<IEncoding>())) return;
+
+        var nestedEncodings = oldMultiEncoding.Encodings.Zip(newMultiEncoding.Encodings, (o, n) => new { oldEnc = o, newEnc = n });
+        foreach (var multi in nestedEncodings)
+          AdaptEncodingOperators(multi.oldEnc, multi.newEnc);
+      }
+
+      var comparer = new TypeEqualityComparer<IOperator>();
+      var cloner = new Cloner();
+      var oldOperators = oldEncoding.Operators;
+      var newOperators = newEncoding.Operators;
+
+      cloner.RegisterClonedObject(oldEncoding, newEncoding);
+      var operators = oldOperators.Intersect(newOperators, comparer)
+                                  .Select(cloner.Clone)
+                                  .Union(newOperators, comparer).ToList();
+
+      newEncoding.ConfigureOperators(operators);
+      newEncoding.Operators = operators;
     }
   }
Index: /branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProgrammableProblem.cs
===================================================================
--- /branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProgrammableProblem.cs	(revision 13364)
+++ /branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProgrammableProblem.cs	(revision 13365)
@@ -71,5 +71,6 @@
       : base() {
       Parameters.Add(new FixedValueParameter<MultiObjectiveProblemDefinitionScript<TEncoding, TSolution>>("ProblemScript", "Defines the problem.",
-        new MultiObjectiveProblemDefinitionScript<TEncoding, TSolution>() { Name = Name, Encoding = Encoding }));
+        new MultiObjectiveProblemDefinitionScript<TEncoding, TSolution>() { Name = Name }));
+      ProblemScript.Encoding = Encoding = (TEncoding)Encoding.Clone();
       RegisterEvents();
     }
@@ -87,6 +88,9 @@
       Parameters.Remove("Maximization");
       Parameters.Add(new ValueParameter<BoolArray>("Maximization", "Set to false if the problem should be minimized.", (BoolArray)new BoolArray(Maximization).AsReadOnly()) { Hidden = true });
+      var multiEnc = ProblemScript.Encoding as MultiEncoding;
+      if (multiEnc != null) multiEnc.Clear();
+      ProblemScript.Initialize();
+      Encoding = (TEncoding)ProblemScript.Encoding.Clone();
 
-      ProblemScript.Initialize();
       OnOperatorsChanged();
       OnReset();
Index: /branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProgrammableProblem.cs
===================================================================
--- /branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProgrammableProblem.cs	(revision 13364)
+++ /branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProgrammableProblem.cs	(revision 13365)
@@ -73,5 +73,6 @@
       : base() {
       Parameters.Add(new FixedValueParameter<SingleObjectiveProblemDefinitionScript<TEncoding, TSolution>>("ProblemScript", "Defines the problem.",
-        new SingleObjectiveProblemDefinitionScript<TEncoding, TSolution>() { Name = Name, Encoding = Encoding }));
+        new SingleObjectiveProblemDefinitionScript<TEncoding, TSolution>() { Name = Name }));
+      ProblemScript.Encoding = Encoding = (TEncoding)Encoding.Clone();
       Operators.Add(new BestScopeSolutionAnalyzer());
       RegisterEvents();
@@ -90,5 +91,8 @@
       Parameters.Remove("Maximization");
       Parameters.Add(new FixedValueParameter<BoolValue>("Maximization", "Set to false if the problem should be minimized.", (BoolValue)new BoolValue(Maximization).AsReadOnly()) { Hidden = true });
+      var multiEnc = ProblemScript.Encoding as MultiEncoding;
+      if (multiEnc != null) multiEnc.Clear();
       ProblemScript.Initialize();
+      Encoding = (TEncoding)ProblemScript.Encoding.Clone();
 
       OnOperatorsChanged();
