Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable.Views/3.3/ProblemDefinitionScriptView.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable.Views/3.3/ProblemDefinitionScriptView.cs	(revision 11884)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable.Views/3.3/ProblemDefinitionScriptView.cs	(revision 11885)
@@ -20,4 +20,6 @@
 #endregion
 
+using System;
+using System.Drawing;
 using HeuristicLab.MainForm;
 using HeuristicLab.Scripting.Views;
@@ -46,4 +48,14 @@
       variableStoreView.Enabled = Content != null && !Locked && !ReadOnly;
     }
+
+    public override bool Compile() {
+      try {
+        base.Compile();
+      } catch (ProblemDefinitionScriptException e) {
+        PluginInfrastructure.ErrorHandling.ShowErrorDialog(e);
+        return false;
+      }
+      return true;
+    }
   }
 }
Index: anches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/BinaryEncoding.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/BinaryEncoding.cs	(revision 11884)
+++ 	(revision )
@@ -1,166 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#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.Parameters;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.PluginInfrastructure;
-
-namespace HeuristicLab.Problems.Programmable {
-  [Item("BinaryEncoding", "Describes a binary vector encoding.")]
-  [StorableClass]
-  public sealed class BinaryEncoding : Encoding<IBinaryVectorCreator> {
-    #region Encoding Parameters
-    [Storable]
-    private IFixedValueParameter<IntValue> lengthParameter;
-    public IFixedValueParameter<IntValue> LengthParameter {
-      get { return lengthParameter; }
-      set {
-        if (value == null) throw new ArgumentNullException("Length parameter must not be null.");
-        if (value.Value == null) throw new ArgumentNullException("Length parameter value must not be null.");
-        if (lengthParameter == value) return;
-
-        if (lengthParameter != null) Parameters.Remove(lengthParameter);
-        lengthParameter = value;
-        Parameters.Add(lengthParameter);
-        OnLengthParameterChanged();
-      }
-    }
-    #endregion
-
-    public int Length {
-      get { return LengthParameter.Value.Value; }
-      set { LengthParameter.Value.Value = value; }
-    }
-
-    [StorableConstructor]
-    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) {
-      lengthParameter = cloner.Clone(original.lengthParameter);
-      RegisterParameterEvents();
-    }
-
-    public BinaryEncoding() : this("BinaryVector", 10) { }
-    public BinaryEncoding(int length) : this("BinaryVector", length) { }
-    public BinaryEncoding(string name, int length)
-      : base(name) {
-      lengthParameter = new FixedValueParameter<IntValue>(Name + ".Length", new IntValue(length));
-      Parameters.Add(lengthParameter);
-
-      SolutionCreator = new RandomBinaryVectorCreator();
-      RegisterParameterEvents();
-      DiscoverOperators();
-    }
-
-    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 assembly = typeof(IBinaryVectorOperator).Assembly;
-      var discoveredTypes = ApplicationManager.Manager.GetTypes(encodingSpecificOperatorTypes, assembly, true, false, false);
-      var operators = discoveredTypes.Select(t => (IOperator)Activator.CreateInstance(t));
-      var newOperators = operators.Except(Operators, new TypeEqualityComparer<IOperator>()).ToList();
-
-      ConfigureOperators(newOperators);
-      foreach (var @operator in newOperators)
-        encodingOperators.Add(@operator);
-    }
-    #endregion
-
-    public override void ConfigureOperators(IEnumerable<IOperator> operators) {
-      ConfigureCreators(operators.OfType<IBinaryVectorCreator>());
-      ConfigureCrossovers(operators.OfType<IBinaryVectorCrossover>());
-      ConfigureManipulators(operators.OfType<IBinaryVectorManipulator>());
-      ConfigureMoveOperators(operators.OfType<IBinaryVectorMoveOperator>());
-      ConfigureBitFlipMoveOperators(operators.OfType<IOneBitflipMoveOperator>());
-      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 ConfigureBitFlipMoveOperators(IEnumerable<IOneBitflipMoveOperator> oneBitflipMoveOperators) {
-      foreach (var oneBitFlipMoveOperator in oneBitflipMoveOperators) {
-        oneBitFlipMoveOperator.OneBitflipMoveParameter.ActualName = Name + "_OneBitFlipMove";
-      }
-    }
-    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/BinaryVectorEncoding.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/BinaryVectorEncoding.cs	(revision 11885)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/BinaryVectorEncoding.cs	(revision 11885)
@@ -0,0 +1,166 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#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.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Problems.Programmable {
+  [Item("BinaryVectorEncoding", "Describes a binary vector encoding.")]
+  [StorableClass]
+  public sealed class BinaryVectorEncoding : Encoding<IBinaryVectorCreator> {
+    #region Encoding Parameters
+    [Storable]
+    private IFixedValueParameter<IntValue> lengthParameter;
+    public IFixedValueParameter<IntValue> LengthParameter {
+      get { return lengthParameter; }
+      set {
+        if (value == null) throw new ArgumentNullException("Length parameter must not be null.");
+        if (value.Value == null) throw new ArgumentNullException("Length parameter value must not be null.");
+        if (lengthParameter == value) return;
+
+        if (lengthParameter != null) Parameters.Remove(lengthParameter);
+        lengthParameter = value;
+        Parameters.Add(lengthParameter);
+        OnLengthParameterChanged();
+      }
+    }
+    #endregion
+
+    public int Length {
+      get { return LengthParameter.Value.Value; }
+      set { LengthParameter.Value.Value = value; }
+    }
+
+    [StorableConstructor]
+    private BinaryVectorEncoding(bool deserializing) : base(deserializing) { }
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      RegisterParameterEvents();
+      DiscoverOperators();
+    }
+    public override IDeepCloneable Clone(Cloner cloner) { return new BinaryVectorEncoding(this, cloner); }
+    private BinaryVectorEncoding(BinaryVectorEncoding original, Cloner cloner)
+      : base(original, cloner) {
+      lengthParameter = cloner.Clone(original.lengthParameter);
+      RegisterParameterEvents();
+    }
+
+    public BinaryVectorEncoding() : this("BinaryVector", 10) { }
+    public BinaryVectorEncoding(int length) : this("BinaryVector", length) { }
+    public BinaryVectorEncoding(string name, int length)
+      : base(name) {
+      lengthParameter = new FixedValueParameter<IntValue>(Name + ".Length", new IntValue(length));
+      Parameters.Add(lengthParameter);
+
+      SolutionCreator = new RandomBinaryVectorCreator();
+      RegisterParameterEvents();
+      DiscoverOperators();
+    }
+
+    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 BinaryVectorEncoding() {
+      encodingSpecificOperatorTypes = new List<Type>() {
+        typeof (IBinaryVectorOperator),
+        typeof (IBinaryVectorCreator),
+        typeof (IBinaryVectorCrossover),
+        typeof (IBinaryVectorManipulator),
+        typeof (IBinaryVectorMoveOperator),
+        typeof (IBinaryVectorMultiNeighborhoodShakingOperator),
+      };
+    }
+    private void DiscoverOperators() {
+      var assembly = typeof(IBinaryVectorOperator).Assembly;
+      var discoveredTypes = ApplicationManager.Manager.GetTypes(encodingSpecificOperatorTypes, assembly, true, false, false);
+      var operators = discoveredTypes.Select(t => (IOperator)Activator.CreateInstance(t));
+      var newOperators = operators.Except(Operators, new TypeEqualityComparer<IOperator>()).ToList();
+
+      ConfigureOperators(newOperators);
+      foreach (var @operator in newOperators)
+        encodingOperators.Add(@operator);
+    }
+    #endregion
+
+    public override void ConfigureOperators(IEnumerable<IOperator> operators) {
+      ConfigureCreators(operators.OfType<IBinaryVectorCreator>());
+      ConfigureCrossovers(operators.OfType<IBinaryVectorCrossover>());
+      ConfigureManipulators(operators.OfType<IBinaryVectorManipulator>());
+      ConfigureMoveOperators(operators.OfType<IBinaryVectorMoveOperator>());
+      ConfigureBitFlipMoveOperators(operators.OfType<IOneBitflipMoveOperator>());
+      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 ConfigureBitFlipMoveOperators(IEnumerable<IOneBitflipMoveOperator> oneBitflipMoveOperators) {
+      foreach (var oneBitFlipMoveOperator in oneBitflipMoveOperators) {
+        oneBitFlipMoveOperator.OneBitflipMoveParameter.ActualName = Name + "_OneBitFlipMove";
+      }
+    }
+    private void ConfigureShakingOperators(IEnumerable<IBinaryVectorMultiNeighborhoodShakingOperator> shakingOperators) {
+      foreach (var shakingOperator in shakingOperators) {
+        shakingOperator.BinaryVectorParameter.ActualName = Name;
+      }
+    }
+    #endregion
+  }
+}
Index: anches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/IntegerEncoding.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/IntegerEncoding.cs	(revision 11884)
+++ 	(revision )
@@ -1,271 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Encodings.IntegerVectorEncoding;
-using HeuristicLab.Optimization;
-using HeuristicLab.Parameters;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.PluginInfrastructure;
-
-namespace HeuristicLab.Problems.Programmable {
-  [Item("IntegerEncoding", "Describes an integer vector encoding.")]
-  [StorableClass]
-  public sealed class IntegerEncoding : Encoding<IIntegerVectorCreator> {
-    #region Encoding Parameters
-    [Storable]
-    private IFixedValueParameter<IntValue> lengthParameter;
-    public IFixedValueParameter<IntValue> LengthParameter {
-      get { return lengthParameter; }
-      set {
-        if (value == null) throw new ArgumentNullException("Length parameter must not be null.");
-        if (value.Value == null) throw new ArgumentNullException("Length parameter value must not be null.");
-        if (lengthParameter == value) return;
-
-        if (lengthParameter != null) Parameters.Remove(lengthParameter);
-        lengthParameter = value;
-        Parameters.Add(lengthParameter);
-        OnLengthParameterChanged();
-      }
-    }
-
-    [Storable]
-    private IValueParameter<IntMatrix> boundsParameter;
-    public IValueParameter<IntMatrix> BoundsParameter {
-      get { return boundsParameter; }
-      set {
-        if (value == null) throw new ArgumentNullException("Bounds parameter must not be null.");
-        if (boundsParameter == value) return;
-
-        if (boundsParameter != null) Parameters.Remove(boundsParameter);
-        boundsParameter = value;
-        Parameters.Add(boundsParameter);
-        OnBoundsParameterChanged();
-      }
-    }
-    #endregion
-
-    public int Length {
-      get { return LengthParameter.Value.Value; }
-      set { LengthParameter.Value.Value = value; }
-    }
-    public IntMatrix Bounds {
-      get { return BoundsParameter.Value; }
-      set { BoundsParameter.Value = value; }
-    }
-
-    [StorableConstructor]
-    private IntegerEncoding(bool deserializing) : base(deserializing) { }
-    [StorableHook(HookType.AfterDeserialization)]
-    private void AfterDeserialization() {
-      RegisterParameterEvents();
-      DiscoverOperators();
-    }
-
-    private IntegerEncoding(IntegerEncoding original, Cloner cloner)
-      : base(original, cloner) {
-      lengthParameter = cloner.Clone(original.lengthParameter);
-      boundsParameter = cloner.Clone(original.boundsParameter);
-      RegisterParameterEvents();
-    }
-    public override IDeepCloneable Clone(Cloner cloner) { return new IntegerEncoding(this, cloner); }
-
-
-    public IntegerEncoding() : this("IntegerVector", 10) { }
-    public IntegerEncoding(int length) : this("integerVector", length) { }
-    public IntegerEncoding(string name, int length, int min = int.MinValue, int max = int.MaxValue, int? step = null)
-      : base(name) {
-      if (min >= max) throw new ArgumentException("min must be less than max", "min");
-      if (step.HasValue && step.Value <= 0) throw new ArgumentException("step must be greater than zero or null", "step");
-
-      var bounds = new IntMatrix(1, step.HasValue ? 3 : 2);
-      bounds[0, 0] = min;
-      bounds[0, 1] = max;
-      if (step.HasValue) bounds[0, 2] = step.Value;
-
-      lengthParameter = new FixedValueParameter<IntValue>(Name + ".Length", new IntValue(length));
-      boundsParameter = new ValueParameter<IntMatrix>(Name + ".Bounds", bounds);
-      Parameters.Add(lengthParameter);
-      Parameters.Add(boundsParameter);
-
-      SolutionCreator = new UniformRandomIntegerVectorCreator();
-      RegisterParameterEvents();
-      DiscoverOperators();
-    }
-    public IntegerEncoding(string name, int length, IList<int> min, IList<int> max, IList<int> step = null)
-      : base(name) {
-      if (min.Count == 0) throw new ArgumentException("Bounds must be given for the integer parameters.");
-      if (min.Count != max.Count) throw new ArgumentException("min must be of the same length as max", "min");
-      if (step != null && min.Count != step.Count) throw new ArgumentException("step must be of the same length as min or null", "step");
-      if (min.Zip(max, (mi, ma) => mi >= ma).Any(x => x)) throw new ArgumentException("min must be less than max in each dimension", "min");
-
-      var bounds = new IntMatrix(min.Count, step != null ? 3 : 2);
-      for (int i = 0; i < min.Count; i++) {
-        bounds[i, 0] = min[i];
-        bounds[i, 1] = max[i];
-        if (step != null) bounds[i, 2] = step[i];
-      }
-
-      LengthParameter = new FixedValueParameter<IntValue>(Name + ".Length", new IntValue(length));
-      BoundsParameter = new ValueParameter<IntMatrix>(Name + ".Bounds", bounds);
-
-      SolutionCreator = new UniformRandomIntegerVectorCreator();
-      RegisterParameterEvents();
-      DiscoverOperators();
-    }
-
-    private void OnLengthParameterChanged() {
-      RegisterLengthParameterEvents();
-      ConfigureOperators(Operators);
-    }
-    private void OnBoundsParameterChanged() {
-      RegisterBoundsParameterEvents();
-      ConfigureOperators(Operators);
-    }
-
-    private void RegisterParameterEvents() {
-      RegisterLengthParameterEvents();
-      RegisterBoundsParameterEvents();
-    }
-    private void RegisterLengthParameterEvents() {
-      LengthParameter.ValueChanged += (o, s) => ConfigureOperators(Operators);
-      LengthParameter.Value.ValueChanged += (o, s) => ConfigureOperators(Operators);
-    }
-    private void RegisterBoundsParameterEvents() {
-      BoundsParameter.ValueChanged += (o, s) => ConfigureOperators(Operators);
-      boundsParameter.Value.ToStringChanged += (o, s) => ConfigureOperators(Operators);
-    }
-
-
-    #region Operator Discovery
-    private static readonly IEnumerable<Type> encodingSpecificOperatorTypes;
-    static IntegerEncoding() {
-      encodingSpecificOperatorTypes = new List<Type>() {
-        typeof (IIntegerVectorOperator),
-        typeof (IIntegerVectorCreator),
-        typeof (IIntegerVectorCrossover),
-        typeof (IIntegerVectorManipulator),
-        typeof (IIntegerVectorStdDevStrategyParameterOperator),
-        typeof (IIntegerVectorMultiNeighborhoodShakingOperator),
-      };
-    }
-    private void DiscoverOperators() {
-      var assembly = typeof(IIntegerVectorOperator).Assembly;
-      var discoveredTypes = ApplicationManager.Manager.GetTypes(encodingSpecificOperatorTypes, assembly, true, false, false);
-      var operators = discoveredTypes.Select(t => (IOperator)Activator.CreateInstance(t));
-      var newOperators = operators.Except(Operators, new TypeEqualityComparer<IOperator>()).ToList();
-
-      ConfigureOperators(newOperators);
-      foreach (var @operator in newOperators)
-        encodingOperators.Add(@operator);
-    }
-    #endregion
-
-    public override void ConfigureOperators(IEnumerable<IOperator> operators) {
-      ConfigureBoundedOperators(operators.OfType<IBoundedIntegerVectorOperator>());
-      ConfigureCreators(operators.OfType<IIntegerVectorCreator>());
-      ConfigureCrossovers(operators.OfType<IIntegerVectorCrossover>());
-      ConfigureManipulators(operators.OfType<IIntegerVectorManipulator>());
-      ConfigureShakingOperators(operators.OfType<IIntegerVectorMultiNeighborhoodShakingOperator>());
-      ConfigureStrategyVectorOperator(operators.OfType<IIntegerVectorStdDevStrategyParameterOperator>());
-    }
-
-    #region Specific Operator Wiring
-    private void ConfigureBoundedOperators(IEnumerable<IBoundedIntegerVectorOperator> boundedOperators) {
-      foreach (var boundedOperator in boundedOperators) {
-        boundedOperator.BoundsParameter.ActualName = BoundsParameter.Name;
-      }
-    }
-
-    private void ConfigureCreators(IEnumerable<IIntegerVectorCreator> creators) {
-      foreach (var creator in creators) {
-        creator.IntegerVectorParameter.ActualName = Name;
-        creator.BoundsParameter.ActualName = BoundsParameter.Name;
-        creator.LengthParameter.ActualName = LengthParameter.Name;
-      }
-    }
-
-    private void ConfigureCrossovers(IEnumerable<IIntegerVectorCrossover> crossovers) {
-      foreach (var crossover in crossovers) {
-        crossover.ChildParameter.ActualName = Name;
-        crossover.ParentsParameter.ActualName = Name;
-      }
-    }
-
-    private void ConfigureManipulators(IEnumerable<IIntegerVectorManipulator> manipulators) {
-      foreach (var manipulator in manipulators) {
-        manipulator.IntegerVectorParameter.ActualName = Name;
-        manipulator.IntegerVectorParameter.Hidden = true;
-        var sm = manipulator as ISelfAdaptiveManipulator;
-        if (sm != null) {
-          var p = sm.StrategyParameterParameter as ILookupParameter;
-          if (p != null) {
-            p.ActualName = Name + "Strategy";
-          }
-        }
-      }
-    }
-
-    private void ConfigureShakingOperators(IEnumerable<IIntegerVectorMultiNeighborhoodShakingOperator> shakingOperators) {
-      foreach (var shakingOperator in shakingOperators) {
-        shakingOperator.IntegerVectorParameter.ActualName = Name;
-      }
-    }
-
-    private void ConfigureStrategyVectorOperator(IEnumerable<IIntegerVectorStdDevStrategyParameterOperator> strategyVectorOperators) {
-      var bounds = new DoubleMatrix(Bounds.Rows, Bounds.Columns);
-      for (var i = 0; i < bounds.Rows; i++) {
-        bounds[i, 1] = (int)Math.Ceiling(0.33 * (Bounds[i, 1] - Bounds[i, 0]));
-        bounds[i, 0] = 0;
-        if (bounds.Columns > 2) bounds[i, 2] = Bounds[i, 2];
-      }
-      foreach (var s in strategyVectorOperators) {
-        var c = s as IIntegerVectorStdDevStrategyParameterCreator;
-        if (c != null) {
-          c.BoundsParameter.Value = (DoubleMatrix)bounds.Clone();
-          c.LengthParameter.ActualName = Name;
-          c.StrategyParameterParameter.ActualName = Name + "Strategy";
-        }
-        var m = s as IIntegerVectorStdDevStrategyParameterManipulator;
-        if (m != null) {
-          m.BoundsParameter.Value = (DoubleMatrix)bounds.Clone();
-          m.StrategyParameterParameter.ActualName = Name + "Strategy";
-        }
-        var mm = s as StdDevStrategyVectorManipulator;
-        if (mm != null) {
-          mm.GeneralLearningRateParameter.Value = new DoubleValue(1.0 / Math.Sqrt(2 * Length));
-          mm.LearningRateParameter.Value = new DoubleValue(1.0 / Math.Sqrt(2 * Math.Sqrt(Length)));
-        }
-        var x = s as IIntegerVectorStdDevStrategyParameterCrossover;
-        if (x != null) {
-          x.ParentsParameter.ActualName = Name + "Strategy";
-          x.StrategyParameterParameter.ActualName = Name + "Strategy";
-        }
-      }
-    }
-    #endregion
-  }
-}
Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/IntegerVectorEncoding.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/IntegerVectorEncoding.cs	(revision 11885)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/IntegerVectorEncoding.cs	(revision 11885)
@@ -0,0 +1,271 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.IntegerVectorEncoding;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Problems.Programmable {
+  [Item("IntegerVectorEncoding", "Describes an integer vector encoding.")]
+  [StorableClass]
+  public sealed class IntegerVectorEncoding : Encoding<IIntegerVectorCreator> {
+    #region Encoding Parameters
+    [Storable]
+    private IFixedValueParameter<IntValue> lengthParameter;
+    public IFixedValueParameter<IntValue> LengthParameter {
+      get { return lengthParameter; }
+      set {
+        if (value == null) throw new ArgumentNullException("Length parameter must not be null.");
+        if (value.Value == null) throw new ArgumentNullException("Length parameter value must not be null.");
+        if (lengthParameter == value) return;
+
+        if (lengthParameter != null) Parameters.Remove(lengthParameter);
+        lengthParameter = value;
+        Parameters.Add(lengthParameter);
+        OnLengthParameterChanged();
+      }
+    }
+
+    [Storable]
+    private IValueParameter<IntMatrix> boundsParameter;
+    public IValueParameter<IntMatrix> BoundsParameter {
+      get { return boundsParameter; }
+      set {
+        if (value == null) throw new ArgumentNullException("Bounds parameter must not be null.");
+        if (boundsParameter == value) return;
+
+        if (boundsParameter != null) Parameters.Remove(boundsParameter);
+        boundsParameter = value;
+        Parameters.Add(boundsParameter);
+        OnBoundsParameterChanged();
+      }
+    }
+    #endregion
+
+    public int Length {
+      get { return LengthParameter.Value.Value; }
+      set { LengthParameter.Value.Value = value; }
+    }
+    public IntMatrix Bounds {
+      get { return BoundsParameter.Value; }
+      set { BoundsParameter.Value = value; }
+    }
+
+    [StorableConstructor]
+    private IntegerVectorEncoding(bool deserializing) : base(deserializing) { }
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      RegisterParameterEvents();
+      DiscoverOperators();
+    }
+
+    private IntegerVectorEncoding(IntegerVectorEncoding original, Cloner cloner)
+      : base(original, cloner) {
+      lengthParameter = cloner.Clone(original.lengthParameter);
+      boundsParameter = cloner.Clone(original.boundsParameter);
+      RegisterParameterEvents();
+    }
+    public override IDeepCloneable Clone(Cloner cloner) { return new IntegerVectorEncoding(this, cloner); }
+
+
+    public IntegerVectorEncoding() : this("IntegerVector", 10) { }
+    public IntegerVectorEncoding(int length) : this("integerVector", length) { }
+    public IntegerVectorEncoding(string name, int length, int min = int.MinValue, int max = int.MaxValue, int? step = null)
+      : base(name) {
+      if (min >= max) throw new ArgumentException("min must be less than max", "min");
+      if (step.HasValue && step.Value <= 0) throw new ArgumentException("step must be greater than zero or null", "step");
+
+      var bounds = new IntMatrix(1, step.HasValue ? 3 : 2);
+      bounds[0, 0] = min;
+      bounds[0, 1] = max;
+      if (step.HasValue) bounds[0, 2] = step.Value;
+
+      lengthParameter = new FixedValueParameter<IntValue>(Name + ".Length", new IntValue(length));
+      boundsParameter = new ValueParameter<IntMatrix>(Name + ".Bounds", bounds);
+      Parameters.Add(lengthParameter);
+      Parameters.Add(boundsParameter);
+
+      SolutionCreator = new UniformRandomIntegerVectorCreator();
+      RegisterParameterEvents();
+      DiscoverOperators();
+    }
+    public IntegerVectorEncoding(string name, int length, IList<int> min, IList<int> max, IList<int> step = null)
+      : base(name) {
+      if (min.Count == 0) throw new ArgumentException("Bounds must be given for the integer parameters.");
+      if (min.Count != max.Count) throw new ArgumentException("min must be of the same length as max", "min");
+      if (step != null && min.Count != step.Count) throw new ArgumentException("step must be of the same length as min or null", "step");
+      if (min.Zip(max, (mi, ma) => mi >= ma).Any(x => x)) throw new ArgumentException("min must be less than max in each dimension", "min");
+
+      var bounds = new IntMatrix(min.Count, step != null ? 3 : 2);
+      for (int i = 0; i < min.Count; i++) {
+        bounds[i, 0] = min[i];
+        bounds[i, 1] = max[i];
+        if (step != null) bounds[i, 2] = step[i];
+      }
+
+      LengthParameter = new FixedValueParameter<IntValue>(Name + ".Length", new IntValue(length));
+      BoundsParameter = new ValueParameter<IntMatrix>(Name + ".Bounds", bounds);
+
+      SolutionCreator = new UniformRandomIntegerVectorCreator();
+      RegisterParameterEvents();
+      DiscoverOperators();
+    }
+
+    private void OnLengthParameterChanged() {
+      RegisterLengthParameterEvents();
+      ConfigureOperators(Operators);
+    }
+    private void OnBoundsParameterChanged() {
+      RegisterBoundsParameterEvents();
+      ConfigureOperators(Operators);
+    }
+
+    private void RegisterParameterEvents() {
+      RegisterLengthParameterEvents();
+      RegisterBoundsParameterEvents();
+    }
+    private void RegisterLengthParameterEvents() {
+      LengthParameter.ValueChanged += (o, s) => ConfigureOperators(Operators);
+      LengthParameter.Value.ValueChanged += (o, s) => ConfigureOperators(Operators);
+    }
+    private void RegisterBoundsParameterEvents() {
+      BoundsParameter.ValueChanged += (o, s) => ConfigureOperators(Operators);
+      boundsParameter.Value.ToStringChanged += (o, s) => ConfigureOperators(Operators);
+    }
+
+
+    #region Operator Discovery
+    private static readonly IEnumerable<Type> encodingSpecificOperatorTypes;
+    static IntegerVectorEncoding() {
+      encodingSpecificOperatorTypes = new List<Type>() {
+        typeof (IIntegerVectorOperator),
+        typeof (IIntegerVectorCreator),
+        typeof (IIntegerVectorCrossover),
+        typeof (IIntegerVectorManipulator),
+        typeof (IIntegerVectorStdDevStrategyParameterOperator),
+        typeof (IIntegerVectorMultiNeighborhoodShakingOperator),
+      };
+    }
+    private void DiscoverOperators() {
+      var assembly = typeof(IIntegerVectorOperator).Assembly;
+      var discoveredTypes = ApplicationManager.Manager.GetTypes(encodingSpecificOperatorTypes, assembly, true, false, false);
+      var operators = discoveredTypes.Select(t => (IOperator)Activator.CreateInstance(t));
+      var newOperators = operators.Except(Operators, new TypeEqualityComparer<IOperator>()).ToList();
+
+      ConfigureOperators(newOperators);
+      foreach (var @operator in newOperators)
+        encodingOperators.Add(@operator);
+    }
+    #endregion
+
+    public override void ConfigureOperators(IEnumerable<IOperator> operators) {
+      ConfigureBoundedOperators(operators.OfType<IBoundedIntegerVectorOperator>());
+      ConfigureCreators(operators.OfType<IIntegerVectorCreator>());
+      ConfigureCrossovers(operators.OfType<IIntegerVectorCrossover>());
+      ConfigureManipulators(operators.OfType<IIntegerVectorManipulator>());
+      ConfigureShakingOperators(operators.OfType<IIntegerVectorMultiNeighborhoodShakingOperator>());
+      ConfigureStrategyVectorOperator(operators.OfType<IIntegerVectorStdDevStrategyParameterOperator>());
+    }
+
+    #region Specific Operator Wiring
+    private void ConfigureBoundedOperators(IEnumerable<IBoundedIntegerVectorOperator> boundedOperators) {
+      foreach (var boundedOperator in boundedOperators) {
+        boundedOperator.BoundsParameter.ActualName = BoundsParameter.Name;
+      }
+    }
+
+    private void ConfigureCreators(IEnumerable<IIntegerVectorCreator> creators) {
+      foreach (var creator in creators) {
+        creator.IntegerVectorParameter.ActualName = Name;
+        creator.BoundsParameter.ActualName = BoundsParameter.Name;
+        creator.LengthParameter.ActualName = LengthParameter.Name;
+      }
+    }
+
+    private void ConfigureCrossovers(IEnumerable<IIntegerVectorCrossover> crossovers) {
+      foreach (var crossover in crossovers) {
+        crossover.ChildParameter.ActualName = Name;
+        crossover.ParentsParameter.ActualName = Name;
+      }
+    }
+
+    private void ConfigureManipulators(IEnumerable<IIntegerVectorManipulator> manipulators) {
+      foreach (var manipulator in manipulators) {
+        manipulator.IntegerVectorParameter.ActualName = Name;
+        manipulator.IntegerVectorParameter.Hidden = true;
+        var sm = manipulator as ISelfAdaptiveManipulator;
+        if (sm != null) {
+          var p = sm.StrategyParameterParameter as ILookupParameter;
+          if (p != null) {
+            p.ActualName = Name + "Strategy";
+          }
+        }
+      }
+    }
+
+    private void ConfigureShakingOperators(IEnumerable<IIntegerVectorMultiNeighborhoodShakingOperator> shakingOperators) {
+      foreach (var shakingOperator in shakingOperators) {
+        shakingOperator.IntegerVectorParameter.ActualName = Name;
+      }
+    }
+
+    private void ConfigureStrategyVectorOperator(IEnumerable<IIntegerVectorStdDevStrategyParameterOperator> strategyVectorOperators) {
+      var bounds = new DoubleMatrix(Bounds.Rows, Bounds.Columns);
+      for (var i = 0; i < bounds.Rows; i++) {
+        bounds[i, 1] = (int)Math.Ceiling(0.33 * (Bounds[i, 1] - Bounds[i, 0]));
+        bounds[i, 0] = 0;
+        if (bounds.Columns > 2) bounds[i, 2] = Bounds[i, 2];
+      }
+      foreach (var s in strategyVectorOperators) {
+        var c = s as IIntegerVectorStdDevStrategyParameterCreator;
+        if (c != null) {
+          c.BoundsParameter.Value = (DoubleMatrix)bounds.Clone();
+          c.LengthParameter.ActualName = Name;
+          c.StrategyParameterParameter.ActualName = Name + "Strategy";
+        }
+        var m = s as IIntegerVectorStdDevStrategyParameterManipulator;
+        if (m != null) {
+          m.BoundsParameter.Value = (DoubleMatrix)bounds.Clone();
+          m.StrategyParameterParameter.ActualName = Name + "Strategy";
+        }
+        var mm = s as StdDevStrategyVectorManipulator;
+        if (mm != null) {
+          mm.GeneralLearningRateParameter.Value = new DoubleValue(1.0 / Math.Sqrt(2 * Length));
+          mm.LearningRateParameter.Value = new DoubleValue(1.0 / Math.Sqrt(2 * Math.Sqrt(Length)));
+        }
+        var x = s as IIntegerVectorStdDevStrategyParameterCrossover;
+        if (x != null) {
+          x.ParentsParameter.ActualName = Name + "Strategy";
+          x.StrategyParameterParameter.ActualName = Name + "Strategy";
+        }
+      }
+    }
+    #endregion
+  }
+}
Index: anches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/RealEncoding.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/RealEncoding.cs	(revision 11884)
+++ 	(revision )
@@ -1,318 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Encodings.RealVectorEncoding;
-using HeuristicLab.Optimization;
-using HeuristicLab.Parameters;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.PluginInfrastructure;
-
-namespace HeuristicLab.Problems.Programmable {
-  [Item("RealEncoding", "Describes a real vector encoding.")]
-  [StorableClass]
-  public sealed class RealEncoding : Encoding<IRealVectorCreator> {
-    #region Encoding Parameters
-    [Storable]
-    private IFixedValueParameter<IntValue> lengthParameter;
-    public IFixedValueParameter<IntValue> LengthParameter {
-      get { return lengthParameter; }
-      set {
-        if (value == null) throw new ArgumentNullException("Length parameter must not be null.");
-        if (value.Value == null) throw new ArgumentNullException("Length parameter value must not be null.");
-        if (lengthParameter == value) return;
-
-        if (lengthParameter != null) Parameters.Remove(lengthParameter);
-        lengthParameter = value;
-        Parameters.Add(lengthParameter);
-        OnLengthParameterChanged();
-      }
-    }
-    [Storable]
-    private IValueParameter<DoubleMatrix> boundsParameter;
-    public IValueParameter<DoubleMatrix> BoundsParameter {
-      get { return boundsParameter; }
-      set {
-        if (value == null) throw new ArgumentNullException("Bounds parameter must not be null.");
-        if (boundsParameter == value) return;
-
-        if (boundsParameter != null) Parameters.Remove(boundsParameter);
-        boundsParameter = value;
-        Parameters.Add(boundsParameter);
-        OnBoundsParameterChanged();
-      }
-    }
-    #endregion
-
-    public int Length {
-      get { return LengthParameter.Value.Value; }
-      set { LengthParameter.Value.Value = value; }
-    }
-    public DoubleMatrix Bounds {
-      get { return BoundsParameter.Value; }
-      set { BoundsParameter.Value = value; }
-    }
-
-    [StorableConstructor]
-    private RealEncoding(bool deserializing) : base(deserializing) { }
-    [StorableHook(HookType.AfterDeserialization)]
-    private void AfterDeserialization() {
-      RegisterParameterEvents();
-      DiscoverOperators();
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) { return new RealEncoding(this, cloner); }
-    private RealEncoding(RealEncoding original, Cloner cloner)
-      : base(original, cloner) {
-      lengthParameter = cloner.Clone(original.lengthParameter);
-      boundsParameter = cloner.Clone(original.boundsParameter);
-      RegisterParameterEvents();
-    }
-
-    public RealEncoding() : this("RealVector", 10) { }
-    public RealEncoding(int length) : this("RealVector", length) { }
-    public RealEncoding(string name, int length, double min = double.MinValue, double max = double.MaxValue)
-      : base(name) {
-      if (min >= max) throw new ArgumentException("min must be less than max", "min");
-
-      var bounds = new DoubleMatrix(1, 2);
-      bounds[0, 0] = min;
-      bounds[0, 1] = max;
-
-      lengthParameter = new FixedValueParameter<IntValue>(Name + ".Length", new IntValue(length));
-      boundsParameter = new ValueParameter<DoubleMatrix>(Name + ".Bounds", bounds);
-      Parameters.Add(lengthParameter);
-      Parameters.Add(boundsParameter);
-
-      SolutionCreator = new UniformRandomRealVectorCreator();
-      RegisterParameterEvents();
-      DiscoverOperators();
-    }
-
-    public RealEncoding(string name, int length, IList<double> min, IList<double> max)
-      : base(name) {
-      if (min.Count == 0) throw new ArgumentException("Bounds must be given for the real parameters.");
-      if (min.Count != max.Count) throw new ArgumentException("min must be of the same length as max", "min");
-      if (min.Zip(max, (mi, ma) => mi >= ma).Any(x => x)) throw new ArgumentException("min must be less than max in each dimension", "min");
-
-      var bounds = new DoubleMatrix(min.Count, 2);
-      for (int i = 0; i < min.Count; i++) {
-        bounds[i, 0] = min[i];
-        bounds[i, 1] = max[i];
-      }
-      LengthParameter = new FixedValueParameter<IntValue>(Name + ".Length", new IntValue(length));
-      BoundsParameter = new ValueParameter<DoubleMatrix>(Name + ".Bounds", bounds);
-
-      SolutionCreator = new UniformRandomRealVectorCreator();
-      RegisterParameterEvents();
-      DiscoverOperators();
-    }
-
-    private void OnLengthParameterChanged() {
-      RegisterLengthParameterEvents();
-      ConfigureOperators(Operators);
-    }
-    private void OnBoundsParameterChanged() {
-      RegisterBoundsParameterEvents();
-      ConfigureOperators(Operators);
-    }
-
-    private void RegisterParameterEvents() {
-      RegisterLengthParameterEvents();
-      RegisterBoundsParameterEvents();
-    }
-    private void RegisterLengthParameterEvents() {
-      LengthParameter.ValueChanged += (o, s) => ConfigureOperators(Operators);
-      LengthParameter.Value.ValueChanged += (o, s) => ConfigureOperators(Operators);
-    }
-    private void RegisterBoundsParameterEvents() {
-      BoundsParameter.ValueChanged += (o, s) => ConfigureOperators(Operators);
-      boundsParameter.Value.ToStringChanged += (o, s) => ConfigureOperators(Operators);
-    }
-
-    #region Operator Discovery
-    private static readonly IEnumerable<Type> encodingSpecificOperatorTypes;
-    static RealEncoding() {
-      encodingSpecificOperatorTypes = new List<Type>() {
-          typeof (IRealVectorOperator),
-          typeof (IRealVectorCreator),
-          typeof (IRealVectorCrossover),
-          typeof (IRealVectorManipulator),
-          typeof (IRealVectorStdDevStrategyParameterOperator),
-          typeof (IRealVectorSwarmUpdater),
-          typeof (IRealVectorParticleCreator),
-          typeof (IRealVectorParticleUpdater),
-          typeof (IRealVectorMultiNeighborhoodShakingOperator),
-          typeof (IRealVectorBoundsChecker),
-          typeof (IRealVectorMoveOperator),
-          typeof (IRealVectorMoveGenerator)
-      };
-    }
-    private void DiscoverOperators() {
-      var assembly = typeof(IRealVectorOperator).Assembly;
-      var discoveredTypes = ApplicationManager.Manager.GetTypes(encodingSpecificOperatorTypes, assembly, true, false, false);
-      var operators = discoveredTypes.Select(t => (IOperator)Activator.CreateInstance(t));
-      var newOperators = operators.Except(Operators, new TypeEqualityComparer<IOperator>()).ToList();
-
-      ConfigureOperators(newOperators);
-      foreach (var @operator in newOperators)
-        encodingOperators.Add(@operator);
-
-      foreach (var strategyVectorCreator in Operators.OfType<IRealVectorStdDevStrategyParameterCreator>())
-        strategyVectorCreator.BoundsParameter.ValueChanged += strategyVectorCreator_BoundsParameter_ValueChanged;
-    }
-    #endregion
-
-
-    private void strategyVectorCreator_BoundsParameter_ValueChanged(object sender, EventArgs e) {
-      var boundsParameter = (IValueLookupParameter<DoubleMatrix>)sender;
-      if (boundsParameter.Value == null) return;
-      foreach (var strategyVectorManipulator in Operators.OfType<IRealVectorStdDevStrategyParameterManipulator>())
-        strategyVectorManipulator.BoundsParameter.Value = (DoubleMatrix)boundsParameter.Value.Clone();
-    }
-
-    public override void ConfigureOperators(IEnumerable<IOperator> operators) {
-      ConfigureCreators(operators.OfType<IRealVectorCreator>());
-      ConfigureCrossovers(operators.OfType<IRealVectorCrossover>());
-      ConfigureManipulators(operators.OfType<IRealVectorManipulator>());
-      ConfigureStdDevStrategyParameterOperators(operators.OfType<IRealVectorStdDevStrategyParameterOperator>());
-      ConfigureSwarmUpdaters(operators.OfType<IRealVectorSwarmUpdater>());
-      ConfigureParticleCreators(operators.OfType<IRealVectorParticleCreator>());
-      ConfigureParticleUpdaters(operators.OfType<IRealVectorParticleUpdater>());
-      ConfigureShakingOperators(operators.OfType<IRealVectorMultiNeighborhoodShakingOperator>());
-      ConfigureBoundsCheckers(operators.OfType<IRealVectorBoundsChecker>());
-      ConfigureMoveGenerators(operators.OfType<IRealVectorMoveGenerator>());
-      ConfigureMoveOperators(operators.OfType<IRealVectorMoveOperator>());
-      ConfigureAdditiveMoveOperator(operators.OfType<IAdditiveRealVectorMoveOperator>());
-    }
-
-    #region Specific Operator Wiring
-    private void ConfigureCreators(IEnumerable<IRealVectorCreator> creators) {
-      foreach (var creator in creators) {
-        creator.RealVectorParameter.ActualName = Name;
-        creator.LengthParameter.ActualName = LengthParameter.Name;
-        creator.BoundsParameter.ActualName = BoundsParameter.Name;
-      }
-    }
-    private void ConfigureCrossovers(IEnumerable<IRealVectorCrossover> crossovers) {
-      foreach (var crossover in crossovers) {
-        crossover.ChildParameter.ActualName = Name;
-        crossover.ParentsParameter.ActualName = Name;
-        crossover.BoundsParameter.ActualName = BoundsParameter.Name;
-      }
-    }
-    private void ConfigureManipulators(IEnumerable<IRealVectorManipulator> manipulators) {
-      foreach (var manipulator in manipulators) {
-        manipulator.RealVectorParameter.ActualName = Name;
-        manipulator.BoundsParameter.ActualName = BoundsParameter.Name;
-        manipulator.BoundsParameter.Hidden = true;
-        var sm = manipulator as ISelfAdaptiveManipulator;
-        if (sm != null) {
-          var p = sm.StrategyParameterParameter as ILookupParameter;
-          if (p != null) {
-            p.ActualName = Name + ".Strategy";
-          }
-        }
-      }
-    }
-    private void ConfigureStdDevStrategyParameterOperators(IEnumerable<IRealVectorStdDevStrategyParameterOperator> strategyOperators) {
-      var bounds = new DoubleMatrix(Bounds.Rows, Bounds.Columns);
-      for (var i = 0; i < Bounds.Rows; i++) {
-        bounds[i, 0] = 0;
-        bounds[i, 1] = 0.1 * (Bounds[i, 1] - Bounds[i, 0]);
-      }
-      foreach (var s in strategyOperators) {
-        var c = s as IRealVectorStdDevStrategyParameterCreator;
-        if (c != null) {
-          c.BoundsParameter.Value = (DoubleMatrix)bounds.Clone();
-          c.LengthParameter.ActualName = LengthParameter.Name;
-          c.StrategyParameterParameter.ActualName = Name + ".Strategy";
-        }
-        var m = s as IRealVectorStdDevStrategyParameterManipulator;
-        if (m != null) {
-          m.BoundsParameter.Value = (DoubleMatrix)bounds.Clone();
-          m.StrategyParameterParameter.ActualName = Name + ".Strategy";
-        }
-        var mm = s as StdDevStrategyVectorManipulator;
-        if (mm != null) {
-          mm.GeneralLearningRateParameter.Value = new DoubleValue(1.0 / Math.Sqrt(2 * Length));
-          mm.LearningRateParameter.Value = new DoubleValue(1.0 / Math.Sqrt(2 * Math.Sqrt(Length)));
-        }
-        var x = s as IRealVectorStdDevStrategyParameterCrossover;
-        if (x != null) {
-          x.ParentsParameter.ActualName = Name + ".Strategy";
-          x.StrategyParameterParameter.ActualName = Name + ".Strategy";
-        }
-      }
-    }
-    private void ConfigureSwarmUpdaters(IEnumerable<IRealVectorSwarmUpdater> swarmUpdaters) {
-      foreach (var su in swarmUpdaters) {
-        su.RealVectorParameter.ActualName = Name;
-      }
-    }
-    private void ConfigureParticleCreators(IEnumerable<IRealVectorParticleCreator> particleCreators) {
-      foreach (var particleCreator in particleCreators) {
-        particleCreator.RealVectorParameter.ActualName = Name;
-        particleCreator.BoundsParameter.ActualName = BoundsParameter.Name;
-        particleCreator.ProblemSizeParameter.ActualName = LengthParameter.Name;
-      }
-    }
-    private void ConfigureParticleUpdaters(IEnumerable<IRealVectorParticleUpdater> particleUpdaters) {
-      foreach (var particleUpdater in particleUpdaters) {
-        particleUpdater.RealVectorParameter.ActualName = Name;
-        particleUpdater.BoundsParameter.ActualName = BoundsParameter.Name;
-      }
-    }
-    private void ConfigureShakingOperators(IEnumerable<IRealVectorMultiNeighborhoodShakingOperator> shakingOperators) {
-      foreach (var shakingOperator in shakingOperators) {
-        shakingOperator.RealVectorParameter.ActualName = Name;
-        shakingOperator.BoundsParameter.ActualName = BoundsParameter.Name;
-      }
-    }
-    private void ConfigureBoundsCheckers(IEnumerable<IRealVectorBoundsChecker> boundsCheckers) {
-      foreach (var boundsChecker in boundsCheckers) {
-        boundsChecker.RealVectorParameter.ActualName = Name;
-        boundsChecker.BoundsParameter.ActualName = BoundsParameter.Name;
-      }
-    }
-    private void ConfigureMoveOperators(IEnumerable<IRealVectorMoveOperator> moveOperators) {
-      foreach (var moveOperator in moveOperators)
-        moveOperator.RealVectorParameter.ActualName = Name;
-    }
-
-    private void ConfigureMoveGenerators(IEnumerable<IRealVectorMoveGenerator> moveGenerators) {
-      foreach (var moveGenerator in moveGenerators)
-        moveGenerator.BoundsParameter.ActualName = BoundsParameter.Name;
-    }
-
-    private void ConfigureAdditiveMoveOperator(IEnumerable<IAdditiveRealVectorMoveOperator> additiveMoveOperators) {
-      foreach (var additiveMoveOperator in additiveMoveOperators) {
-        additiveMoveOperator.AdditiveMoveParameter.ActualName = Name + ".AdditiveMove";
-      }
-    }
-    #endregion
-  }
-}
Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/RealVectorEncoding.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/RealVectorEncoding.cs	(revision 11885)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/RealVectorEncoding.cs	(revision 11885)
@@ -0,0 +1,318 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.RealVectorEncoding;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Problems.Programmable {
+  [Item("RealVectorEncoding", "Describes a real vector encoding.")]
+  [StorableClass]
+  public sealed class RealVectorEncoding : Encoding<IRealVectorCreator> {
+    #region Encoding Parameters
+    [Storable]
+    private IFixedValueParameter<IntValue> lengthParameter;
+    public IFixedValueParameter<IntValue> LengthParameter {
+      get { return lengthParameter; }
+      set {
+        if (value == null) throw new ArgumentNullException("Length parameter must not be null.");
+        if (value.Value == null) throw new ArgumentNullException("Length parameter value must not be null.");
+        if (lengthParameter == value) return;
+
+        if (lengthParameter != null) Parameters.Remove(lengthParameter);
+        lengthParameter = value;
+        Parameters.Add(lengthParameter);
+        OnLengthParameterChanged();
+      }
+    }
+    [Storable]
+    private IValueParameter<DoubleMatrix> boundsParameter;
+    public IValueParameter<DoubleMatrix> BoundsParameter {
+      get { return boundsParameter; }
+      set {
+        if (value == null) throw new ArgumentNullException("Bounds parameter must not be null.");
+        if (boundsParameter == value) return;
+
+        if (boundsParameter != null) Parameters.Remove(boundsParameter);
+        boundsParameter = value;
+        Parameters.Add(boundsParameter);
+        OnBoundsParameterChanged();
+      }
+    }
+    #endregion
+
+    public int Length {
+      get { return LengthParameter.Value.Value; }
+      set { LengthParameter.Value.Value = value; }
+    }
+    public DoubleMatrix Bounds {
+      get { return BoundsParameter.Value; }
+      set { BoundsParameter.Value = value; }
+    }
+
+    [StorableConstructor]
+    private RealVectorEncoding(bool deserializing) : base(deserializing) { }
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      RegisterParameterEvents();
+      DiscoverOperators();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) { return new RealVectorEncoding(this, cloner); }
+    private RealVectorEncoding(RealVectorEncoding original, Cloner cloner)
+      : base(original, cloner) {
+      lengthParameter = cloner.Clone(original.lengthParameter);
+      boundsParameter = cloner.Clone(original.boundsParameter);
+      RegisterParameterEvents();
+    }
+
+    public RealVectorEncoding() : this("RealVector", 10) { }
+    public RealVectorEncoding(int length) : this("RealVector", length) { }
+    public RealVectorEncoding(string name, int length, double min = double.MinValue, double max = double.MaxValue)
+      : base(name) {
+      if (min >= max) throw new ArgumentException("min must be less than max", "min");
+
+      var bounds = new DoubleMatrix(1, 2);
+      bounds[0, 0] = min;
+      bounds[0, 1] = max;
+
+      lengthParameter = new FixedValueParameter<IntValue>(Name + ".Length", new IntValue(length));
+      boundsParameter = new ValueParameter<DoubleMatrix>(Name + ".Bounds", bounds);
+      Parameters.Add(lengthParameter);
+      Parameters.Add(boundsParameter);
+
+      SolutionCreator = new UniformRandomRealVectorCreator();
+      RegisterParameterEvents();
+      DiscoverOperators();
+    }
+
+    public RealVectorEncoding(string name, int length, IList<double> min, IList<double> max)
+      : base(name) {
+      if (min.Count == 0) throw new ArgumentException("Bounds must be given for the real parameters.");
+      if (min.Count != max.Count) throw new ArgumentException("min must be of the same length as max", "min");
+      if (min.Zip(max, (mi, ma) => mi >= ma).Any(x => x)) throw new ArgumentException("min must be less than max in each dimension", "min");
+
+      var bounds = new DoubleMatrix(min.Count, 2);
+      for (int i = 0; i < min.Count; i++) {
+        bounds[i, 0] = min[i];
+        bounds[i, 1] = max[i];
+      }
+      LengthParameter = new FixedValueParameter<IntValue>(Name + ".Length", new IntValue(length));
+      BoundsParameter = new ValueParameter<DoubleMatrix>(Name + ".Bounds", bounds);
+
+      SolutionCreator = new UniformRandomRealVectorCreator();
+      RegisterParameterEvents();
+      DiscoverOperators();
+    }
+
+    private void OnLengthParameterChanged() {
+      RegisterLengthParameterEvents();
+      ConfigureOperators(Operators);
+    }
+    private void OnBoundsParameterChanged() {
+      RegisterBoundsParameterEvents();
+      ConfigureOperators(Operators);
+    }
+
+    private void RegisterParameterEvents() {
+      RegisterLengthParameterEvents();
+      RegisterBoundsParameterEvents();
+    }
+    private void RegisterLengthParameterEvents() {
+      LengthParameter.ValueChanged += (o, s) => ConfigureOperators(Operators);
+      LengthParameter.Value.ValueChanged += (o, s) => ConfigureOperators(Operators);
+    }
+    private void RegisterBoundsParameterEvents() {
+      BoundsParameter.ValueChanged += (o, s) => ConfigureOperators(Operators);
+      boundsParameter.Value.ToStringChanged += (o, s) => ConfigureOperators(Operators);
+    }
+
+    #region Operator Discovery
+    private static readonly IEnumerable<Type> encodingSpecificOperatorTypes;
+    static RealVectorEncoding() {
+      encodingSpecificOperatorTypes = new List<Type>() {
+          typeof (IRealVectorOperator),
+          typeof (IRealVectorCreator),
+          typeof (IRealVectorCrossover),
+          typeof (IRealVectorManipulator),
+          typeof (IRealVectorStdDevStrategyParameterOperator),
+          typeof (IRealVectorSwarmUpdater),
+          typeof (IRealVectorParticleCreator),
+          typeof (IRealVectorParticleUpdater),
+          typeof (IRealVectorMultiNeighborhoodShakingOperator),
+          typeof (IRealVectorBoundsChecker),
+          typeof (IRealVectorMoveOperator),
+          typeof (IRealVectorMoveGenerator)
+      };
+    }
+    private void DiscoverOperators() {
+      var assembly = typeof(IRealVectorOperator).Assembly;
+      var discoveredTypes = ApplicationManager.Manager.GetTypes(encodingSpecificOperatorTypes, assembly, true, false, false);
+      var operators = discoveredTypes.Select(t => (IOperator)Activator.CreateInstance(t));
+      var newOperators = operators.Except(Operators, new TypeEqualityComparer<IOperator>()).ToList();
+
+      ConfigureOperators(newOperators);
+      foreach (var @operator in newOperators)
+        encodingOperators.Add(@operator);
+
+      foreach (var strategyVectorCreator in Operators.OfType<IRealVectorStdDevStrategyParameterCreator>())
+        strategyVectorCreator.BoundsParameter.ValueChanged += strategyVectorCreator_BoundsParameter_ValueChanged;
+    }
+    #endregion
+
+
+    private void strategyVectorCreator_BoundsParameter_ValueChanged(object sender, EventArgs e) {
+      var boundsParameter = (IValueLookupParameter<DoubleMatrix>)sender;
+      if (boundsParameter.Value == null) return;
+      foreach (var strategyVectorManipulator in Operators.OfType<IRealVectorStdDevStrategyParameterManipulator>())
+        strategyVectorManipulator.BoundsParameter.Value = (DoubleMatrix)boundsParameter.Value.Clone();
+    }
+
+    public override void ConfigureOperators(IEnumerable<IOperator> operators) {
+      ConfigureCreators(operators.OfType<IRealVectorCreator>());
+      ConfigureCrossovers(operators.OfType<IRealVectorCrossover>());
+      ConfigureManipulators(operators.OfType<IRealVectorManipulator>());
+      ConfigureStdDevStrategyParameterOperators(operators.OfType<IRealVectorStdDevStrategyParameterOperator>());
+      ConfigureSwarmUpdaters(operators.OfType<IRealVectorSwarmUpdater>());
+      ConfigureParticleCreators(operators.OfType<IRealVectorParticleCreator>());
+      ConfigureParticleUpdaters(operators.OfType<IRealVectorParticleUpdater>());
+      ConfigureShakingOperators(operators.OfType<IRealVectorMultiNeighborhoodShakingOperator>());
+      ConfigureBoundsCheckers(operators.OfType<IRealVectorBoundsChecker>());
+      ConfigureMoveGenerators(operators.OfType<IRealVectorMoveGenerator>());
+      ConfigureMoveOperators(operators.OfType<IRealVectorMoveOperator>());
+      ConfigureAdditiveMoveOperator(operators.OfType<IAdditiveRealVectorMoveOperator>());
+    }
+
+    #region Specific Operator Wiring
+    private void ConfigureCreators(IEnumerable<IRealVectorCreator> creators) {
+      foreach (var creator in creators) {
+        creator.RealVectorParameter.ActualName = Name;
+        creator.LengthParameter.ActualName = LengthParameter.Name;
+        creator.BoundsParameter.ActualName = BoundsParameter.Name;
+      }
+    }
+    private void ConfigureCrossovers(IEnumerable<IRealVectorCrossover> crossovers) {
+      foreach (var crossover in crossovers) {
+        crossover.ChildParameter.ActualName = Name;
+        crossover.ParentsParameter.ActualName = Name;
+        crossover.BoundsParameter.ActualName = BoundsParameter.Name;
+      }
+    }
+    private void ConfigureManipulators(IEnumerable<IRealVectorManipulator> manipulators) {
+      foreach (var manipulator in manipulators) {
+        manipulator.RealVectorParameter.ActualName = Name;
+        manipulator.BoundsParameter.ActualName = BoundsParameter.Name;
+        manipulator.BoundsParameter.Hidden = true;
+        var sm = manipulator as ISelfAdaptiveManipulator;
+        if (sm != null) {
+          var p = sm.StrategyParameterParameter as ILookupParameter;
+          if (p != null) {
+            p.ActualName = Name + ".Strategy";
+          }
+        }
+      }
+    }
+    private void ConfigureStdDevStrategyParameterOperators(IEnumerable<IRealVectorStdDevStrategyParameterOperator> strategyOperators) {
+      var bounds = new DoubleMatrix(Bounds.Rows, Bounds.Columns);
+      for (var i = 0; i < Bounds.Rows; i++) {
+        bounds[i, 0] = 0;
+        bounds[i, 1] = 0.1 * (Bounds[i, 1] - Bounds[i, 0]);
+      }
+      foreach (var s in strategyOperators) {
+        var c = s as IRealVectorStdDevStrategyParameterCreator;
+        if (c != null) {
+          c.BoundsParameter.Value = (DoubleMatrix)bounds.Clone();
+          c.LengthParameter.ActualName = LengthParameter.Name;
+          c.StrategyParameterParameter.ActualName = Name + ".Strategy";
+        }
+        var m = s as IRealVectorStdDevStrategyParameterManipulator;
+        if (m != null) {
+          m.BoundsParameter.Value = (DoubleMatrix)bounds.Clone();
+          m.StrategyParameterParameter.ActualName = Name + ".Strategy";
+        }
+        var mm = s as StdDevStrategyVectorManipulator;
+        if (mm != null) {
+          mm.GeneralLearningRateParameter.Value = new DoubleValue(1.0 / Math.Sqrt(2 * Length));
+          mm.LearningRateParameter.Value = new DoubleValue(1.0 / Math.Sqrt(2 * Math.Sqrt(Length)));
+        }
+        var x = s as IRealVectorStdDevStrategyParameterCrossover;
+        if (x != null) {
+          x.ParentsParameter.ActualName = Name + ".Strategy";
+          x.StrategyParameterParameter.ActualName = Name + ".Strategy";
+        }
+      }
+    }
+    private void ConfigureSwarmUpdaters(IEnumerable<IRealVectorSwarmUpdater> swarmUpdaters) {
+      foreach (var su in swarmUpdaters) {
+        su.RealVectorParameter.ActualName = Name;
+      }
+    }
+    private void ConfigureParticleCreators(IEnumerable<IRealVectorParticleCreator> particleCreators) {
+      foreach (var particleCreator in particleCreators) {
+        particleCreator.RealVectorParameter.ActualName = Name;
+        particleCreator.BoundsParameter.ActualName = BoundsParameter.Name;
+        particleCreator.ProblemSizeParameter.ActualName = LengthParameter.Name;
+      }
+    }
+    private void ConfigureParticleUpdaters(IEnumerable<IRealVectorParticleUpdater> particleUpdaters) {
+      foreach (var particleUpdater in particleUpdaters) {
+        particleUpdater.RealVectorParameter.ActualName = Name;
+        particleUpdater.BoundsParameter.ActualName = BoundsParameter.Name;
+      }
+    }
+    private void ConfigureShakingOperators(IEnumerable<IRealVectorMultiNeighborhoodShakingOperator> shakingOperators) {
+      foreach (var shakingOperator in shakingOperators) {
+        shakingOperator.RealVectorParameter.ActualName = Name;
+        shakingOperator.BoundsParameter.ActualName = BoundsParameter.Name;
+      }
+    }
+    private void ConfigureBoundsCheckers(IEnumerable<IRealVectorBoundsChecker> boundsCheckers) {
+      foreach (var boundsChecker in boundsCheckers) {
+        boundsChecker.RealVectorParameter.ActualName = Name;
+        boundsChecker.BoundsParameter.ActualName = BoundsParameter.Name;
+      }
+    }
+    private void ConfigureMoveOperators(IEnumerable<IRealVectorMoveOperator> moveOperators) {
+      foreach (var moveOperator in moveOperators)
+        moveOperator.RealVectorParameter.ActualName = Name;
+    }
+
+    private void ConfigureMoveGenerators(IEnumerable<IRealVectorMoveGenerator> moveGenerators) {
+      foreach (var moveGenerator in moveGenerators)
+        moveGenerator.BoundsParameter.ActualName = BoundsParameter.Name;
+    }
+
+    private void ConfigureAdditiveMoveOperator(IEnumerable<IAdditiveRealVectorMoveOperator> additiveMoveOperators) {
+      foreach (var additiveMoveOperator in additiveMoveOperators) {
+        additiveMoveOperator.AdditiveMoveParameter.ActualName = Name + ".AdditiveMove";
+      }
+    }
+    #endregion
+  }
+}
Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/HeuristicLab.Problems.Programmable-3.3.csproj
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/HeuristicLab.Problems.Programmable-3.3.csproj	(revision 11884)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/HeuristicLab.Problems.Programmable-3.3.csproj	(revision 11885)
@@ -131,7 +131,7 @@
     <Compile Include="Individuals\MultiEncodingIndividual.cs" />
     <Compile Include="Encodings\PermutationEncoding.cs" />
-    <Compile Include="Encodings\RealEncoding.cs" />
-    <Compile Include="Encodings\IntegerEncoding.cs" />
-    <Compile Include="Encodings\BinaryEncoding.cs" />
+    <Compile Include="Encodings\RealVectorEncoding.cs" />
+    <Compile Include="Encodings\IntegerVectorEncoding.cs" />
+    <Compile Include="Encodings\BinaryVectorEncoding.cs" />
     <Compile Include="Encodings\MultiEncoding.cs" />
     <Compile Include="Encodings\Encoding.cs" />
@@ -151,4 +151,5 @@
     <Compile Include="New\MultiObjectiveBasicProblem.cs" />
     <Compile Include="New\MultiObjectiveProgrammableProblem.cs" />
+    <Compile Include="New\Scripts\ProblemDefinitionScriptException.cs" />
     <Compile Include="New\Scripts\Templates\CompiledMultiObjectiveProblemDefinition.cs" />
     <Compile Include="New\Scripts\Templates\CompiledSingleObjectiveProblemDefinition.cs" />
Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Individuals/Individual.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Individuals/Individual.cs	(revision 11884)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Individuals/Individual.cs	(revision 11885)
@@ -43,7 +43,8 @@
 
     public Individual Copy() {
-      return Copy(new Scope());
+      return CopyToScope(new Scope());
     }
-    internal abstract Individual Copy(IScope scope);
+
+    public abstract Individual CopyToScope(IScope scope);
 
     protected static IItem ExtractScopeValue(string name, IScope scope) {
@@ -64,5 +65,5 @@
   public static class IndividualExtensionMethods {
     public static BinaryVector BinaryVector(this Individual individual) {
-      var encoding = individual.GetEncoding<BinaryEncoding>();
+      var encoding = individual.GetEncoding<BinaryVectorEncoding>();
       return individual.BinaryVector(encoding.Name);
     }
@@ -72,5 +73,5 @@
 
     public static IntegerVector IntegerVector(this Individual individual) {
-      var encoding = individual.GetEncoding<IntegerEncoding>();
+      var encoding = individual.GetEncoding<IntegerVectorEncoding>();
       return individual.IntegerVector(encoding.Name);
     }
@@ -88,5 +89,5 @@
 
     public static RealVector RealVector(this Individual individual) {
-      var encoding = individual.GetEncoding<RealEncoding>();
+      var encoding = individual.GetEncoding<RealVectorEncoding>();
       return individual.RealVector(encoding.Name);
     }
Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Individuals/MultiEncodingIndividual.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Individuals/MultiEncodingIndividual.cs	(revision 11884)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Individuals/MultiEncodingIndividual.cs	(revision 11885)
@@ -62,6 +62,5 @@
       try {
         encoding = (TEncoding)Encoding.Encodings.SingleOrDefault(e => e is TEncoding);
-      }
-      catch (InvalidOperationException) {
+      } catch (InvalidOperationException) {
         throw new InvalidOperationException(string.Format("The individual uses multiple {0} .", typeof(TEncoding).GetPrettyName()));
       }
@@ -70,6 +69,6 @@
     }
 
-    internal override Individual Copy(IScope scope) {
-      var copies = individuals.Select(i => i.Copy(scope)).ToArray();
+    public override Individual CopyToScope(IScope scope) {
+      var copies = individuals.Select(i => i.CopyToScope(scope)).ToArray();
       return new MultiEncodingIndividual(Encoding, scope, copies);
     }
Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Individuals/SingleEncodingIndividual.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Individuals/SingleEncodingIndividual.cs	(revision 11884)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Individuals/SingleEncodingIndividual.cs	(revision 11885)
@@ -49,5 +49,5 @@
     }
 
-    internal override Individual Copy(IScope scope) {
+    public override Individual CopyToScope(IScope scope) {
       SetScopeValue(Name, scope, (IItem)this[Name].Clone());
       return new SingleEncodingIndividual(Encoding, scope);
Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Interfaces/IMultiEncodingOperator.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Interfaces/IMultiEncodingOperator.cs	(revision 11884)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Interfaces/IMultiEncodingOperator.cs	(revision 11885)
@@ -26,5 +26,4 @@
     void AddEncoding(IEncoding encoding);
     bool RemoveEncoding(IEncoding encoding);
-    void ReplaceEncoding(IEncoding oldEncoding, IEncoding newEncoding);
   }
 }
Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/New/BasicProblem.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/New/BasicProblem.cs	(revision 11884)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/New/BasicProblem.cs	(revision 11885)
@@ -126,8 +126,4 @@
         foreach (var multi in nestedEncodings)
           AdaptEncodingOperators(multi.oldEnc, multi.newEnc);
-
-        foreach (var op in oldMultiEncoding.Operators.OfType<IMultiEncodingOperator>())
-          foreach (var multi in nestedEncodings)
-            op.ReplaceEncoding(multi.oldEnc, multi.newEnc);
       }
 
@@ -137,7 +133,8 @@
       var newOperators = newEncoding.Operators;
 
-
-      var operators = oldOperators.Intersect(newOperators, comparer).Select(op => cloner.Clone(op));
-      operators = operators.Union(newOperators, comparer).ToList();
+      cloner.RegisterClonedObject(oldEncoding, newEncoding);
+      var operators = oldOperators.Intersect(newOperators, comparer)
+                                  .Select(cloner.Clone)
+                                  .Union(newOperators, comparer).ToList();
 
       newEncoding.ConfigureOperators(operators);
Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/New/OneMaxNew.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/New/OneMaxNew.cs	(revision 11884)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/New/OneMaxNew.cs	(revision 11885)
@@ -32,5 +32,5 @@
   [Creatable("1 Test")]
   [StorableClass]
-  public class OneMaxNew : SingleObjectiveBasicProblem<BinaryEncoding> {
+  public class OneMaxNew : SingleObjectiveBasicProblem<BinaryVectorEncoding> {
     public override bool Maximization {
       get { return true; }
@@ -39,5 +39,5 @@
     public OneMaxNew()
       : base() {
-      Encoding = new BinaryEncoding("BinaryVector", 10);
+      Encoding = new BinaryVectorEncoding("BinaryVector", 10);
       var bestScopeSolutionAnalyzer = Operators.OfType<BestScopeSolutionAnalyzer>().FirstOrDefault();
       if (bestScopeSolutionAnalyzer != null) Operators.Remove(bestScopeSolutionAnalyzer);
Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/New/Scripts/ProblemDefinitionScript.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/New/Scripts/ProblemDefinitionScript.cs	(revision 11884)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/New/Scripts/ProblemDefinitionScript.cs	(revision 11885)
@@ -71,13 +71,32 @@
       var assembly = base.Compile();
       var types = assembly.GetTypes();
+      if (!types.Any(x => typeof(CompiledProblemDefinition).IsAssignableFrom(x)))
+        throw new ProblemDefinitionScriptException("The compiled code doesn't contain a problem definition." + Environment.NewLine + "The problem definition must be a subclass of CompiledProblemDefinition.");
+      if (types.Count(x => typeof(CompiledProblemDefinition).IsAssignableFrom(x)) > 1)
+        throw new ProblemDefinitionScriptException("The compiled code contains multiple problem definitions." + Environment.NewLine + "Only one subclass of CompiledProblemDefinition is allowed.");
+
+      CompiledProblemDefinition inst;
       try {
-        var inst = (CompiledProblemDefinition)Activator.CreateInstance(types.First(x => typeof(CompiledProblemDefinition).IsAssignableFrom(x)));
+        inst = (CompiledProblemDefinition)Activator.CreateInstance(types.Single(x => typeof(CompiledProblemDefinition).IsAssignableFrom(x)));
+      } catch (Exception e) {
+        compiledProblemDefinition = null;
+        throw new ProblemDefinitionScriptException("Instantiating the problem definition failed." + Environment.NewLine + "Check your default constructor.", e);
+      }
+
+      try {
         inst.vars = new Variables(VariableStore);
         inst.Initialize();
+      } catch (Exception e) {
+        compiledProblemDefinition = null;
+        throw new ProblemDefinitionScriptException("Initializing the problem definition failed." + Environment.NewLine + "Check your Initialize() method.", e);
+      }
+
+      try {
         CompiledProblemDefinition = inst;
       } catch (Exception e) {
         compiledProblemDefinition = null;
-        throw;
+        throw new ProblemDefinitionScriptException("Using the problem definition in the problem failed." + Environment.NewLine + "Examine this error message carefully (often there is an issue with the defined encoding).", e);
       }
+
       return assembly;
     }
Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/New/Scripts/ProblemDefinitionScriptException.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/New/Scripts/ProblemDefinitionScriptException.cs	(revision 11885)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/New/Scripts/ProblemDefinitionScriptException.cs	(revision 11885)
@@ -0,0 +1,18 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Problems.Programmable {
+  [Serializable]
+  public class ProblemDefinitionScriptException : Exception {
+    public ProblemDefinitionScriptException() { }
+    public ProblemDefinitionScriptException(string message) : base(message) { }
+    public ProblemDefinitionScriptException(string message, Exception inner) : base(message, inner) { }
+
+    protected ProblemDefinitionScriptException(SerializationInfo info, StreamingContext context)
+      : base(info, context) { }
+  }
+}
Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/New/SingleObjectiveProgrammableProblem.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/New/SingleObjectiveProgrammableProblem.cs	(revision 11884)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/New/SingleObjectiveProgrammableProblem.cs	(revision 11885)
@@ -51,6 +51,6 @@
       try {
         ProblemScript.Compile();
-      } catch (InvalidOperationException) {
-        //Compilation error
+      } catch (ProblemDefinitionScriptException e) {
+        PluginInfrastructure.ErrorHandling.ShowErrorDialog(e);
       }
     }
Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/MultiEncodingOperator.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/MultiEncodingOperator.cs	(revision 11884)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/MultiEncodingOperator.cs	(revision 11885)
@@ -81,14 +81,4 @@
     }
 
-    public virtual void ReplaceEncoding(IEncoding oldEncoding, IEncoding newEncoding) {
-      var oldParameterValue = GetParameter(oldEncoding).Value;
-      RemoveEncoding(oldEncoding);
-      AddEncoding(newEncoding);
-
-      var parameter = GetParameter(newEncoding);
-      var newParameterValue = parameter.ValidValues.FirstOrDefault(op => op.GetType() == oldParameterValue.GetType());
-      if (newParameterValue != null) parameter.Value = newParameterValue;
-    }
-
     protected IConstrainedValueParameter<T> GetParameter(IEncoding encoding) {
       if (!Parameters.ContainsKey(encoding.Name)) throw new ArgumentException(string.Format("Encoding {0} was not added to the MultiEncoding.", encoding.Name));
Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/SingleObjectiveImprover.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/SingleObjectiveImprover.cs	(revision 11884)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/SingleObjectiveImprover.cs	(revision 11885)
@@ -110,5 +110,5 @@
       LocalEvaluatedSolutionsParameter.ActualValue = new IntValue(count);
       QualityParameter.ActualValue = new DoubleValue(quality);
-      individual.Copy(ExecutionContext.Scope);
+      individual.CopyToScope(ExecutionContext.Scope);
       return base.Apply();
     }
Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/SingleObjectiveMoveGenerator.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/SingleObjectiveMoveGenerator.cs	(revision 11884)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/SingleObjectiveMoveGenerator.cs	(revision 11885)
@@ -74,5 +74,5 @@
       for (int i = 0; i < moveScopes.Length; i++) {
         moveScopes[i] = new Scope(i.ToString(CultureInfo.InvariantCulture.NumberFormat));
-        nbhood[i].Copy(moveScopes[i]);
+        nbhood[i].CopyToScope(moveScopes[i]);
       }
       ExecutionContext.Scope.SubScopes.AddRange(moveScopes);
Index: /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/SingleObjectiveMoveMaker.cs
===================================================================
--- /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/SingleObjectiveMoveMaker.cs	(revision 11884)
+++ /branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/SingleObjectiveMoveMaker.cs	(revision 11885)
@@ -63,5 +63,5 @@
       var encoding = EncodingParameter.ActualValue;
       var individual = encoding.GetIndividual(ExecutionContext.Scope);
-      individual.Copy(ExecutionContext.Scope.Parent.Parent);
+      individual.CopyToScope(ExecutionContext.Scope.Parent.Parent);
 
       if (QualityParameter.ActualValue == null) QualityParameter.ActualValue = new DoubleValue(MoveQualityParameter.ActualValue.Value);
