Index: /branches/VNS/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearchImprovement.cs
===================================================================
--- /branches/VNS/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearchImprovement.cs	(revision 5641)
+++ /branches/VNS/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearchImprovement.cs	(revision 5642)
@@ -44,12 +44,12 @@
     private LocalSearchMainLoop loop;
     
-    private /*Constrained*/ValueParameter<IMoveGenerator> MoveGeneratorParameter {
-      get { return (/*Constrained*/ValueParameter<IMoveGenerator>)Parameters["MoveGenerator"]; }
-    }
-    private /*Constrained*/ValueParameter<IMoveMaker> MoveMakerParameter {
-      get { return (/*Constrained*/ValueParameter<IMoveMaker>)Parameters["MoveMaker"]; }
-    }
-    private /*Constrained*/ValueParameter<ISingleObjectiveMoveEvaluator> MoveEvaluatorParameter {
-      get { return (/*Constrained*/ValueParameter<ISingleObjectiveMoveEvaluator>)Parameters["MoveEvaluator"]; }
+    private ConstrainedValueParameter<IMoveGenerator> MoveGeneratorParameter {
+      get { return (ConstrainedValueParameter<IMoveGenerator>)Parameters["MoveGenerator"]; }
+    }
+    private ConstrainedValueParameter<IMoveMaker> MoveMakerParameter {
+      get { return (ConstrainedValueParameter<IMoveMaker>)Parameters["MoveMaker"]; }
+    }
+    private ConstrainedValueParameter<ISingleObjectiveMoveEvaluator> MoveEvaluatorParameter {
+      get { return (ConstrainedValueParameter<ISingleObjectiveMoveEvaluator>)Parameters["MoveEvaluator"]; }
     }
     private ValueParameter<IntValue> MaximumIterationsParameter {
@@ -80,8 +80,13 @@
 
     [StorableConstructor]
-    protected LocalSearchImprovement(bool deserializing) : base(deserializing) { }
+    protected LocalSearchImprovement(bool deserializing) : base(deserializing) {}
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      Initialize();
+    }
     protected LocalSearchImprovement(LocalSearchImprovement original, Cloner cloner)
       : base(original, cloner) {
         this.loop = cloner.Clone(original.loop);
+        Initialize();
     }
     public override IDeepCloneable Clone(Cloner cloner) {
@@ -92,20 +97,39 @@
         loop = new LocalSearchMainLoop(new BoolValue(true));
 
-        Parameters.Add(new /*Constrained*/ValueParameter<IMoveGenerator>("MoveGenerator", "The operator used to generate moves to the neighborhood of the current solution."));
-        Parameters.Add(new /*Constrained*/ValueParameter<IMoveMaker>("MoveMaker", "The operator used to perform a move."));
-        Parameters.Add(new /*Constrained*/ValueParameter<ISingleObjectiveMoveEvaluator>("MoveEvaluator", "The operator used to evaluate a move."));
+        Parameters.Add(new ConstrainedValueParameter<IMoveGenerator>("MoveGenerator", "The operator used to generate moves to the neighborhood of the current solution."));
+        Parameters.Add(new ConstrainedValueParameter<IMoveMaker>("MoveMaker", "The operator used to perform a move."));
+        Parameters.Add(new ConstrainedValueParameter<ISingleObjectiveMoveEvaluator>("MoveEvaluator", "The operator used to evaluate a move."));
         Parameters.Add(new ValueParameter<IntValue>("MaximumIterations", "The maximum number of generations which should be processed.", new IntValue(1000)));
         Parameters.Add(new ValueParameter<IntValue>("SampleSize", "Number of moves that MultiMoveGenerators should create. This is ignored for Exhaustive- and SingleMoveGenerators.", new IntValue(100)));
         Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of evaluated moves."));
         Parameters.Add(new LookupParameter<IOperator>("Analyzer", "The operator used to analyze the solution."));
+
+        Initialize();
+    }
+
+    private void Initialize() {
+      MoveGeneratorParameter.ValueChanged += new EventHandler(MoveGeneratorParameter_ValueChanged);
     }
 
     public void Parameterize(IProblem problem) {
       UpdateMoveOperators(problem);
+      ChooseMoveOperators();
+
+      ParameterizeMoveGenerators(problem as ISingleObjectiveProblem);
+      ParameterizeMoveEvaluators(problem as ISingleObjectiveProblem);
+      ParameterizeMoveMakers(problem as ISingleObjectiveProblem);
+    }
+
+    void MoveGeneratorParameter_ValueChanged(object sender, EventArgs e) {
+      ChooseMoveOperators();
     }
 
     private void UpdateMoveOperators(IProblem problem) {
-     /* IMoveGenerator oldMoveGenerator = MoveGenerator;
-      MoveGeneratorParameter.ValidValues.Clear();
+      IMoveGenerator oldMoveGenerator = MoveGenerator;
+      IMoveMaker oldMoveMaker = MoveMaker;
+      ISingleObjectiveMoveEvaluator oldMoveEvaluator = MoveEvaluator;
+
+      ClearMoveParameters();
+
       if (problem != null) {
         foreach (IMoveGenerator generator in problem.Operators.OfType<IMoveGenerator>().OrderBy(x => x.Name))
@@ -127,5 +151,4 @@
       }
 
-      IMoveMaker oldMoveMaker = MoveMaker;
       if (oldMoveMaker != null) {
         IMoveMaker mm = MoveMakerParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldMoveMaker.GetType());
@@ -133,14 +156,69 @@
       }
 
-      ISingleObjectiveMoveEvaluator oldMoveEvaluator = MoveEvaluator;
       if (oldMoveEvaluator != null) {
         ISingleObjectiveMoveEvaluator me = MoveEvaluatorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldMoveEvaluator.GetType());
         if (me != null) MoveEvaluator = me;
-      }*/
+      }
+    }
+
+    private void ChooseMoveOperators() {
+      IMoveMaker oldMoveMaker = MoveMaker;
+      ISingleObjectiveMoveEvaluator oldMoveEvaluator = MoveEvaluator;
+
+      if (MoveGenerator != null) {
+        List<Type> moveTypes = MoveGenerator.GetType().GetInterfaces().Where(x => typeof(IMoveOperator).IsAssignableFrom(x)).ToList();
+        foreach (Type type in moveTypes.ToList()) {
+          if (moveTypes.Any(t => t != type && type.IsAssignableFrom(t)))
+            moveTypes.Remove(type);
+        }
+        List<IMoveMaker> validMoveMakers = new List<IMoveMaker>();
+        List<ISingleObjectiveMoveEvaluator> validMoveEvaluators = new List<ISingleObjectiveMoveEvaluator>();
+
+        foreach (Type type in moveTypes) {
+          var moveMakers = MoveMakerParameter.ValidValues.Where(x => type.IsAssignableFrom(x.GetType())).OrderBy(x => x.Name);
+          foreach (IMoveMaker moveMaker in moveMakers)
+            validMoveMakers.Add(moveMaker);
+
+          var moveEvaluators = MoveEvaluatorParameter.ValidValues.Where(x => type.IsAssignableFrom(x.GetType())).OrderBy(x => x.Name);
+          foreach (ISingleObjectiveMoveEvaluator moveEvaluator in moveEvaluators)
+            validMoveEvaluators.Add(moveEvaluator);
+        }
+        if (oldMoveMaker != null) {
+          IMoveMaker mm = validMoveMakers.FirstOrDefault(x => x.GetType() == oldMoveMaker.GetType());
+          if (mm != null) MoveMaker = mm;
+          else MoveMaker = validMoveMakers.FirstOrDefault();
+        } 
+
+        if (oldMoveEvaluator != null) {
+          ISingleObjectiveMoveEvaluator me = validMoveEvaluators.FirstOrDefault(x => x.GetType() == oldMoveEvaluator.GetType());
+          if (me != null) MoveEvaluator = me;
+          else MoveEvaluator = validMoveEvaluators.FirstOrDefault();
+        } 
+      }
     }
 
     private void ClearMoveParameters() {
-      /*MoveMakerParameter.ValidValues.Clear();
-      MoveEvaluatorParameter.ValidValues.Clear();*/
+      MoveGeneratorParameter.ValidValues.Clear();
+      MoveMakerParameter.ValidValues.Clear();
+      MoveEvaluatorParameter.ValidValues.Clear();
+    }
+
+    private void ParameterizeMoveGenerators(ISingleObjectiveProblem problem) {
+      if (problem != null) {
+        foreach (IMultiMoveGenerator generator in problem.Operators.OfType<IMultiMoveGenerator>())
+          generator.SampleSizeParameter.ActualName = SampleSizeParameter.Name;
+      }
+    }
+    private void ParameterizeMoveEvaluators(ISingleObjectiveProblem problem) {
+      foreach (ISingleObjectiveMoveEvaluator op in problem.Operators.OfType<ISingleObjectiveMoveEvaluator>()) {
+        op.QualityParameter.ActualName = problem.Evaluator.QualityParameter.ActualName;
+      }
+    }
+    private void ParameterizeMoveMakers(ISingleObjectiveProblem problem) {
+      foreach (IMoveMaker op in problem.Operators.OfType<IMoveMaker>()) {
+        op.QualityParameter.ActualName = problem.Evaluator.QualityParameter.ActualName;
+        if (MoveEvaluator != null)
+          op.MoveQualityParameter.ActualName = MoveEvaluator.MoveQualityParameter.ActualName;
+      }
     }
 
Index: /branches/VNS/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3/HeuristicLab.Algorithms.VariableNeighborhoodSearch-3.3.csproj
===================================================================
--- /branches/VNS/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3/HeuristicLab.Algorithms.VariableNeighborhoodSearch-3.3.csproj	(revision 5641)
+++ /branches/VNS/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3/HeuristicLab.Algorithms.VariableNeighborhoodSearch-3.3.csproj	(revision 5642)
@@ -108,4 +108,5 @@
   <ItemGroup>
     <Compile Include="HeuristicLabAlgorithmsVariableNeighborhoodSearchPlugin.cs" />
+    <Compile Include="IShakingOperator.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="ShakingOperator.cs" />
Index: /branches/VNS/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3/IShakingOperator.cs
===================================================================
--- /branches/VNS/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3/IShakingOperator.cs	(revision 5642)
+++ /branches/VNS/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3/IShakingOperator.cs	(revision 5642)
@@ -0,0 +1,33 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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 System.Text;
+using HeuristicLab.Optimization;
+using HeuristicLab.Core;
+
+namespace HeuristicLab.Algorithms.VariableNeighborhoodSearch {
+  public interface IShakingOperator: IManipulator {
+    void Parameterize(IProblem problem);
+  }
+}
Index: /branches/VNS/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3/ShakingOperator.cs
===================================================================
--- /branches/VNS/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3/ShakingOperator.cs	(revision 5641)
+++ /branches/VNS/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3/ShakingOperator.cs	(revision 5642)
@@ -38,5 +38,5 @@
   [Item("ShakingOperator", "A shaking operator for VNS.")]
   [StorableClass]
-  public class ShakingOperator: CheckedMultiOperator<IManipulator> {
+  public class ShakingOperator<T> : CheckedMultiOperator<T>, IShakingOperator where T : class, IManipulator {
     public IValueLookupParameter<IntValue> IndexParameter {
       get { return (ValueLookupParameter<IntValue>)Parameters["Index"]; }
@@ -49,7 +49,7 @@
     [StorableConstructor]
     protected ShakingOperator(bool deserializing) : base(deserializing) { }
-    protected ShakingOperator(ShakingOperator original, Cloner cloner) : base(original, cloner) { }
+    protected ShakingOperator(ShakingOperator<T> original, Cloner cloner) : base(original, cloner) { }
     public override IDeepCloneable Clone(Cloner cloner) {
-      return new ShakingOperator(this, cloner);
+      return new ShakingOperator<T>(this, cloner);
     }
     public ShakingOperator()
@@ -57,4 +57,13 @@
       Parameters.Add(new ValueLookupParameter<IntValue>("Index", "The index of the operator that should be applied (k)."));
       Parameters.Add(new LookupParameter<BoolValue>("Continue", "True if k <= available operators."));
+    }
+
+    public void Parameterize(IProblem problem) {
+      Operators.Clear();
+
+      if (problem != null) {
+        foreach (T manipulator in problem.Operators.OfType<T>().OrderBy(x => x.Name))
+          Operators.Add(manipulator);
+      }
     }
 
Index: /branches/VNS/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3/VariableNeighborhoodSearch.cs
===================================================================
--- /branches/VNS/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3/VariableNeighborhoodSearch.cs	(revision 5641)
+++ /branches/VNS/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3/VariableNeighborhoodSearch.cs	(revision 5642)
@@ -39,12 +39,9 @@
       get { return (ValueParameter<BoolValue>)Parameters["SetSeedRandomly"]; }
     }
-    public /*Constrained*/ValueParameter<ISingleObjectiveEvaluator> EvaluatorParameter {
-      get { return (/*Constrained*/ValueParameter<ISingleObjectiveEvaluator>)Parameters["Evaluator"]; }
-    }
     private ValueParameter<ILocalImprovement> LocalImprovementParameter {
       get { return (ValueParameter<ILocalImprovement>)Parameters["LocalImprovement"]; }
     }
-    private ValueParameter<ShakingOperator> ShakingParameter {
-      get { return (ValueParameter<ShakingOperator>)Parameters["Shaking"]; }
+    private ValueParameter<IShakingOperator> ShakingParameter {
+      get { return (ValueParameter<IShakingOperator>)Parameters["Shaking"]; }
     }
     private ValueParameter<IntValue> MaximumIterationsParameter {
@@ -53,4 +50,7 @@
     private ValueParameter<MultiAnalyzer> AnalyzerParameter {
       get { return (ValueParameter<MultiAnalyzer>)Parameters["Analyzer"]; }
+    }
+    private VariableNeighborhoodSearchMainLoop VNSMainLoop {
+      get { return FindMainLoop(SolutionsCreator.Successor); }
     }
     #endregion
@@ -60,5 +60,15 @@
       get { return (RandomCreator)OperatorGraph.InitialOperator; }
     }
-    #endregion
+    public MultiAnalyzer Analyzer {
+      get { return AnalyzerParameter.Value; }
+      set { AnalyzerParameter.Value = value; }
+    }
+    private SolutionsCreator SolutionsCreator {
+      get { return (SolutionsCreator)RandomCreator.Successor; }
+    }
+    #endregion
+
+    [Storable]
+    private BestAverageWorstQualityAnalyzer qualityAnalyzer;
 
     [StorableConstructor]
@@ -70,5 +80,6 @@
     private VariableNeighborhoodSearch(VariableNeighborhoodSearch original, Cloner cloner)
       : base(original, cloner) {
-
+      qualityAnalyzer = cloner.Clone(original.qualityAnalyzer);
+      Initialize();
     }
     public override IDeepCloneable Clone(Cloner cloner) {
@@ -79,7 +90,6 @@
       Parameters.Add(new ValueParameter<IntValue>("Seed", "The random seed used to initialize the new pseudo random number generator.", new IntValue(0)));
       Parameters.Add(new ValueParameter<BoolValue>("SetSeedRandomly", "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true)));
-      Parameters.Add(new /*Constrained*/ValueParameter<ISingleObjectiveEvaluator>("Evaluator", "The operator used to evaluate the solutions."));
       Parameters.Add(new ValueParameter<ILocalImprovement>("LocalImprovement", "The local improvement operation", new LocalSearchImprovement()));
-      Parameters.Add(new ValueParameter<ShakingOperator>("Shaking", "The shaking operation", new ShakingOperator()));
+      Parameters.Add(new ValueParameter<IShakingOperator>("Shaking", "The shaking operation"));
       Parameters.Add(new ValueParameter<IntValue>("MaximumIterations", "The maximum number of generations which should be processed.", new IntValue(1000)));
       Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze the solution and moves.", new MultiAnalyzer()));
@@ -112,5 +122,4 @@
       mainLoop.LocalImprovementParameter.ActualName = LocalImprovementParameter.Name;
       mainLoop.ShakingParameter.ActualName = ShakingParameter.Name;
-      mainLoop.EvaluatorParameter.ActualName = EvaluatorParameter.Name;
       mainLoop.MaximumIterationsParameter.ActualName = MaximumIterationsParameter.Name;
       mainLoop.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName;
@@ -119,6 +128,164 @@
       mainLoop.EvaluatedSolutionsParameter.ActualName = "EvaluatedSolutions";
 
-      /*Initialize();*/
-    }
+      qualityAnalyzer = new BestAverageWorstQualityAnalyzer();
+      ParameterizeAnalyzers();
+      UpdateAnalyzers();
+
+      Initialize();
+    }
+
+    public override void Prepare() {
+      if (Problem != null) base.Prepare();
+    }
+
+    private void Initialize() {
+      if (Problem != null) {
+        Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
+      }
+    }
+
+    #region Events
+    protected override void OnProblemChanged() {
+      ParameterizeStochasticOperator(Problem.SolutionCreator);
+      ParameterizeStochasticOperator(Problem.Evaluator);
+      foreach (IOperator op in Problem.Operators) ParameterizeStochasticOperator(op);
+      ParameterizeSolutionsCreator();
+      ParameterizeVNSMainLoop();
+      ParameterizeAnalyzers();
+      ParameterizeIterationBasedOperators();
+      UpdateShakingOperator();
+      UpdateLocalImprovementOperator();
+      UpdateAnalyzers();
+      Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
+      base.OnProblemChanged();
+    }
+
+    protected override void Problem_SolutionCreatorChanged(object sender, EventArgs e) {
+      ParameterizeStochasticOperator(Problem.SolutionCreator);
+      ParameterizeSolutionsCreator();
+      base.Problem_SolutionCreatorChanged(sender, e);
+    }
+    protected override void Problem_EvaluatorChanged(object sender, EventArgs e) {
+      ParameterizeStochasticOperator(Problem.Evaluator);
+      ParameterizeSolutionsCreator();
+      ParameterizeVNSMainLoop();
+      ParameterizeAnalyzers();
+      Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
+      base.Problem_EvaluatorChanged(sender, e);
+    }
+    protected override void Problem_OperatorsChanged(object sender, EventArgs e) {
+      foreach (IOperator op in Problem.Operators) ParameterizeStochasticOperator(op);
+      ParameterizeIterationBasedOperators();
+      UpdateShakingOperator();
+      UpdateLocalImprovementOperator();
+      UpdateAnalyzers();
+      base.Problem_OperatorsChanged(sender, e);
+    }
+
+    private void Evaluator_QualityParameter_ActualNameChanged(object sender, EventArgs e) {
+      ParameterizeVNSMainLoop();
+      ParameterizeAnalyzers();
+    }
+    #endregion
+
+    #region Helpers
+    private void ParameterizeSolutionsCreator() {
+      SolutionsCreator.EvaluatorParameter.ActualName = Problem.EvaluatorParameter.Name;
+      SolutionsCreator.SolutionCreatorParameter.ActualName = Problem.SolutionCreatorParameter.Name;
+    }
+    private void ParameterizeStochasticOperator(IOperator op) {
+      if (op is IStochasticOperator)
+        ((IStochasticOperator)op).RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName;
+    }
+    private void ParameterizeVNSMainLoop() {
+      VNSMainLoop.EvaluatorParameter.ActualName = Problem.EvaluatorParameter.Name;
+      VNSMainLoop.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
+      VNSMainLoop.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
+    }
+    private void ParameterizeAnalyzers() {
+      qualityAnalyzer.ResultsParameter.ActualName = "Results";
+      if (Problem != null) {
+        qualityAnalyzer.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
+        qualityAnalyzer.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
+        qualityAnalyzer.QualityParameter.Depth = 1;
+        qualityAnalyzer.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name;
+      }
+    }
+    private void ParameterizeIterationBasedOperators() {
+      if (Problem != null) {
+        foreach (IIterationBasedOperator op in Problem.Operators.OfType<IIterationBasedOperator>()) {
+          op.IterationsParameter.ActualName = "OuterIterations";
+          op.MaximumIterationsParameter.ActualName = "MaximumIterations";
+        }
+      }
+    }
+    private void UpdateShakingOperator() {
+      Type manipulatorType = typeof(IManipulator);
+      List<Type> manipulatorInterfaces = new List<Type>();
+
+      foreach (IManipulator mutator in Problem.Operators.OfType<IManipulator>().OrderBy(x => x.Name)) {
+        Type t = mutator.GetType();
+        Type[] interfaces = t.GetInterfaces();
+
+        for(int i = 0; i < interfaces.Length; i++) {
+          if (manipulatorType.IsAssignableFrom(interfaces[i])) {
+            bool assignable = false;
+            for (int j = 0; j < interfaces.Length; j++) {
+              if (i != j && interfaces[i].IsAssignableFrom(interfaces[j])) {
+                assignable = true;
+                break;
+              }
+            }
+
+            if(!assignable)
+              manipulatorInterfaces.Add(interfaces[i]);
+          }         
+        }
+      }
+
+      foreach (Type manipulatorInterface in manipulatorInterfaces) {
+        //manipulatorInterface is more specific
+        if (manipulatorType.IsAssignableFrom(manipulatorInterface)) {
+          //and compatible to all other found manipulator types
+          bool compatible = true;
+          foreach (Type manipulatorInterface2 in manipulatorInterfaces) {
+            if (!manipulatorInterface.IsAssignableFrom(manipulatorInterface2)) {
+              compatible = false;
+              break;
+            }
+          }
+
+          if (compatible)
+            manipulatorType = manipulatorInterface;
+        }
+      }
+      
+      Type genericType = typeof(ShakingOperator<>).MakeGenericType(manipulatorType);
+      ShakingParameter.Value = (IShakingOperator)Activator.CreateInstance(genericType, new object[]{});
+
+      ShakingParameter.Value.Parameterize(Problem);
+    }
+    private void UpdateLocalImprovementOperator() {
+      LocalImprovementParameter.Value.Parameterize(Problem);
+    }
+    private void UpdateAnalyzers() {
+      Analyzer.Operators.Clear();
+      if (Problem != null) {
+        foreach (IAnalyzer analyzer in Problem.Operators.OfType<IAnalyzer>()) {
+          foreach (IScopeTreeLookupParameter param in analyzer.Parameters.OfType<IScopeTreeLookupParameter>())
+            param.Depth = 1;
+          Analyzer.Operators.Add(analyzer);
+        }
+      }
+      Analyzer.Operators.Add(qualityAnalyzer);
+    }
+    private VariableNeighborhoodSearchMainLoop FindMainLoop(IOperator start) {
+      IOperator mainLoop = start;
+      while (mainLoop != null && !(mainLoop is VariableNeighborhoodSearchMainLoop))
+        mainLoop = ((SingleSuccessorOperator)mainLoop).Successor;
+      if (mainLoop == null) return null;
+      else return (VariableNeighborhoodSearchMainLoop)mainLoop;
+    }
+    #endregion
   }
 }
Index: /branches/VNS/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3/VariableNeighborhoodSearchMainLoop.cs
===================================================================
--- /branches/VNS/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3/VariableNeighborhoodSearchMainLoop.cs	(revision 5641)
+++ /branches/VNS/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3/VariableNeighborhoodSearchMainLoop.cs	(revision 5642)
@@ -72,6 +72,6 @@
       get { return (ValueLookupParameter<ILocalImprovement>)Parameters["LocalImprovement"]; }
     }
-    public ValueLookupParameter<ShakingOperator> ShakingParameter {
-      get { return (ValueLookupParameter<ShakingOperator>)Parameters["Shaking"]; }
+    public ValueLookupParameter<IShakingOperator> ShakingParameter {
+      get { return (ValueLookupParameter<IShakingOperator>)Parameters["Shaking"]; }
     }
     #endregion
@@ -103,5 +103,5 @@
       Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of evaluated solutions."));
       Parameters.Add(new ValueLookupParameter<ILocalImprovement>("LocalImprovement", "The local improvement operation."));
-      Parameters.Add(new ValueLookupParameter<ShakingOperator>("Shaking", "The shaking operation."));
+      Parameters.Add(new ValueLookupParameter<IShakingOperator>("Shaking", "The shaking operation."));
       #endregion
 
@@ -148,5 +148,5 @@
 
       variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("OuterIterations", new IntValue(0)));
-      variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("Index", new DoubleValue(0)));
+      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Index", new IntValue(0)));
       variableCreator.CollectedValues.Add(new ValueParameter<BoolValue>("Continue", new BoolValue(false)));
       variableCreator.CollectedValues.Add(new ValueParameter<BoolValue>("IsBetter", new BoolValue(false)));
@@ -242,8 +242,8 @@
       #region Create operator graph
       OperatorGraph.InitialOperator = variableCreator;
-      variableCreator.Successor = analyzer1;
-      analyzer1.Successor = subScopesProcessor0;
+      variableCreator.Successor = subScopesProcessor0;
       subScopesProcessor0.Operators.Add(bestQualityInitializer);
-      subScopesProcessor0.Successor = resultsCollector1;
+      subScopesProcessor0.Successor = analyzer1;
+      analyzer1.Successor = resultsCollector1;
       /////////
       resultsCollector1.Successor = iteration;
