Index: trunk/sources/HeuristicLab.Algorithms.TabuSearch/3.3/TabuSearch.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.TabuSearch/3.3/TabuSearch.cs	(revision 3140)
+++ trunk/sources/HeuristicLab.Algorithms.TabuSearch/3.3/TabuSearch.cs	(revision 3141)
@@ -74,4 +74,7 @@
       get { return (ValueParameter<IntValue>)Parameters["MaximumIterations"]; }
     }
+    private ValueParameter<IntValue> SampleSizeParameter {
+      get { return (ValueParameter<IntValue>)Parameters["SampleSize"]; }
+    }
     #endregion
 
@@ -124,4 +127,6 @@
     #endregion
 
+    [StorableConstructor]
+    public TabuSearch(bool deserializing) : base() { }
     public TabuSearch()
       : base() {
@@ -135,4 +140,5 @@
       Parameters.Add(new ValueParameter<IntValue>("TabuTenure", "The length of the tabu list.", new IntValue(10)));
       Parameters.Add(new ValueParameter<IntValue>("MaximumIterations", "The maximum number of generations which should be processed.", new IntValue(1000)));
+      Parameters.Add(new ValueParameter<IntValue>("SampleSize", "The neighborhood size for stochastic sampling move generators", new IntValue(20)));
 
       RandomCreator randomCreator = new RandomCreator();
@@ -163,7 +169,4 @@
     }
 
-    [StorableConstructor]
-    private TabuSearch(bool deserializing) : base() { }
-
     public override IDeepCloneable Clone(Cloner cloner) {
       TabuSearch clone = (TabuSearch)base.Clone(cloner);
@@ -185,4 +188,5 @@
       ParameterizeSolutionsCreator();
       ParameterizeMainLoop();
+      ParameterizeMoveGenerators();
       ParameterizeMoveEvaluator();
       ParameterizeMoveMaker();
@@ -204,4 +208,10 @@
       Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
       base.Problem_EvaluatorChanged(sender, e);
+    }
+    protected override void Problem_VisualizerChanged(object sender, EventArgs e) {
+      ParameterizeStochasticOperator(Problem.Visualizer);
+      ParameterizeMainLoop();
+      if (Problem.Visualizer != null) Problem.Visualizer.VisualizationParameter.ActualNameChanged += new EventHandler(Visualizer_VisualizationParameter_ActualNameChanged);
+      base.Problem_VisualizerChanged(sender, e);
     }
     protected override void Problem_OperatorsChanged(object sender, EventArgs e) {
@@ -222,4 +232,5 @@
         UpdateMoveParameters();
       ParameterizeMainLoop();
+      ParameterizeMoveGenerators();
       ParameterizeMoveEvaluator();
       ParameterizeMoveMaker();
@@ -249,4 +260,10 @@
     private void TabuMoveEvaluator_MoveTabuParameter_ActualNameChanged(object sender, EventArgs e) {
       ParameterizeMainLoop();
+    }
+    private void Visualizer_VisualizationParameter_ActualNameChanged(object sender, EventArgs e) {
+      ParameterizeMainLoop();
+    }
+    private void SampleSizeParameter_NameChanged(object sender, EventArgs e) {
+      ParameterizeMoveGenerators();
     }
     #endregion
@@ -260,8 +277,10 @@
           op.MoveQualityParameter.ActualNameChanged += new EventHandler(MoveEvaluator_MoveQualityParameter_ActualNameChanged);
         }
+        if (Problem.Visualizer != null) Problem.Visualizer.VisualizationParameter.ActualNameChanged += new EventHandler(Visualizer_VisualizationParameter_ActualNameChanged);
       }
       MoveGeneratorParameter.ValueChanged += new EventHandler(MoveGeneratorParameter_ValueChanged);
       MoveEvaluatorParameter.ValueChanged += new EventHandler(MoveEvaluatorParameter_ValueChanged);
       TabuMoveEvaluatorParameter.ValueChanged += new EventHandler(TabuMoveEvaluatorParameter_ValueChanged);
+      SampleSizeParameter.NameChanged += new EventHandler(SampleSizeParameter_NameChanged);
     }
     private void UpdateMoveGenerator() {
@@ -269,6 +288,7 @@
       MoveGeneratorParameter.ValidValues.Clear();
       if (Problem != null) {
-        foreach (IMoveGenerator generator in Problem.Operators.OfType<IMoveGenerator>().OrderBy(x => x.Name))
+        foreach (IMoveGenerator generator in Problem.Operators.OfType<IMoveGenerator>().OrderBy(x => x.Name)) {
           MoveGeneratorParameter.ValidValues.Add(generator);
+        }
       }
       if (oldMoveGenerator != null && MoveGeneratorParameter.ValidValues.Any(x => x.GetType() == oldMoveGenerator.GetType()))
@@ -330,4 +350,5 @@
     }
     private void ParameterizeMainLoop() {
+      MainLoop.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name;
       MainLoop.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
       MainLoop.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
@@ -336,8 +357,17 @@
       if (TabuMoveEvaluator != null)
         MainLoop.MoveTabuParameter.ActualName = TabuMoveEvaluator.MoveTabuParameter.ActualName;
+      MainLoop.VisualizerParameter.ActualName = Problem.VisualizerParameter.Name;
+      if (Problem.Visualizer != null)
+        MainLoop.VisualizationParameter.ActualName = Problem.Visualizer.VisualizationParameter.ActualName;
     }
     private void ParameterizeStochasticOperator(IOperator op) {
       if (op is IStochasticOperator)
         ((IStochasticOperator)op).RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName;
+    }
+    private void ParameterizeMoveGenerators() {
+      if (Problem != null) {
+        foreach (IMultiMoveGenerator generator in Problem.Operators.OfType<IMultiMoveGenerator>())
+          generator.SampleSizeParameter.ActualName = SampleSizeParameter.Name;
+      }
     }
     private void ParameterizeMoveEvaluator() {
Index: trunk/sources/HeuristicLab.Algorithms.TabuSearch/3.3/TabuSearchMainLoop.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.TabuSearch/3.3/TabuSearchMainLoop.cs	(revision 3140)
+++ trunk/sources/HeuristicLab.Algorithms.TabuSearch/3.3/TabuSearchMainLoop.cs	(revision 3141)
@@ -34,5 +34,5 @@
   [Item("TabuSearchMainLoop", "An operator which represents the main loop of a tabu search.")]
   [StorableClass]
-  public class TabuSearchMainLoop : AlgorithmOperator {
+  public sealed class TabuSearchMainLoop : AlgorithmOperator {
     #region Parameter properties
     public ValueLookupParameter<IRandom> RandomParameter {
@@ -45,4 +45,7 @@
       get { return (LookupParameter<DoubleValue>)Parameters["Quality"]; }
     }
+    public ValueLookupParameter<DoubleValue> BestKnownQualityParameter {
+      get { return (ValueLookupParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
+    }
     public LookupParameter<DoubleValue> MoveQualityParameter {
       get { return (LookupParameter<DoubleValue>)Parameters["MoveQuality"]; }
@@ -57,28 +60,27 @@
       get { return (ValueLookupParameter<IntValue>)Parameters["TabuTenure"]; }
     }
+    public ValueLookupParameter<IOperator> MoveGeneratorParameter {
+      get { return (ValueLookupParameter<IOperator>)Parameters["MoveGenerator"]; }
+    }
+    public ValueLookupParameter<IOperator> MoveEvaluatorParameter {
+      get { return (ValueLookupParameter<IOperator>)Parameters["MoveEvaluator"]; }
+    }
+    public ValueLookupParameter<IOperator> MoveMakerParameter {
+      get { return (ValueLookupParameter<IOperator>)Parameters["MoveMaker"]; }
+    }
+    public ValueLookupParameter<IOperator> TabuMoveEvaluatorParameter {
+      get { return (ValueLookupParameter<IOperator>)Parameters["TabuMoveEvaluator"]; }
+    }
+    public ValueLookupParameter<IOperator> TabuMoveMakerParameter {
+      get { return (ValueLookupParameter<IOperator>)Parameters["TabuMoveMaker"]; }
+    }
+    public ValueLookupParameter<IOperator> VisualizerParameter {
+      get { return (ValueLookupParameter<IOperator>)Parameters["Visualizer"]; }
+    }
+    public LookupParameter<IItem> VisualizationParameter {
+      get { return (LookupParameter<IItem>)Parameters["Visualization"]; }
+    }
     public ValueLookupParameter<VariableCollection> ResultsParameter {
       get { return (ValueLookupParameter<VariableCollection>)Parameters["Results"]; }
-    }
-    public ValueLookupParameter<IOperator> MoveGeneratorParameter {
-      get { return (ValueLookupParameter<IOperator>)Parameters["MoveGenerator"]; }
-    }
-    public ValueLookupParameter<IOperator> MoveEvaluatorParameter {
-      get { return (ValueLookupParameter<IOperator>)Parameters["MoveEvaluator"]; }
-    }
-    public ValueLookupParameter<IOperator> MoveMakerParameter {
-      get { return (ValueLookupParameter<IOperator>)Parameters["MoveMaker"]; }
-    }
-    public ValueLookupParameter<IOperator> TabuMoveEvaluatorParameter {
-      get { return (ValueLookupParameter<IOperator>)Parameters["TabuMoveEvaluator"]; }
-    }
-    public ValueLookupParameter<IOperator> TabuMoveMakerParameter {
-      get { return (ValueLookupParameter<IOperator>)Parameters["TabuMoveMaker"]; }
-    }
-
-    private ScopeParameter CurrentScopeParameter {
-      get { return (ScopeParameter)Parameters["CurrentScope"]; }
-    }
-    public IScope CurrentScope {
-      get { return CurrentScopeParameter.ActualValue; }
     }
     #endregion
@@ -90,10 +92,10 @@
       Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, otherwise false."));
       Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The value which represents the quality of a solution."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>("BestKnownQuality", "The best known quality value found so far."));
       Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The value which represents the quality of a move."));
       Parameters.Add(new LookupParameter<BoolValue>("MoveTabu", "The value that indicates if a move is tabu or not."));
       Parameters.Add(new ValueLookupParameter<IntValue>("MaximumIterations", "The maximum number of generations which should be processed."));
       Parameters.Add(new ValueLookupParameter<IntValue>("TabuTenure", "The length of the tabu list, and also means the number of iterations a move is kept tabu"));
-      Parameters.Add(new ValueLookupParameter<VariableCollection>("Results", "The variable collection where results should be stored."));
-
+      
       Parameters.Add(new ValueLookupParameter<IOperator>("MoveGenerator", "The operator that generates the moves."));
       Parameters.Add(new ValueLookupParameter<IOperator>("MoveMaker", "The operator that performs a move and updates the quality."));
@@ -102,5 +104,7 @@
       Parameters.Add(new ValueLookupParameter<IOperator>("TabuMoveMaker", "The operator that declares a move tabu."));
 
-      Parameters.Add(new ScopeParameter("CurrentScope", "The current scope which represents a population of solutions on which the TS should be applied."));
+      Parameters.Add(new ValueLookupParameter<IOperator>("Visualizer", "The operator used to visualize solutions."));
+      Parameters.Add(new LookupParameter<IItem>("Visualization", "The item which represents the visualization of solutions."));
+      Parameters.Add(new ValueLookupParameter<VariableCollection>("Results", "The variable collection where results should be stored."));
       #endregion
 
@@ -108,5 +112,8 @@
       TabuListCreator tabuListCreator = new TabuListCreator();
       VariableCreator variableCreator = new VariableCreator();
-      BestQualityMemorizer bestQualityMemorizer = new BestQualityMemorizer();
+      BestQualityMemorizer bestQualityMemorizer1 = new BestQualityMemorizer();
+      BestQualityMemorizer bestQualityMemorizer2 = new BestQualityMemorizer();
+      QualityDifferenceCalculator qualityDifferenceCalculator1 = new QualityDifferenceCalculator();
+      Placeholder visualizer1 = new Placeholder();
       ResultsCollector resultsCollector = new ResultsCollector();
       UniformSequentialSubScopesProcessor mainProcessor = new UniformSequentialSubScopesProcessor();
@@ -126,6 +133,9 @@
       IntCounter iterationsCounter = new IntCounter();
       Comparator iterationsComparator = new Comparator();
+      BestQualityMemorizer bestQualityMemorizer3 = new BestQualityMemorizer();
+      BestQualityMemorizer bestQualityMemorizer4 = new BestQualityMemorizer();
+      QualityDifferenceCalculator qualityDifferenceCalculator2 = new QualityDifferenceCalculator();
+      Placeholder visualizer2 = new Placeholder();
       ConditionalBranch iterationsTermination = new ConditionalBranch();
-      EmptyOperator finished = new EmptyOperator();
 
       variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Iterations", new IntValue(0)));
@@ -135,10 +145,30 @@
       variableCreator.CollectedValues.Add(new ValueParameter<DataTable>("MoveQualities", new DataTable("MoveQualities")));
 
+      bestQualityMemorizer1.BestQualityParameter.ActualName = "BestQuality";
+      bestQualityMemorizer1.MaximizationParameter.ActualName = MaximizationParameter.Name;
+      bestQualityMemorizer1.QualityParameter.ActualName = QualityParameter.Name;
+
+      bestQualityMemorizer2.BestQualityParameter.ActualName = BestKnownQualityParameter.Name;
+      bestQualityMemorizer2.MaximizationParameter.ActualName = MaximizationParameter.Name;
+      bestQualityMemorizer2.QualityParameter.ActualName = QualityParameter.Name;
+
+      qualityDifferenceCalculator1.AbsoluteDifferenceParameter.ActualName = "AbsoluteDifferenceBestKnownToBest";
+      qualityDifferenceCalculator1.FirstQualityParameter.ActualName = BestKnownQualityParameter.Name;
+      qualityDifferenceCalculator1.RelativeDifferenceParameter.ActualName = "RelativeDifferenceBestKnownToBest";
+      qualityDifferenceCalculator1.SecondQualityParameter.ActualName = "BestQuality";
+
+      visualizer1.Name = "Visualizer (placeholder)";
+      visualizer1.OperatorParameter.ActualName = VisualizerParameter.Name;
+
       resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Iterations"));
-      resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality") { ActualName = "BestQuality" });
+      resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality"));
       resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Move Quality"));
       resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Average Move Quality"));
       resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Worst Move Quality"));
       resultsCollector.CollectedValues.Add(new LookupParameter<DataTable>("MoveQualities"));
+      resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Known Quality", null, BestKnownQualityParameter.Name));
+      resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Absolute Difference of Best Known Quality to Best Quality", null, "AbsoluteDifferenceBestKnownToBest"));
+      resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Relative Difference of Best Known Quality to Best Quality", null, "RelativeDifferenceBestKnownToBest"));
+      resultsCollector.CollectedValues.Add(new LookupParameter<IItem>("Solution Visualization", null, VisualizationParameter.Name));
       resultsCollector.ResultsParameter.ActualName = "Results";
 
@@ -146,29 +176,21 @@
 
       moveGenerator.Name = "MoveGenerator (placeholder)";
-      moveGenerator.OperatorParameter.ActualName = "MoveGenerator";
+      moveGenerator.OperatorParameter.ActualName = MoveGeneratorParameter.Name;
 
       moveEvaluator.Name = "MoveEvaluator (placeholder)";
-      moveEvaluator.OperatorParameter.ActualName = "MoveEvaluator";
+      moveEvaluator.OperatorParameter.ActualName = MoveEvaluatorParameter.Name;
 
       tabuMoveEvaluator.Name = "TabuMoveEvaluator (placeholder)";
-      tabuMoveEvaluator.OperatorParameter.ActualName = "TabuMoveEvaluator";
-
-      moveQualitySorter.DescendingParameter.ActualName = "Maximization";
-      moveQualitySorter.ValueParameter.ActualName = "MoveQuality";
+      tabuMoveEvaluator.OperatorParameter.ActualName = TabuMoveEvaluatorParameter.Name;
+
+      moveQualitySorter.DescendingParameter.ActualName = MaximizationParameter.Name;
+      moveQualitySorter.ValueParameter.ActualName = MoveQualityParameter.Name;
 
       bestAverageWorstMoveQualityCalculator.AverageQualityParameter.ActualName = "Average Move Quality";
       bestAverageWorstMoveQualityCalculator.BestQualityParameter.ActualName = "Best Move Quality";
       bestAverageWorstMoveQualityCalculator.MaximizationParameter.ActualName = "Maximization";
-      bestAverageWorstMoveQualityCalculator.QualityParameter.ActualName = "MoveQuality";
+      bestAverageWorstMoveQualityCalculator.QualityParameter.ActualName = MoveQualityParameter.Name;
       bestAverageWorstMoveQualityCalculator.WorstQualityParameter.ActualName = "Worst Move Quality";
-
-      moveMakingProcessor.Name = "MoveMaking processor (UniformSequentialSubScopesProcessor)";
-
-      tabuMoveMaker.Name = "TabuMoveMaker (placeholder)";
-      tabuMoveMaker.OperatorParameter.ActualName = "TabuMoveMaker";
-
-      moveMaker.Name = "MoveMaker (placeholder)";
-      moveMaker.OperatorParameter.ActualName = "MoveMaker";
-
+      
       valuesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Move Quality"));
       valuesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Average Move Quality"));
@@ -176,4 +198,12 @@
       valuesCollector.DataTableParameter.ActualName = "MoveQualities";
 
+      moveMakingProcessor.Name = "MoveMaking processor (UniformSequentialSubScopesProcessor)";
+
+      tabuMoveMaker.Name = "TabuMoveMaker (placeholder)";
+      tabuMoveMaker.OperatorParameter.ActualName = TabuMoveMakerParameter.Name;
+
+      moveMaker.Name = "MoveMaker (placeholder)";
+      moveMaker.OperatorParameter.ActualName = MoveMakerParameter.Name;
+
       subScopesRemover.RemoveAllSubScopes = true;
 
@@ -185,6 +215,22 @@
       iterationsComparator.Comparison = new Comparison(ComparisonType.Less);
       iterationsComparator.LeftSideParameter.ActualName = "Iterations";
-      iterationsComparator.RightSideParameter.ActualName = "MaximumIterations";
+      iterationsComparator.RightSideParameter.ActualName = MaximumIterationsParameter.Name;
       iterationsComparator.ResultParameter.ActualName = "IterationsCondition";
+
+      bestQualityMemorizer3.BestQualityParameter.ActualName = "BestQuality";
+      bestQualityMemorizer3.MaximizationParameter.ActualName = MaximizationParameter.Name;
+      bestQualityMemorizer3.QualityParameter.ActualName = QualityParameter.Name;
+
+      bestQualityMemorizer4.BestQualityParameter.ActualName = BestKnownQualityParameter.Name;
+      bestQualityMemorizer4.MaximizationParameter.ActualName = MaximizationParameter.Name;
+      bestQualityMemorizer4.QualityParameter.ActualName = QualityParameter.Name;
+
+      qualityDifferenceCalculator2.AbsoluteDifferenceParameter.ActualName = "AbsoluteDifferenceBestKnownToBest";
+      qualityDifferenceCalculator2.FirstQualityParameter.ActualName = BestKnownQualityParameter.Name;
+      qualityDifferenceCalculator2.RelativeDifferenceParameter.ActualName = "RelativeDifferenceBestKnownToBest";
+      qualityDifferenceCalculator2.SecondQualityParameter.ActualName = "BestQuality";
+
+      visualizer2.Name = "Visualizer (placeholder)";
+      visualizer2.OperatorParameter.ActualName = VisualizerParameter.Name;
 
       iterationsTermination.Name = "Iterations Termination Condition";
@@ -195,15 +241,20 @@
       OperatorGraph.InitialOperator = tabuListCreator;
       tabuListCreator.Successor = variableCreator;
-      variableCreator.Successor = bestQualityMemorizer;
-      bestQualityMemorizer.Successor = resultsCollector;
+      variableCreator.Successor = bestQualityMemorizer1;
+      bestQualityMemorizer1.Successor = bestQualityMemorizer2;
+      bestQualityMemorizer2.Successor = qualityDifferenceCalculator1;
+      qualityDifferenceCalculator1.Successor = visualizer1;
+      visualizer1.Successor = resultsCollector;
       resultsCollector.Successor = mainProcessor;
       mainProcessor.Operator = moveGenerator;
-      mainProcessor.Successor = valuesCollector;
+      mainProcessor.Successor = iterationsCounter;
       moveGenerator.Successor = moveEvaluationProcessor;
       moveEvaluationProcessor.Operator = moveEvaluator;
       moveEvaluationProcessor.Successor = moveQualitySorter;
       moveEvaluator.Successor = tabuMoveEvaluator;
+      tabuMoveEvaluator.Successor = null;
       moveQualitySorter.Successor = bestAverageWorstMoveQualityCalculator;
-      bestAverageWorstMoveQualityCalculator.Successor = tabuSelector;
+      bestAverageWorstMoveQualityCalculator.Successor = valuesCollector;
+      valuesCollector.Successor = tabuSelector;
       tabuSelector.Successor = rightReducer;
       rightReducer.Successor = moveMakingProcessor;
@@ -211,9 +262,14 @@
       moveMakingProcessor.Successor = subScopesRemover;
       tabuMoveMaker.Successor = moveMaker;
-      valuesCollector.Successor = iterationsCounter;
+      moveMaker.Successor = null;
+      subScopesRemover.Successor = null;
       iterationsCounter.Successor = iterationsComparator;
-      iterationsComparator.Successor = iterationsTermination;
-      iterationsTermination.TrueBranch = bestQualityMemorizer;
-      iterationsTermination.FalseBranch = finished;
+      iterationsComparator.Successor = bestQualityMemorizer3;
+      bestQualityMemorizer3.Successor = bestQualityMemorizer4;
+      bestQualityMemorizer4.Successor = qualityDifferenceCalculator2;
+      qualityDifferenceCalculator2.Successor = visualizer2;
+      visualizer2.Successor = iterationsTermination;
+      iterationsTermination.TrueBranch = mainProcessor;
+      iterationsTermination.FalseBranch = null;
       #endregion
     }
