Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/BinaryEncoding.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/BinaryEncoding.cs	(revision 11552)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/BinaryEncoding.cs	(revision 11553)
@@ -20,39 +20,144 @@
 #endregion
 
+using System;
+using System.Collections.Generic;
+using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
 using HeuristicLab.Data;
+using HeuristicLab.Encodings.BinaryVectorEncoding;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.PluginInfrastructure;
 
 namespace HeuristicLab.Problems.Programmable {
   [Item("BinaryEncoding", "Describes a binary vector encoding.")]
   [StorableClass]
-  public class BinaryEncoding : Encoding {
+  public sealed class BinaryEncoding : Encoding {
+    #region Encoding Parameters
     [Storable]
-    private IntValue length;
-    public IntValue Length {
-      get { return length; }
+    private IFixedValueParameter<IntValue> lengthParameter;
+    public IFixedValueParameter<IntValue> LengthParameter {
+      get { return lengthParameter; }
       set {
-        if (length == value) return;
-        length = value;
-        OnParameterConfigurationChanged();
+        if (value == null) throw new ArgumentNullException("Length parameter must not be null.");
+        if (lengthParameter == value) return;
+        lengthParameter = value;
+        OnLengthParameterChanged();
       }
+    }
+    public override IEnumerable<IValueParameter> Parameters {
+      get { return base.Parameters.Concat(new IValueParameter[] { LengthParameter }); }
+    }
+    #endregion
+
+    private List<IOperator> encodingOperators = new List<IOperator>();
+    [Storable]
+    public override IEnumerable<IOperator> Operators {
+      get { return encodingOperators; }
+      protected set { encodingOperators = new List<IOperator>(value); }
+    }
+
+    public override ISolutionCreator DefaultSolutionCreator {
+      get { return Operators.OfType<RandomBinaryVectorCreator>().First(); }
+    }
+
+    public int Length {
+      get { return LengthParameter.Value.Value; }
+      set { LengthParameter.Value.Value = value; }
     }
 
     [StorableConstructor]
-    protected BinaryEncoding(bool deserializing) : base(deserializing) { }
-    protected BinaryEncoding(BinaryEncoding original, Cloner cloner)
+    private BinaryEncoding(bool deserializing) : base(deserializing) { }
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      RegisterParameterEvents();
+      DiscoverOperators();
+    }
+    public override IDeepCloneable Clone(Cloner cloner) { return new BinaryEncoding(this, cloner); }
+    private BinaryEncoding(BinaryEncoding original, Cloner cloner)
       : base(original, cloner) {
-      length = cloner.Clone(original.length);
+      lengthParameter = cloner.Clone(original.lengthParameter);
+      encodingOperators = original.Operators.Select(cloner.Clone).ToList();
+      RegisterParameterEvents();
     }
     public BinaryEncoding(string name, int length)
       : base(name) {
-      this.length = new IntValue(length);
+      lengthParameter = new FixedValueParameter<IntValue>(Name + "Length", new IntValue(length));
     }
 
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new BinaryEncoding(this, cloner);
+    private void OnLengthParameterChanged() {
+      RegisterLengthParameterEvents();
+      ConfigureOperators(Operators);
+    }
+    private void RegisterParameterEvents() {
+      RegisterLengthParameterEvents();
+    }
+    private void RegisterLengthParameterEvents() {
+      LengthParameter.ValueChanged += (o, s) => ConfigureOperators(Operators);
+      LengthParameter.Value.ValueChanged += (o, s) => ConfigureOperators(Operators);
     }
 
+    #region Operator Discovery
+    private static readonly IEnumerable<Type> encodingSpecificOperatorTypes;
+    static BinaryEncoding() {
+      encodingSpecificOperatorTypes = new List<Type>() {
+        typeof (IBinaryVectorOperator),
+        typeof (IBinaryVectorCreator),
+        typeof (IBinaryVectorCrossover),
+        typeof (IBinaryVectorManipulator),
+        typeof (IBinaryVectorMoveOperator),
+        typeof (IBinaryVectorMultiNeighborhoodShakingOperator),
+      };
+    }
+    private void DiscoverOperators() {
+      var pluginDescription = ApplicationManager.Manager.GetDeclaringPlugin(typeof(IBinaryVectorOperator));
+      var discoveredTypes = ApplicationManager.Manager.GetTypes(encodingSpecificOperatorTypes, pluginDescription, true, false, false);
+      var operators = discoveredTypes.Select(t => (IOperator)Activator.CreateInstance(t));
+      var newOperators = operators.Except(encodingOperators, new TypeEqualityComparer<IOperator>()).ToList();
+
+      ConfigureOperators(newOperators);
+      encodingOperators.AddRange(newOperators);
+    }
+    #endregion
+
+    public void ConfigureOperators(IEnumerable<IOperator> operators) {
+      ConfigureCreators(operators.OfType<IBinaryVectorCreator>());
+      ConfigureCrossovers(operators.OfType<IBinaryVectorCrossover>());
+      ConfigureManipulators(operators.OfType<IBinaryVectorManipulator>());
+      ConfigureMoveOperators(operators.OfType<IBinaryVectorMoveOperator>());
+      ConfigureShakingOperators(operators.OfType<IBinaryVectorMultiNeighborhoodShakingOperator>());
+    }
+
+    #region Specific Operator Wiring
+    private void ConfigureCreators(IEnumerable<IBinaryVectorCreator> creators) {
+      foreach (var creator in creators) {
+        creator.BinaryVectorParameter.ActualName = Name;
+        creator.LengthParameter.ActualName = LengthParameter.Name;
+      }
+    }
+    private void ConfigureCrossovers(IEnumerable<IBinaryVectorCrossover> crossovers) {
+      foreach (var crossover in crossovers) {
+        crossover.ParentsParameter.ActualName = Name;
+        crossover.ChildParameter.ActualName = Name;
+      }
+    }
+    private void ConfigureManipulators(IEnumerable<IBinaryVectorManipulator> manipulators) {
+      foreach (var manipulator in manipulators) {
+        manipulator.BinaryVectorParameter.ActualName = Name;
+      }
+    }
+    private void ConfigureMoveOperators(IEnumerable<IBinaryVectorMoveOperator> moveOperators) {
+      foreach (var moveOperator in moveOperators) {
+        moveOperator.BinaryVectorParameter.ActualName = Name;
+      }
+    }
+    private void ConfigureShakingOperators(IEnumerable<IBinaryVectorMultiNeighborhoodShakingOperator> shakingOperators) {
+      foreach (var shakingOperator in shakingOperators) {
+        shakingOperator.BinaryVectorParameter.ActualName = Name;
+      }
+    }
+    #endregion
   }
 }
Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/Encoding.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/Encoding.cs	(revision 11552)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/Encoding.cs	(revision 11553)
@@ -25,4 +25,5 @@
 using HeuristicLab.Common;
 using HeuristicLab.Core;
+using HeuristicLab.Optimization;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
 
@@ -35,10 +36,4 @@
     }
 
-    [StorableConstructor]
-    protected Encoding(bool deserializing) : base(deserializing) { }
-    protected Encoding(Encoding original, Cloner cloner)
-      : base(original, cloner) { }
-    protected Encoding(string name) : base(name) { }
-
     public virtual IEnumerable<IValueParameter> Parameters {
       get { return Enumerable.Empty<IValueParameter>(); }
@@ -50,4 +45,14 @@
     }
 
+    public virtual ISolutionCreator DefaultSolutionCreator {
+      get { return null; }
+    }
+
+    [StorableConstructor]
+    protected Encoding(bool deserializing) : base(deserializing) { }
+    protected Encoding(Encoding original, Cloner cloner)
+      : base(original, cloner) { }
+    protected Encoding(string name) : base(name) { }
+
     public event EventHandler ParameterConfigurationChanged;
     protected virtual void OnParameterConfigurationChanged() {
Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/RealEncoding.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/RealEncoding.cs	(revision 11552)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/RealEncoding.cs	(revision 11553)
@@ -76,5 +76,5 @@
     }
 
-    public IRealVectorCreator DefaultSolutionCreator {
+    public override ISolutionCreator DefaultSolutionCreator {
       get { return Operators.OfType<UniformRandomRealVectorCreator>().First(); }
     }
@@ -166,4 +166,5 @@
     static RealEncoding() {
       encodingSpecificOperatorTypes = new List<Type>() {
+        typeof (IRealVectorOperator),
         typeof (IRealVectorCreator),
         typeof (IRealVectorCrossover),
Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Interfaces/IEncoding.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Interfaces/IEncoding.cs	(revision 11552)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Interfaces/IEncoding.cs	(revision 11553)
@@ -25,8 +25,10 @@
 using System.Text;
 using HeuristicLab.Core;
+using HeuristicLab.Optimization;
 
 namespace HeuristicLab.Problems.Programmable {
-  public interface IEncoding : INamedItem {
-
+  public interface IEncoding : INamedItem
+  {
+    ISolutionCreator DefaultSolutionCreator { get; }
     IEnumerable<IValueParameter> Parameters { get; }
     IEnumerable<IOperator> Operators { get; }
Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProgrammableProblem.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProgrammableProblem.cs	(revision 11552)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProgrammableProblem.cs	(revision 11553)
@@ -176,4 +176,18 @@
 
     protected virtual ISolutionCreator ConfigureCreator(IEncoding encoding) {
+      #region Configure RealVector Creator
+      var realEnc = encoding as RealEncoding;
+      if (realEnc != null) {
+        DynamicEncodingParameters.AddRange(realEnc.Parameters);
+        return realEnc.DefaultSolutionCreator;
+      }
+      #endregion
+      #region Configure BinaryVector Creator
+      var binEnc = encoding as BinaryEncoding;
+      if (binEnc != null) {
+        DynamicEncodingParameters.AddRange(binEnc.Parameters);
+        return binEnc.DefaultSolutionCreator;
+      }
+      #endregion
       #region Configure MultiEncoding Creator
       var multiEncoding = encoding as MultiEncoding;
@@ -184,16 +198,4 @@
           creator.Operators.Add(ConfigureCreator(enc));
         }
-        return creator;
-      }
-      #endregion
-      #region Configure BinaryVector Creator
-      var binEnc = encoding as BinaryEncoding;
-      if (binEnc != null) {
-        var p = new ValueParameter<IntValue>(binEnc.Name + "Length", binEnc.Length);
-        DynamicEncodingParameters.Add(p);
-
-        var creator = new RandomBinaryVectorCreator();
-        creator.BinaryVectorParameter.ActualName = binEnc.Name;
-        creator.LengthParameter.ActualName = p.Name;
         return creator;
       }
@@ -212,11 +214,4 @@
         creator.BoundsParameter.ActualName = b.Name;
         return creator;
-      }
-      #endregion
-      #region Configure RealVector Creator
-      var realEnc = encoding as RealEncoding;
-      if (realEnc != null) {
-        DynamicEncodingParameters.AddRange(realEnc.Parameters);
-        return realEnc.DefaultSolutionCreator;
       }
       #endregion
@@ -784,5 +779,5 @@
       var binConfig = (BinaryEncoding)config.Encodings[paramName];
       IBinaryVectorCrossover binXo;
-      if (binConfig.Length.Value > 3) binXo = new Encodings.BinaryVectorEncoding.SinglePointCrossover();
+      if (binConfig.Length > 3) binXo = new Encodings.BinaryVectorEncoding.SinglePointCrossover();
       else binXo = new Encodings.BinaryVectorEncoding.UniformCrossover();
       binXo.ChildParameter.ActualName = paramName;
Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProgrammableProblem.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProgrammableProblem.cs	(revision 11552)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProgrammableProblem.cs	(revision 11553)
@@ -76,5 +76,4 @@
     }
 
-
     [StorableConstructor]
     protected SingleObjectiveProgrammableProblem(bool deserializing) : base(deserializing) { }
@@ -193,4 +192,11 @@
         DynamicEncodingParameters.AddRange(realEnc.Parameters);
         return realEnc.DefaultSolutionCreator;
+      }
+      #endregion
+      #region Configure BinaryVector Creator
+      var binEnc = encoding as BinaryEncoding;
+      if (binEnc != null) {
+        DynamicEncodingParameters.AddRange(binEnc.Parameters);
+        return binEnc.DefaultSolutionCreator;
       }
       #endregion
@@ -206,16 +212,4 @@
       }
       #endregion
-      #region Configure BinaryVector Creator
-      var binEnc = encoding as BinaryEncoding;
-      if (binEnc != null) {
-        var p = new ValueParameter<IntValue>(binEnc.Name + "Length", binEnc.Length);
-        DynamicEncodingParameters.Add(p);
-
-        var creator = new RandomBinaryVectorCreator();
-        creator.BinaryVectorParameter.ActualName = binEnc.Name;
-        creator.LengthParameter.ActualName = p.Name;
-        return creator;
-      }
-      #endregion
       #region Configure IntegerVector Creator
       var intEnc = encoding as IntegerEncoding;
@@ -261,12 +255,9 @@
 
       #region Configure Operators for RealVectorEncoding
-      var realCreator = newCreator as IRealVectorCreator;
       var realEncoding = encoding as RealEncoding;
       if (realEncoding != null) {
         // do not replace a real vector creator that was manually set
         if (!(SolutionCreator is IRealVectorCreator)
-            ||
-            ((IRealVectorCreator)SolutionCreator).RealVectorParameter.ActualName !=
-            realCreator.RealVectorParameter.ActualName) {
+            || ((IRealVectorCreator)SolutionCreator).RealVectorParameter.ActualName != realEncoding.Name) {
           Operators.Remove(SolutionCreator);
           SolutionCreator = newCreator;
@@ -276,53 +267,14 @@
           su.MaximizationParameter.ActualName = MaximizationParameter.Name;
         }
-      } 
+      }
       #endregion
       #region Configure Operators for BinaryVectorEncoding
-      var binCreator = newCreator as IBinaryVectorCreator;
-      if (binCreator != null) {
-        var paramName = binCreator.BinaryVectorParameter.ActualName;
+      var binEncoding = encoding as BinaryEncoding;
+      if (binEncoding != null) {
         // do not replace a binary vector creator that was manually set
-        if (!(SolutionCreator is IBinaryVectorCreator) || ((IBinaryVectorCreator)SolutionCreator).BinaryVectorParameter.ActualName != paramName) {
+        if (!(SolutionCreator is IBinaryVectorCreator) || ((IBinaryVectorCreator)SolutionCreator).BinaryVectorParameter.ActualName != binEncoding.Name) {
           Operators.Remove(SolutionCreator);
           SolutionCreator = newCreator;
-          Operators.Add(SolutionCreator);
-        }
-
-        #region Wire BinaryVector Crossovers
-        var crossovers = Operators.OfType<IBinaryVectorCrossover>()
-          .Union(ApplicationManager.Manager.GetInstances<IBinaryVectorCrossover>(), new TypeEqualityComparer<IBinaryVectorCrossover>())
-          .ToList();
-        foreach (var xo in crossovers) {
-          xo.ChildParameter.ActualName = binCreator.BinaryVectorParameter.ActualName;
-          xo.ChildParameter.Hidden = true;
-          xo.ParentsParameter.ActualName = binCreator.BinaryVectorParameter.ActualName;
-          xo.ParentsParameter.Hidden = true;
-        }
-        Operators.AddRange(crossovers.Except(Operators.OfType<IBinaryVectorCrossover>()));
-        #endregion
-        #region Wire BinaryVector Manipulators
-        var manipulators = Operators.OfType<IBinaryVectorManipulator>()
-          .Union(ApplicationManager.Manager.GetInstances<IBinaryVectorManipulator>(), new TypeEqualityComparer<IBinaryVectorManipulator>())
-          .ToList();
-        foreach (var m in manipulators) {
-          m.BinaryVectorParameter.ActualName = binCreator.BinaryVectorParameter.ActualName;
-          m.BinaryVectorParameter.Hidden = true;
-        }
-        Operators.AddRange(manipulators.Except(Operators.OfType<IBinaryVectorManipulator>()));
-        #endregion
-        #region Wire BinaryVector ShakingOperators
-        var shakingOperators = Operators.OfType<IBinaryVectorMultiNeighborhoodShakingOperator>()
-          .Union(ApplicationManager.Manager.GetInstances<IBinaryVectorMultiNeighborhoodShakingOperator>(), new TypeEqualityComparer<IBinaryVectorMultiNeighborhoodShakingOperator>())
-          .ToList();
-        foreach (var so in shakingOperators) {
-          so.BinaryVectorParameter.ActualName = paramName;
-          so.BinaryVectorParameter.Hidden = true;
-        }
-        Operators.AddRange(shakingOperators.Except(Operators.OfType<IBinaryVectorMultiNeighborhoodShakingOperator>()));
-        #endregion
-      } else {
-        Operators.RemoveAll(x => x is IBinaryVectorCrossover
-          || x is IBinaryVectorManipulator
-          || x is IBinaryVectorMultiNeighborhoodShakingOperator);
+        }
       }
       #endregion
@@ -714,5 +666,5 @@
       var binConfig = (BinaryEncoding)config.Encodings[paramName];
       IBinaryVectorCrossover binXo;
-      if (binConfig.Length.Value > 3) binXo = new Encodings.BinaryVectorEncoding.SinglePointCrossover();
+      if (binConfig.Length > 3) binXo = new Encodings.BinaryVectorEncoding.SinglePointCrossover();
       else binXo = new Encodings.BinaryVectorEncoding.UniformCrossover();
       binXo.ChildParameter.ActualName = paramName;
