Index: /branches/VNS/HeuristicLab.Algorithms.LocalSearch/3.3/HeuristicLab.Algorithms.LocalSearch-3.3.csproj
===================================================================
--- /branches/VNS/HeuristicLab.Algorithms.LocalSearch/3.3/HeuristicLab.Algorithms.LocalSearch-3.3.csproj	(revision 5621)
+++ /branches/VNS/HeuristicLab.Algorithms.LocalSearch/3.3/HeuristicLab.Algorithms.LocalSearch-3.3.csproj	(revision 5622)
@@ -12,5 +12,6 @@
     <AssemblyName>HeuristicLab.Algorithms.LocalSearch-3.3</AssemblyName>
     <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
-    <TargetFrameworkProfile></TargetFrameworkProfile>
+    <TargetFrameworkProfile>
+    </TargetFrameworkProfile>
     <FileAlignment>512</FileAlignment>
     <SignAssembly>true</SignAssembly>
@@ -107,4 +108,5 @@
   <ItemGroup>
     <Compile Include="HeuristicLabAlgorithmsLocalSearchPlugin.cs" />
+    <Compile Include="LocalSearchImprovement.cs" />
     <Compile Include="LocalSearchMainLoop.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
Index: /branches/VNS/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearchImprovement.cs
===================================================================
--- /branches/VNS/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearchImprovement.cs	(revision 5622)
+++ /branches/VNS/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearchImprovement.cs	(revision 5622)
@@ -0,0 +1,206 @@
+﻿#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.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Operators;
+using HeuristicLab.Common;
+using HeuristicLab.Parameters;
+using HeuristicLab.Algorithms.LocalSearch;
+using HeuristicLab.Data;
+using HeuristicLab.Optimization;
+using HeuristicLab.Optimization.Operators;
+
+namespace HeuristicLab.Algorithms.LocalSearch {
+  /// <summary>
+  /// A local search improvement operator.
+  /// </summary>
+  [Item("LocalSearchImprovement", "A local search improvement operator.")]
+  [StorableClass]
+  public class LocalSearchImprovement: SingleSuccessorOperator, ILocalImprovement {
+    [Storable]
+    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 ValueParameter<IntValue> MaximumIterationsParameter {
+      get { return (ValueParameter<IntValue>)Parameters["MaximumIterations"]; }
+    }
+    private ValueParameter<IntValue> SampleSizeParameter {
+      get { return (ValueParameter<IntValue>)Parameters["SampleSize"]; }
+    }
+    public LookupParameter<IntValue> EvaluatedSolutionsParameter {
+      get { return (LookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; }
+    }
+    public LookupParameter<IOperator> AnalyzerParameter {
+      get { return (LookupParameter<IOperator>)Parameters["Analyzer"]; }
+    }
+
+    public IMoveGenerator MoveGenerator {
+      get { return MoveGeneratorParameter.Value; }
+      set { MoveGeneratorParameter.Value = value; }
+    }
+    public IMoveMaker MoveMaker {
+      get { return MoveMakerParameter.Value; }
+      set { MoveMakerParameter.Value = value; }
+    }
+    public ISingleObjectiveMoveEvaluator MoveEvaluator {
+      get { return MoveEvaluatorParameter.Value; }
+      set { MoveEvaluatorParameter.Value = value; }
+    }
+
+    [StorableConstructor]
+    protected LocalSearchImprovement(bool deserializing) : base(deserializing) { }
+    protected LocalSearchImprovement(LocalSearchImprovement original, Cloner cloner)
+      : base(original, cloner) {
+        this.loop = cloner.Clone(original.loop);
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new LocalSearchImprovement(this, cloner);
+    }
+    public LocalSearchImprovement()
+      : base() {
+        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 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."));
+    }
+
+    public void Parameterize(IProblem problem) {
+      UpdateMoveOperators(problem);
+    }
+
+    private void UpdateMoveOperators(IProblem problem) {
+     /* IMoveGenerator oldMoveGenerator = MoveGenerator;
+      MoveGeneratorParameter.ValidValues.Clear();
+      if (problem != null) {
+        foreach (IMoveGenerator generator in problem.Operators.OfType<IMoveGenerator>().OrderBy(x => x.Name))
+          MoveGeneratorParameter.ValidValues.Add(generator);
+
+        foreach (IMoveMaker maker in problem.Operators.OfType<IMoveMaker>().OrderBy(x => x.Name))
+          MoveMakerParameter.ValidValues.Add(maker);
+
+        foreach (ISingleObjectiveMoveEvaluator evaluator in problem.Operators.OfType<ISingleObjectiveMoveEvaluator>().OrderBy(x => x.Name))
+          MoveEvaluatorParameter.ValidValues.Add(evaluator);
+      }
+
+      if (oldMoveGenerator != null) {
+        IMoveGenerator newMoveGenerator = MoveGeneratorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldMoveGenerator.GetType());
+        if (newMoveGenerator != null) MoveGenerator = newMoveGenerator;
+      }
+      if (MoveGenerator == null) {
+        ClearMoveParameters();
+      }
+
+      IMoveMaker oldMoveMaker = MoveMaker;
+      if (oldMoveMaker != null) {
+        IMoveMaker mm = MoveMakerParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldMoveMaker.GetType());
+        if (mm != null) MoveMaker = mm;
+      }
+
+      ISingleObjectiveMoveEvaluator oldMoveEvaluator = MoveEvaluator;
+      if (oldMoveEvaluator != null) {
+        ISingleObjectiveMoveEvaluator me = MoveEvaluatorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldMoveEvaluator.GetType());
+        if (me != null) MoveEvaluator = me;
+      }*/
+    }
+
+    private void ClearMoveParameters() {
+      /*MoveMakerParameter.ValidValues.Clear();
+      MoveEvaluatorParameter.ValidValues.Clear();*/
+    }
+
+    public override IOperation Apply() {
+      Scope subScope = new Scope();
+      Scope individual = new Scope();
+
+      foreach (Variable var in ExecutionContext.Scope.Variables) {
+        individual.Variables.Add(var);
+      }
+      subScope.SubScopes.Add(individual);
+
+      ExecutionContext.Scope.SubScopes.Add(subScope);
+      int index = subScope.Parent.SubScopes.IndexOf(subScope);
+
+      SubScopesProcessor processor = new SubScopesProcessor();
+      SubScopesRemover remover = new SubScopesRemover();
+
+      remover.RemoveAllSubScopes = false;
+      remover.SubScopeIndexParameter.Value = new IntValue(index);
+
+      for (int i = 0; i < index; i++) {
+        processor.Operators.Add(new EmptyOperator());
+      }
+
+      loop.MoveGeneratorParameter.Value = MoveGeneratorParameter.Value;
+      if (loop.MoveGeneratorParameter.Value != null && loop.MoveGeneratorParameter.Value.Parameters.ContainsKey("SampleSize")) {
+        IParameter parameter = loop.MoveGeneratorParameter.Value.Parameters["SampleSize"];
+        if(parameter is IValueParameter)
+          (parameter as IValueParameter).Value = SampleSizeParameter.Value;
+      }
+      loop.MoveEvaluatorParameter.Value = MoveEvaluatorParameter.Value;
+      loop.MoveMakerParameter.Value = MoveMakerParameter.Value;
+      loop.MaximumIterationsParameter.Value = MaximumIterationsParameter.Value;
+      loop.EvaluatedMovesParameter.ActualName = EvaluatedSolutionsParameter.ActualName;
+      if (AnalyzerParameter.ActualValue != null) {
+        loop.AnalyzerParameter.Value = AnalyzerParameter.ActualValue.Clone() as IAnalyzer;
+
+        foreach (IScopeTreeLookupParameter param in loop.AnalyzerParameter.Value.Parameters.OfType<IScopeTreeLookupParameter>())
+          param.Depth = 0;
+
+        if (loop.AnalyzerParameter.Value is IMultiAnalyzer) {
+          foreach (IAnalyzer analyzer in (loop.AnalyzerParameter.Value as IMultiAnalyzer).Operators) {
+            foreach (IScopeTreeLookupParameter param in analyzer.Parameters.OfType<IScopeTreeLookupParameter>())
+              param.Depth = 0;
+          }
+        }
+      } else {
+        loop.AnalyzerParameter.Value = null;
+      }
+            
+      processor.Operators.Add(loop);
+      processor.Successor = remover;
+
+      IOperation next = base.Apply();
+      if (next as ExecutionContext != null) {
+        remover.Successor = (next as ExecutionContext).Operator;
+      }
+
+      return ExecutionContext.CreateOperation(processor);
+    }
+  }
+}
Index: /branches/VNS/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearchMainLoop.cs
===================================================================
--- /branches/VNS/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearchMainLoop.cs	(revision 5621)
+++ /branches/VNS/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearchMainLoop.cs	(revision 5622)
@@ -79,5 +79,9 @@
     public LocalSearchMainLoop()
       : base() {
-      Initialize();
+      Initialize(false);
+    }
+    public LocalSearchMainLoop(BoolValue nested)
+      : base() {
+      Initialize(nested.Value);
     }
     private LocalSearchMainLoop(LocalSearchMainLoop original, Cloner cloner)
@@ -88,5 +92,5 @@
     }
 
-    private void Initialize() {
+    private void Initialize(bool nested) {
       #region Create parameters
       Parameters.Add(new ValueLookupParameter<IRandom>("Random", "A pseudo random number generator."));
@@ -132,5 +136,7 @@
 
       variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Iterations", new IntValue(0))); // Class LocalSearch expects this to be called Iterations
-      variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("BestQuality", new DoubleValue(0)));
+      if (!nested) {
+        variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("BestQuality", new DoubleValue(0)));
+      }
 
       bestQualityInitializer.Name = "Initialize BestQuality";
@@ -143,5 +149,7 @@
       resultsCollector1.CopyValue = new BoolValue(false);
       resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Iterations"));
-      resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality"));
+      if (!nested) {
+        resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality"));
+      }
       resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name;
 
@@ -197,5 +205,9 @@
       OperatorGraph.InitialOperator = variableCreator;
       variableCreator.Successor = subScopesProcessor0;
-      subScopesProcessor0.Operators.Add(bestQualityInitializer);
+      if (!nested) {
+        subScopesProcessor0.Operators.Add(bestQualityInitializer);
+      } else {
+        subScopesProcessor0.Operators.Add(analyzer1);
+      }
       subScopesProcessor0.Successor = resultsCollector1;
       bestQualityInitializer.Successor = analyzer1;
@@ -218,5 +230,9 @@
       improvesQualityBranch.FalseBranch = null;
       improvesQualityBranch.Successor = null;
-      moveMaker.Successor = bestQualityUpdater;
+      if (!nested) {
+        moveMaker.Successor = bestQualityUpdater;
+      } else {
+        moveMaker.Successor = null; 
+      }
       bestQualityUpdater.Successor = null;
       mergingReducer.Successor = analyzer2;
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 5621)
+++ /branches/VNS/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3/HeuristicLab.Algorithms.VariableNeighborhoodSearch-3.3.csproj	(revision 5622)
@@ -108,6 +108,4 @@
   <ItemGroup>
     <Compile Include="HeuristicLabAlgorithmsVariableNeighborhoodSearchPlugin.cs" />
-    <Compile Include="ILocalImprovement.cs" />
-    <Compile Include="LocalSearchImprovement.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="ShakingOperator.cs" />
Index: anches/VNS/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3/ILocalImprovement.cs
===================================================================
--- /branches/VNS/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3/ILocalImprovement.cs	(revision 5621)
+++ 	(revision )
@@ -1,33 +1,0 @@
-﻿#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.Core;
-using HeuristicLab.Optimization;
-
-namespace HeuristicLab.Algorithms.VariableNeighborhoodSearch {
-  public interface ILocalImprovement: IOperator {
-    void Parameterize(IProblem problem);
-  }
-}
Index: anches/VNS/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3/LocalSearchImprovement.cs
===================================================================
--- /branches/VNS/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3/LocalSearchImprovement.cs	(revision 5621)
+++ 	(revision )
@@ -1,185 +1,0 @@
-﻿#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.Core;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.Operators;
-using HeuristicLab.Common;
-using HeuristicLab.Parameters;
-using HeuristicLab.Algorithms.LocalSearch;
-using HeuristicLab.Data;
-using HeuristicLab.Optimization;
-
-namespace HeuristicLab.Algorithms.VariableNeighborhoodSearch {
-  /// <summary>
-  /// A local search improvement operator.
-  /// </summary>
-  [Item("LocalSearchImprovement", "A local search improvement operator.")]
-  [StorableClass]
-  public class LocalSearchImprovement: SingleSuccessorOperator, ILocalImprovement {
-    [Storable]
-    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 ValueParameter<IntValue> MaximumIterationsParameter {
-      get { return (ValueParameter<IntValue>)Parameters["MaximumIterations"]; }
-    }
-    private ValueParameter<IntValue> SampleSizeParameter {
-      get { return (ValueParameter<IntValue>)Parameters["SampleSize"]; }
-    }
-    public LookupParameter<IntValue> EvaluatedMovesParameter {
-      get { return (LookupParameter<IntValue>)Parameters["EvaluatedMoves"]; }
-    }
-
-    public IMoveGenerator MoveGenerator {
-      get { return MoveGeneratorParameter.Value; }
-      set { MoveGeneratorParameter.Value = value; }
-    }
-    public IMoveMaker MoveMaker {
-      get { return MoveMakerParameter.Value; }
-      set { MoveMakerParameter.Value = value; }
-    }
-    public ISingleObjectiveMoveEvaluator MoveEvaluator {
-      get { return MoveEvaluatorParameter.Value; }
-      set { MoveEvaluatorParameter.Value = value; }
-    }
-
-    [StorableConstructor]
-    protected LocalSearchImprovement(bool deserializing) : base(deserializing) { }
-    protected LocalSearchImprovement(LocalSearchImprovement original, Cloner cloner)
-      : base(original, cloner) {
-        this.loop = cloner.Clone(original.loop);
-    }
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new LocalSearchImprovement(this, cloner);
-    }
-    public LocalSearchImprovement()
-      : base() {
-        loop = new LocalSearchMainLoop();
-
-        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 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>("EvaluatedMoves", "The number of evaluated moves."));
-    }
-
-    public void Parameterize(IProblem problem) {
-      UpdateMoveOperators(problem);
-    }
-
-    private void UpdateMoveOperators(IProblem problem) {
-     /* IMoveGenerator oldMoveGenerator = MoveGenerator;
-      MoveGeneratorParameter.ValidValues.Clear();
-      if (problem != null) {
-        foreach (IMoveGenerator generator in problem.Operators.OfType<IMoveGenerator>().OrderBy(x => x.Name))
-          MoveGeneratorParameter.ValidValues.Add(generator);
-
-        foreach (IMoveMaker maker in problem.Operators.OfType<IMoveMaker>().OrderBy(x => x.Name))
-          MoveMakerParameter.ValidValues.Add(maker);
-
-        foreach (ISingleObjectiveMoveEvaluator evaluator in problem.Operators.OfType<ISingleObjectiveMoveEvaluator>().OrderBy(x => x.Name))
-          MoveEvaluatorParameter.ValidValues.Add(evaluator);
-      }
-
-      if (oldMoveGenerator != null) {
-        IMoveGenerator newMoveGenerator = MoveGeneratorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldMoveGenerator.GetType());
-        if (newMoveGenerator != null) MoveGenerator = newMoveGenerator;
-      }
-      if (MoveGenerator == null) {
-        ClearMoveParameters();
-      }
-
-      IMoveMaker oldMoveMaker = MoveMaker;
-      if (oldMoveMaker != null) {
-        IMoveMaker mm = MoveMakerParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldMoveMaker.GetType());
-        if (mm != null) MoveMaker = mm;
-      }
-
-      ISingleObjectiveMoveEvaluator oldMoveEvaluator = MoveEvaluator;
-      if (oldMoveEvaluator != null) {
-        ISingleObjectiveMoveEvaluator me = MoveEvaluatorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldMoveEvaluator.GetType());
-        if (me != null) MoveEvaluator = me;
-      }*/
-    }
-
-    private void ClearMoveParameters() {
-      /*MoveMakerParameter.ValidValues.Clear();
-      MoveEvaluatorParameter.ValidValues.Clear();*/
-    }
-
-    public override IOperation Apply() {
-      Scope subScope = new Scope();
-      Scope individual = new Scope();
-
-      foreach (Variable var in ExecutionContext.Scope.Variables) {
-        individual.Variables.Add(var);
-      }
-      subScope.SubScopes.Add(individual);
-
-      ExecutionContext.Scope.SubScopes.Add(subScope);
-      int index = subScope.Parent.SubScopes.IndexOf(subScope);
-
-      SubScopesProcessor processor = new SubScopesProcessor();
-      SubScopesRemover remover = new SubScopesRemover();
-
-      remover.RemoveAllSubScopes = false;
-      remover.SubScopeIndexParameter.Value = new IntValue(index);
-
-      for (int i = 0; i < index; i++) {
-        processor.Operators.Add(new EmptyOperator());
-      }
-
-      loop.MoveGeneratorParameter.Value = MoveGeneratorParameter.Value;
-      if (loop.MoveGeneratorParameter.Value != null && loop.MoveGeneratorParameter.Value.Parameters.ContainsKey("SampleSize")) {
-        IParameter parameter = loop.MoveGeneratorParameter.Value.Parameters["SampleSize"];
-        if(parameter is IValueParameter)
-          (parameter as IValueParameter).Value = SampleSizeParameter.Value;
-      }
-      loop.MoveEvaluatorParameter.Value = MoveEvaluatorParameter.Value;
-      loop.MoveMakerParameter.Value = MoveMakerParameter.Value;
-      loop.MaximumIterationsParameter.Value = MaximumIterationsParameter.Value;
-
-      processor.Operators.Add(loop);
-      processor.Successor = remover;
-
-      IOperation next = base.Apply();
-      if (next as ExecutionContext != null) {
-        remover.Successor = (next as ExecutionContext).Operator;
-      }
-
-      return ExecutionContext.CreateOperation(processor);
-    }
-  }
-}
Index: /branches/VNS/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3/VariableNeighborhoodSearch.cs
===================================================================
--- /branches/VNS/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3/VariableNeighborhoodSearch.cs	(revision 5621)
+++ /branches/VNS/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3/VariableNeighborhoodSearch.cs	(revision 5622)
@@ -13,4 +13,5 @@
 using HeuristicLab.Optimization.Operators;
 using HeuristicLab.Operators;
+using HeuristicLab.Algorithms.LocalSearch;
 
 namespace HeuristicLab.Algorithms.VariableNeighborhoodSearch {
Index: /branches/VNS/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3/VariableNeighborhoodSearchMainLoop.cs
===================================================================
--- /branches/VNS/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3/VariableNeighborhoodSearchMainLoop.cs	(revision 5621)
+++ /branches/VNS/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3/VariableNeighborhoodSearchMainLoop.cs	(revision 5622)
@@ -32,4 +32,5 @@
 using HeuristicLab.Optimization.Operators;
 using HeuristicLab.Selection;
+using HeuristicLab.Optimization;
 
 namespace HeuristicLab.Algorithms.VariableNeighborhoodSearch {
@@ -123,4 +124,5 @@
       Placeholder localImprovement = new Placeholder();
       Placeholder evaluator = new Placeholder();
+      IntCounter evalCounter = new IntCounter();
 
       QualityComparator qualityComparator = new QualityComparator();
@@ -187,4 +189,8 @@
       evaluator.OperatorParameter.ActualName = EvaluatorParameter.Name;
 
+      evalCounter.Name = "Count evaluateions";
+      evalCounter.Increment.Value = 1;
+      evalCounter.ValueParameter.ActualName = EvaluatedSolutionsParameter.ActualName;
+
       qualityComparator.LeftSideParameter.ActualName = QualityParameter.Name;
       qualityComparator.RightSideParameter.ActualName = "OriginalQuality";
@@ -236,9 +242,8 @@
       #region Create operator graph
       OperatorGraph.InitialOperator = variableCreator;
-      variableCreator.Successor = subScopesProcessor0;
+      variableCreator.Successor = analyzer1;
+      analyzer1.Successor = subScopesProcessor0;
       subScopesProcessor0.Operators.Add(bestQualityInitializer);
       subScopesProcessor0.Successor = resultsCollector1;
-      //////////
-      bestQualityInitializer.Successor = analyzer1;
       /////////
       resultsCollector1.Successor = iteration;
@@ -250,11 +255,12 @@
       createChild.Successor = childProcessor;
       childProcessor.Operators.Add(parentCloner);
-      childProcessor.Successor = indexTermination;
+      childProcessor.Successor = analyzer2;
       /////////
       parentCloner.Successor = qualityAssigner;
       qualityAssigner.Successor = shaking;
-      shaking.Successor = localImprovement;
-      localImprovement.Successor = evaluator;
-      evaluator.Successor = qualityComparator;
+      shaking.Successor = evaluator;
+      evaluator.Successor = evalCounter;
+      evalCounter.Successor = localImprovement;
+      localImprovement.Successor = qualityComparator;
       qualityComparator.Successor = improvesQualityBranch;
       improvesQualityBranch.TrueBranch = bestQualityUpdater;
@@ -268,4 +274,5 @@
       remover2.Successor = indexCounter;
       /////////
+      analyzer2.Successor = indexTermination;
       indexTermination.TrueBranch = improvesQualityBranch2;
       indexTermination.FalseBranch = null;
Index: /branches/VNS/HeuristicLab.Optimization/3.3/HeuristicLab.Optimization-3.3.csproj
===================================================================
--- /branches/VNS/HeuristicLab.Optimization/3.3/HeuristicLab.Optimization-3.3.csproj	(revision 5621)
+++ /branches/VNS/HeuristicLab.Optimization/3.3/HeuristicLab.Optimization-3.3.csproj	(revision 5622)
@@ -116,4 +116,5 @@
     <Compile Include="Interfaces\IDiscreteDoubleMatrixModifier.cs" />
     <Compile Include="Interfaces\IGlobalParticleUpdater.cs" />
+    <Compile Include="Interfaces\ILocalImprovement.cs" />
     <Compile Include="Interfaces\ILocalParticleUpdater.cs" />
     <Compile Include="Interfaces\IMultiAnalyzer.cs" />
Index: /branches/VNS/HeuristicLab.Optimization/3.3/Interfaces/ILocalImprovement.cs
===================================================================
--- /branches/VNS/HeuristicLab.Optimization/3.3/Interfaces/ILocalImprovement.cs	(revision 5622)
+++ /branches/VNS/HeuristicLab.Optimization/3.3/Interfaces/ILocalImprovement.cs	(revision 5622)
@@ -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.Core;
+using HeuristicLab.Optimization;
+
+namespace HeuristicLab.Optimization {
+  public interface ILocalImprovement: IOperator {
+    void Parameterize(IProblem problem);
+  }
+}
