Index: branches/ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/SingleObjectiveTestFunctionProblem.cs
===================================================================
--- branches/ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/SingleObjectiveTestFunctionProblem.cs	(revision 13361)
+++ branches/ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/SingleObjectiveTestFunctionProblem.cs	(revision 13403)
@@ -32,5 +32,4 @@
 using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.PluginInfrastructure;
 using HeuristicLab.Problems.Instances;
 
@@ -40,51 +39,42 @@
   [Creatable(CreatableAttribute.Categories.Problems, Priority = 90)]
   public sealed class SingleObjectiveTestFunctionProblem :
-    SingleObjectiveHeuristicOptimizationProblem<ISingleObjectiveTestFunctionProblemEvaluator, IRealVectorCreator>,
-    ISingleObjectiveProblem<RealVectorEncoding, RealVector>, IStorableContent, IProblemInstanceConsumer<SOTFData> {
-    public string Filename { get; set; }
-
-    [Storable]
-    private StdDevStrategyVectorCreator strategyVectorCreator;
-    [Storable]
-    private StdDevStrategyVectorCrossover strategyVectorCrossover;
-    [Storable]
-    private StdDevStrategyVectorManipulator strategyVectorManipulator;
+    SingleObjectiveProblem<RealVectorEncoding, RealVector>,
+    IProblemInstanceConsumer<SOTFData> {
+
+    public override bool Maximization {
+      get { return Parameters.ContainsKey("TestFunction") && TestFunction.Maximization; }
+    }
 
     #region Parameter Properties
-    public ValueParameter<DoubleMatrix> BoundsParameter {
-      get { return (ValueParameter<DoubleMatrix>)Parameters["Bounds"]; }
-    }
-    public ValueParameter<IntValue> ProblemSizeParameter {
-      get { return (ValueParameter<IntValue>)Parameters["ProblemSize"]; }
+    private IFixedValueParameter<IntValue> ProblemSizeParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters["ProblemSize"]; }
+    }
+    private IValueParameter<DoubleMatrix> BoundsParameter {
+      get { return (IValueParameter<DoubleMatrix>)Parameters["Bounds"]; }
     }
     public OptionalValueParameter<RealVector> BestKnownSolutionParameter {
       get { return (OptionalValueParameter<RealVector>)Parameters["BestKnownSolution"]; }
     }
+    public IValueParameter<ISingleObjectiveTestFunction> TestFunctionParameter {
+      get { return (IValueParameter<ISingleObjectiveTestFunction>)Parameters["TestFunction"]; }
+    }
     #endregion
 
     #region Properties
+    public int ProblemSize {
+      get { return ProblemSizeParameter.Value.Value; }
+      set { ProblemSizeParameter.Value.Value = value; }
+    }
     public DoubleMatrix Bounds {
       get { return BoundsParameter.Value; }
       set { BoundsParameter.Value = value; }
     }
-    public IntValue ProblemSize {
-      get { return ProblemSizeParameter.Value; }
-      set { ProblemSizeParameter.Value = value; }
-    }
+    public ISingleObjectiveTestFunction TestFunction {
+      get { return TestFunctionParameter.Value; }
+      set { TestFunctionParameter.Value = value; }
+    }
+
     private BestSingleObjectiveTestFunctionSolutionAnalyzer BestSingleObjectiveTestFunctionSolutionAnalyzer {
       get { return Operators.OfType<BestSingleObjectiveTestFunctionSolutionAnalyzer>().FirstOrDefault(); }
-    }
-    #endregion
-
-    // BackwardsCompatibility3.3
-    #region Backwards compatible code, remove with 3.4
-    [Obsolete]
-    [Storable(Name = "operators")]
-    private IEnumerable<IOperator> oldOperators {
-      get { return null; }
-      set {
-        if (value != null && value.Any())
-          Operators.AddRange(value);
-      }
     }
     #endregion
@@ -94,32 +84,19 @@
     private SingleObjectiveTestFunctionProblem(SingleObjectiveTestFunctionProblem original, Cloner cloner)
       : base(original, cloner) {
-      strategyVectorCreator = cloner.Clone(original.strategyVectorCreator);
-      strategyVectorCrossover = cloner.Clone(original.strategyVectorCrossover);
-      strategyVectorManipulator = cloner.Clone(original.strategyVectorManipulator);
       RegisterEventHandlers();
     }
     public SingleObjectiveTestFunctionProblem()
-      : base(new AckleyEvaluator(), new UniformRandomRealVectorCreator()) {
-      Parameters.Add(new ValueParameter<DoubleMatrix>("Bounds", "The lower and upper bounds in each dimension.", Evaluator.Bounds));
-      Parameters.Add(new ValueParameter<IntValue>("ProblemSize", "The dimension of the problem.", new IntValue(2)));
+      : base(new RealVectorEncoding("Point")) {
+      Parameters.Add(new FixedValueParameter<IntValue>("ProblemSize", "The dimensionality of the problem instance (number of variables in the function).", new IntValue(2)));
+      Parameters.Add(new ValueParameter<DoubleMatrix>("Bounds", "The bounds of the solution given as either one line for all variables or a line for each variable. The first column specifies lower bound, the second upper bound.", new DoubleMatrix(new double[,] { { -100, 100 } })));
       Parameters.Add(new OptionalValueParameter<RealVector>("BestKnownSolution", "The best known solution for this test function instance."));
-
-      Maximization.Value = Evaluator.Maximization;
-      BestKnownQuality = new DoubleValue(Evaluator.BestKnownQuality);
-
-      strategyVectorCreator = new StdDevStrategyVectorCreator();
-      strategyVectorCreator.LengthParameter.ActualName = ProblemSizeParameter.Name;
-      strategyVectorCrossover = new StdDevStrategyVectorCrossover();
-      strategyVectorManipulator = new StdDevStrategyVectorManipulator();
-      strategyVectorManipulator.LearningRateParameter.Value = new DoubleValue(0.5);
-      strategyVectorManipulator.GeneralLearningRateParameter.Value = new DoubleValue(0.5);
-
-      SolutionCreator.RealVectorParameter.ActualName = "Point";
-      ParameterizeSolutionCreator();
-      ParameterizeEvaluator();
+      Parameters.Add(new ValueParameter<ISingleObjectiveTestFunction>("TestFunction", "The function that is to be optimized.", new Ackley()));
+
+      Encoding.LengthParameter = ProblemSizeParameter;
+      Encoding.BoundsParameter = BoundsParameter;
+      BestKnownQuality = TestFunction.BestKnownQuality;
 
       InitializeOperators();
       RegisterEventHandlers();
-      UpdateStrategyVectorBounds();
     }
 
@@ -128,135 +105,57 @@
     }
 
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      RegisterEventHandlers();
+    }
+
+    private void RegisterEventHandlers() {
+      Evaluator.QualityParameter.ActualNameChanged += Evaluator_QualityParameter_ActualNameChanged;
+      TestFunctionParameter.ValueChanged += TestFunctionParameterOnValueChanged;
+      ProblemSizeParameter.Value.ValueChanged += ProblemSizeOnValueChanged;
+      BoundsParameter.ValueChanged += BoundsParameterOnValueChanged;
+    }
+
+    public override double Evaluate(RealVector individual, IRandom random) {
+      return TestFunction.Evaluate(individual);
+    }
+
     #region Events
-    protected override void OnSolutionCreatorChanged() {
-      base.OnSolutionCreatorChanged();
-      ParameterizeSolutionCreator();
-      ParameterizeAnalyzers();
-      SolutionCreator.RealVectorParameter.ActualNameChanged += new EventHandler(SolutionCreator_RealVectorParameter_ActualNameChanged);
-      SolutionCreator_RealVectorParameter_ActualNameChanged(null, EventArgs.Empty);
+    protected override void OnEncodingChanged() {
+      base.OnEncodingChanged();
+      Parameterize();
     }
     protected override void OnEvaluatorChanged() {
       base.OnEvaluatorChanged();
-      bool problemSizeChange = ProblemSize.Value < Evaluator.MinimumProblemSize
-        || ProblemSize.Value > Evaluator.MaximumProblemSize;
+      Evaluator.QualityParameter.ActualNameChanged += Evaluator_QualityParameter_ActualNameChanged;
+      Parameterize();
+    }
+    private void Evaluator_QualityParameter_ActualNameChanged(object sender, EventArgs e) {
+      Parameterize();
+    }
+    private void TestFunctionParameterOnValueChanged(object sender, EventArgs eventArgs) {
+      var problemSizeChange = ProblemSize < TestFunction.MinimumProblemSize
+                              || ProblemSize > TestFunction.MaximumProblemSize;
       if (problemSizeChange) {
-        ProblemSize.Value = Math.Max(Evaluator.MinimumProblemSize, Math.Min(ProblemSize.Value, Evaluator.MaximumProblemSize));
-      } else {
-        ParameterizeEvaluator();
-      }
-      UpdateMoveEvaluators();
-      ParameterizeAnalyzers();
-      Maximization.Value = Evaluator.Maximization;
-      BoundsParameter.Value = Evaluator.Bounds;
-      BestKnownQuality = new DoubleValue(Evaluator.BestKnownQuality);
-      Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
-      Evaluator_QualityParameter_ActualNameChanged(null, EventArgs.Empty);
+        ProblemSize = Math.Max(TestFunction.MinimumProblemSize, Math.Min(ProblemSize, TestFunction.MaximumProblemSize));
+      }
+      BestKnownQuality = TestFunction.BestKnownQuality;
+      Bounds = (DoubleMatrix)TestFunction.Bounds.Clone();
+      var bestSolution = TestFunction.GetBestKnownSolution(ProblemSize);
+      BestKnownSolutionParameter.Value = bestSolution;
+
       OnReset();
     }
-    private void ProblemSizeParameter_ValueChanged(object sender, EventArgs e) {
-      ProblemSize.ValueChanged += new EventHandler(ProblemSize_ValueChanged);
-      ProblemSize_ValueChanged(null, EventArgs.Empty);
-    }
-    private void ProblemSize_ValueChanged(object sender, EventArgs e) {
-      if (ProblemSize.Value < 1) ProblemSize.Value = 1;
-      ParameterizeSolutionCreator();
-      ParameterizeEvaluator();
-      strategyVectorManipulator.GeneralLearningRateParameter.Value = new DoubleValue(1.0 / Math.Sqrt(2 * ProblemSize.Value));
-      strategyVectorManipulator.LearningRateParameter.Value = new DoubleValue(1.0 / Math.Sqrt(2 * Math.Sqrt(ProblemSize.Value)));
-      OnReset();
-    }
-    private void SolutionCreator_RealVectorParameter_ActualNameChanged(object sender, EventArgs e) {
-      ParameterizeEvaluator();
-      ParameterizeOperators();
-      ParameterizeAnalyzers();
-    }
-    private void Evaluator_QualityParameter_ActualNameChanged(object sender, EventArgs e) {
-      ParameterizeOperators();
-    }
-    private void BoundsParameter_ValueChanged(object sender, EventArgs e) {
-      Bounds.ToStringChanged += new EventHandler(Bounds_ToStringChanged);
-      Bounds_ToStringChanged(null, EventArgs.Empty);
-    }
-    private void Bounds_ToStringChanged(object sender, EventArgs e) {
-      if (Bounds.Columns != 2 || Bounds.Rows < 1)
-        Bounds = new DoubleMatrix(1, 2);
-      ParameterizeOperators();
-      UpdateStrategyVectorBounds();
-    }
-    private void Bounds_ItemChanged(object sender, EventArgs<int, int> e) {
-      if (e.Value2 == 0 && Bounds[e.Value, 1] <= Bounds[e.Value, 0])
-        Bounds[e.Value, 1] = Bounds[e.Value, 0] + 0.1;
-      if (e.Value2 == 1 && Bounds[e.Value, 0] >= Bounds[e.Value, 1])
-        Bounds[e.Value, 0] = Bounds[e.Value, 1] - 0.1;
-      ParameterizeOperators();
-      UpdateStrategyVectorBounds();
-    }
-    private void MoveGenerator_AdditiveMoveParameter_ActualNameChanged(object sender, EventArgs e) {
-      string name = ((ILookupParameter<AdditiveMove>)sender).ActualName;
-      foreach (IAdditiveRealVectorMoveOperator op in Operators.OfType<IAdditiveRealVectorMoveOperator>()) {
-        op.AdditiveMoveParameter.ActualName = name;
-      }
-    }
-    private void SphereEvaluator_Parameter_ValueChanged(object sender, EventArgs e) {
-      SphereEvaluator eval = (Evaluator as SphereEvaluator);
-      if (eval != null) {
-        foreach (ISphereMoveEvaluator op in Operators.OfType<ISphereMoveEvaluator>()) {
-          op.C = eval.C;
-          op.Alpha = eval.Alpha;
-        }
-      }
-    }
-    private void RastriginEvaluator_Parameter_ValueChanged(object sender, EventArgs e) {
-      RastriginEvaluator eval = (Evaluator as RastriginEvaluator);
-      if (eval != null) {
-        foreach (IRastriginMoveEvaluator op in Operators.OfType<IRastriginMoveEvaluator>()) {
-          op.A = eval.A;
-        }
-      }
-    }
-    private void strategyVectorCreator_BoundsParameter_ValueChanged(object sender, EventArgs e) {
-      strategyVectorManipulator.BoundsParameter.Value = (DoubleMatrix)strategyVectorCreator.BoundsParameter.Value.Clone();
-    }
-    private void strategyVectorCreator_StrategyParameterParameter_ActualNameChanged(object sender, EventArgs e) {
-      string name = strategyVectorCreator.StrategyParameterParameter.ActualName;
-      strategyVectorCrossover.ParentsParameter.ActualName = name;
-      strategyVectorCrossover.StrategyParameterParameter.ActualName = name;
-      strategyVectorManipulator.StrategyParameterParameter.ActualName = name;
+    private void ProblemSizeOnValueChanged(object sender, EventArgs eventArgs) {
+      if (ProblemSize < TestFunction.MinimumProblemSize
+        || ProblemSize > TestFunction.MaximumProblemSize)
+        ProblemSize = Math.Min(TestFunction.MaximumProblemSize, Math.Max(TestFunction.MinimumProblemSize, ProblemSize));
+    }
+    private void BoundsParameterOnValueChanged(object sender, EventArgs eventArgs) {
+      Parameterize();
     }
     #endregion
 
     #region Helpers
-    [StorableHook(HookType.AfterDeserialization)]
-    private void AfterDeserialization() {
-      // BackwardsCompatibility3.3
-      #region Backwards compatible code (remove with 3.4)
-      if (Operators.Count == 0) InitializeOperators();
-      #endregion
-      RegisterEventHandlers();
-    }
-
-    private void RegisterEventHandlers() {
-      ProblemSizeParameter.ValueChanged += new EventHandler(ProblemSizeParameter_ValueChanged);
-      ProblemSize.ValueChanged += new EventHandler(ProblemSize_ValueChanged);
-      BoundsParameter.ValueChanged += new EventHandler(BoundsParameter_ValueChanged);
-      Bounds.ToStringChanged += new EventHandler(Bounds_ToStringChanged);
-      Bounds.ItemChanged += new EventHandler<EventArgs<int, int>>(Bounds_ItemChanged);
-      SolutionCreator.RealVectorParameter.ActualNameChanged += new EventHandler(SolutionCreator_RealVectorParameter_ActualNameChanged);
-      Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
-      strategyVectorCreator.BoundsParameter.ValueChanged += new EventHandler(strategyVectorCreator_BoundsParameter_ValueChanged);
-      strategyVectorCreator.StrategyParameterParameter.ActualNameChanged += new EventHandler(strategyVectorCreator_StrategyParameterParameter_ActualNameChanged);
-    }
-    private void ParameterizeAnalyzers() {
-      if (BestSingleObjectiveTestFunctionSolutionAnalyzer != null) {
-        BestSingleObjectiveTestFunctionSolutionAnalyzer.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
-        BestSingleObjectiveTestFunctionSolutionAnalyzer.ResultsParameter.ActualName = "Results";
-        BestSingleObjectiveTestFunctionSolutionAnalyzer.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
-        BestSingleObjectiveTestFunctionSolutionAnalyzer.BestKnownQualityParameter.ActualName = BestKnownQualityParameter.Name;
-        BestSingleObjectiveTestFunctionSolutionAnalyzer.BestKnownSolutionParameter.ActualName = BestKnownSolutionParameter.Name;
-        BestSingleObjectiveTestFunctionSolutionAnalyzer.MaximizationParameter.ActualName = MaximizationParameter.Name;
-        BestSingleObjectiveTestFunctionSolutionAnalyzer.EvaluatorParameter.ActualName = EvaluatorParameter.Name;
-        BestSingleObjectiveTestFunctionSolutionAnalyzer.BoundsParameter.ActualName = BoundsParameter.Name;
-      }
-    }
     private void InitializeOperators() {
       Operators.Add(new SingleObjectiveTestFunctionImprovementOperator());
@@ -265,140 +164,45 @@
       Operators.Add(new QualitySimilarityCalculator());
       Operators.Add(new NoSimilarityCalculator());
+      Operators.Add(new AdditiveMoveEvaluator());
 
       Operators.Add(new BestSingleObjectiveTestFunctionSolutionAnalyzer());
       Operators.Add(new PopulationSimilarityAnalyzer(Operators.OfType<ISolutionSimilarityCalculator>()));
-      ParameterizeAnalyzers();
-      Operators.AddRange(ApplicationManager.Manager.GetInstances<IRealVectorOperator>().Cast<IOperator>());
-      Operators.Add(strategyVectorCreator);
-      Operators.Add(strategyVectorCrossover);
-      Operators.Add(strategyVectorManipulator);
-      UpdateMoveEvaluators();
-      ParameterizeOperators();
-      InitializeMoveGenerators();
-    }
-    private void InitializeMoveGenerators() {
-      foreach (IAdditiveRealVectorMoveOperator op in Operators.OfType<IAdditiveRealVectorMoveOperator>()) {
-        if (op is IMoveGenerator) {
-          op.AdditiveMoveParameter.ActualNameChanged += new EventHandler(MoveGenerator_AdditiveMoveParameter_ActualNameChanged);
-        }
-      }
-    }
-    private void UpdateMoveEvaluators() {
-      foreach (ISingleObjectiveTestFunctionMoveEvaluator op in Operators.OfType<ISingleObjectiveTestFunctionMoveEvaluator>().ToList())
-        Operators.Remove(op);
-      foreach (ISingleObjectiveTestFunctionMoveEvaluator op in ApplicationManager.Manager.GetInstances<ISingleObjectiveTestFunctionMoveEvaluator>())
-        if (op.EvaluatorType == Evaluator.GetType()) {
-          Operators.Add(op);
-          #region Synchronize evaluator specific parameters with the parameters of the corresponding move evaluators
-          if (op is ISphereMoveEvaluator) {
-            SphereEvaluator e = (Evaluator as SphereEvaluator);
-            e.AlphaParameter.ValueChanged += new EventHandler(SphereEvaluator_Parameter_ValueChanged);
-            e.CParameter.ValueChanged += new EventHandler(SphereEvaluator_Parameter_ValueChanged);
-            ISphereMoveEvaluator em = (op as ISphereMoveEvaluator);
-            em.C = e.C;
-            em.Alpha = e.Alpha;
-          } else if (op is IRastriginMoveEvaluator) {
-            RastriginEvaluator e = (Evaluator as RastriginEvaluator);
-            e.AParameter.ValueChanged += new EventHandler(RastriginEvaluator_Parameter_ValueChanged);
-            IRastriginMoveEvaluator em = (op as IRastriginMoveEvaluator);
-            em.A = e.A;
-          }
-          #endregion
-        }
-      ParameterizeOperators();
-      OnOperatorsChanged();
-    }
-    private void ParameterizeSolutionCreator() {
-      SolutionCreator.LengthParameter.Value = new IntValue(ProblemSize.Value);
-      SolutionCreator.LengthParameter.Hidden = true;
-      SolutionCreator.BoundsParameter.ActualName = BoundsParameter.Name;
-      SolutionCreator.BoundsParameter.Hidden = true;
-    }
-    private void ParameterizeEvaluator() {
-      Evaluator.PointParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
-      Evaluator.PointParameter.Hidden = true;
-      try {
-        BestKnownSolutionParameter.Value = Evaluator.GetBestKnownSolution(ProblemSize.Value);
-      }
-      catch (ArgumentException e) {
-        ErrorHandling.ShowErrorDialog(e);
-        ProblemSize.Value = Evaluator.MinimumProblemSize;
-      }
-    }
-    private void ParameterizeOperators() {
-      foreach (var op in Operators.OfType<IRealVectorCrossover>()) {
-        op.ParentsParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
-        op.ParentsParameter.Hidden = true;
-        op.ChildParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
-        op.ChildParameter.Hidden = true;
-        op.BoundsParameter.ActualName = BoundsParameter.Name;
-        op.BoundsParameter.Hidden = true;
-      }
-      foreach (var op in Operators.OfType<IRealVectorManipulator>()) {
-        op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
-        op.RealVectorParameter.Hidden = true;
-        op.BoundsParameter.ActualName = BoundsParameter.Name;
-        op.BoundsParameter.Hidden = true;
-      }
-      foreach (var op in Operators.OfType<IRealVectorMoveOperator>()) {
-        op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
-        op.RealVectorParameter.Hidden = true;
-      }
-      foreach (var op in Operators.OfType<IRealVectorMoveGenerator>()) {
-        op.BoundsParameter.ActualName = BoundsParameter.Name;
-        op.BoundsParameter.Hidden = true;
+      Parameterize();
+    }
+
+    private void Parameterize() {
+      var operators = new List<IItem>();
+      if (BestSingleObjectiveTestFunctionSolutionAnalyzer != null) {
+        operators.Add(BestSingleObjectiveTestFunctionSolutionAnalyzer);
+        BestSingleObjectiveTestFunctionSolutionAnalyzer.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
+        BestSingleObjectiveTestFunctionSolutionAnalyzer.BestKnownQualityParameter.ActualName = BestKnownQualityParameter.Name;
+        BestSingleObjectiveTestFunctionSolutionAnalyzer.BestKnownSolutionParameter.ActualName = BestKnownSolutionParameter.Name;
+        BestSingleObjectiveTestFunctionSolutionAnalyzer.MaximizationParameter.ActualName = MaximizationParameter.Name;
+        BestSingleObjectiveTestFunctionSolutionAnalyzer.TestFunctionParameter.ActualName = TestFunctionParameter.Name;
       }
       foreach (var op in Operators.OfType<ISingleObjectiveTestFunctionAdditiveMoveEvaluator>()) {
+        operators.Add(op);
         op.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
         op.QualityParameter.Hidden = true;
-        op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
-        op.RealVectorParameter.Hidden = true;
-      }
-      foreach (var op in Operators.OfType<IRealVectorParticleCreator>()) {
-        op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
-        op.RealVectorParameter.Hidden = true;
-        op.BoundsParameter.ActualName = BoundsParameter.Name;
-        op.BoundsParameter.Hidden = true;
-        op.ProblemSizeParameter.ActualName = ProblemSizeParameter.Name;
-        op.ProblemSizeParameter.Hidden = true;
-      }
-      foreach (var op in Operators.OfType<IRealVectorParticleUpdater>()) {
-        op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
-        op.RealVectorParameter.Hidden = true;
-        op.BoundsParameter.ActualName = BoundsParameter.Name;
-        op.BoundsParameter.Hidden = true;
+        foreach (var movOp in Encoding.Operators.OfType<IRealVectorAdditiveMoveQualityOperator>())
+          movOp.MoveQualityParameter.ActualName = op.MoveQualityParameter.ActualName;
       }
       foreach (var op in Operators.OfType<IRealVectorSwarmUpdater>()) {
-        op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
-        op.RealVectorParameter.Hidden = true;
         op.MaximizationParameter.ActualName = MaximizationParameter.Name;
         op.MaximizationParameter.Hidden = true;
       }
-      foreach (var op in Operators.OfType<IRealVectorMultiNeighborhoodShakingOperator>()) {
-        op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
-        op.RealVectorParameter.Hidden = true;
-      }
       foreach (var op in Operators.OfType<ISingleObjectiveImprovementOperator>()) {
-        op.SolutionParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
+        operators.Add(op);
+        op.SolutionParameter.ActualName = Encoding.Name;
         op.SolutionParameter.Hidden = true;
       }
-      foreach (var op in Operators.OfType<ISingleObjectivePathRelinker>()) {
-        op.ParentsParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
-        op.ParentsParameter.Hidden = true;
-      }
-      foreach (var op in Operators.OfType<ISolutionSimilarityCalculator>()) {
-        op.SolutionVariableName = SolutionCreator.RealVectorParameter.ActualName;
+      foreach (var op in Operators.OfType<ITestFunctionSolutionSimilarityCalculator>()) {
+        operators.Add(op);
+        op.SolutionVariableName = Encoding.Name;
         op.QualityVariableName = Evaluator.QualityParameter.ActualName;
-        var calc = op as SingleObjectiveTestFunctionSimilarityCalculator;
-        if (calc != null) calc.Bounds = Bounds;
-      }
-    }
-    private void UpdateStrategyVectorBounds() {
-      var strategyBounds = (DoubleMatrix)Bounds.Clone();
-      for (int i = 0; i < strategyBounds.Rows; i++) {
-        if (strategyBounds[i, 0] < 0) strategyBounds[i, 0] = 0;
-        strategyBounds[i, 1] = 0.1 * (Bounds[i, 1] - Bounds[i, 0]);
-      }
-      strategyVectorCreator.BoundsParameter.Value = strategyBounds;
+        op.Bounds = Bounds;
+      }
+
+      if (operators.Count > 0) Encoding.ConfigureOperators(operators);
     }
     #endregion
@@ -407,5 +211,5 @@
       Name = data.Name;
       Description = data.Description;
-      Evaluator = data.Evaluator;
+      TestFunction = data.TestFunction;
     }
   }
