Index: anches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/DiversityCalculator.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/DiversityCalculator.cs	(revision 7785)
+++ 	(revision )
@@ -1,56 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Operators;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Algorithms.ScatterSearch {
-  /// <summary>
-  /// A base class for operators that perform diversity calculation between two items.
-  /// </summary>
-  [Item("DiversityCalculator", "A base class for operators that perform diversity calculation between two items.")]
-  [StorableClass]
-  public abstract class DiversityCalculator : SingleSuccessorOperator {
-    [StorableConstructor]
-    protected DiversityCalculator(bool deserializing) : base(deserializing) { }
-    protected DiversityCalculator(DiversityCalculator original, Cloner cloner) : base(original, cloner) { }
-    protected DiversityCalculator() : base() { }
-
-    public sealed override IOperation Apply() { // TODO: check if sealed fits here?
-      return base.Apply();
-    }
-
-    public double ExecuteCalculation(IItem left, IItem right) {
-      if (left == null || right == null)
-        throw new ArgumentException("Cannot calculate diversity because one of the provided objects is null.");
-      if (left.GetType() != right.GetType())
-        throw new ArgumentException("Cannot calculate diversity because the provided objects differ in type.");
-
-      if (left == right) return 0;
-      else return CalculateDiversity(left, right);
-    }
-
-    protected abstract double CalculateDiversity(IItem left, IItem right);
-  }
-}
Index: /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/HeuristicLab.Algorithms.ScatterSearch-3.3.csproj
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/HeuristicLab.Algorithms.ScatterSearch-3.3.csproj	(revision 7785)
+++ /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/HeuristicLab.Algorithms.ScatterSearch-3.3.csproj	(revision 7786)
@@ -87,23 +87,14 @@
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="IImprovementOperator.cs" />
+    <Compile Include="IPathRelinker.cs" />
     <Compile Include="SolutionPool2TierUpdateMethod.cs" />
-    <Compile Include="DiversityCalculator.cs" />
-    <Compile Include="IPathRelinker.cs" />
-    <Compile Include="Knapsack\BinaryVectorDiversityCalculator.cs" />
+    <Compile Include="SimilarityCalculator.cs" />
+    <Compile Include="Knapsack\KnapsackSimilarityCalculator.cs" />
     <Compile Include="Knapsack\KnapsackMultipleGuidesPathRelinker.cs" />
     <Compile Include="Knapsack\KnapsackSimultaneousPathRelinker.cs" />
     <Compile Include="Knapsack\KnapsackPathRelinker.cs" />
-    <Compile Include="TestFunctions\TestFunctionsZakharovImprovementOperator.cs" />
-    <Compile Include="TestFunctions\TestFunctionsSumSquaresImprovementOperator.cs" />
-    <Compile Include="TestFunctions\TestFunctionsSchwefelImprovementOperator.cs" />
-    <Compile Include="TestFunctions\TestFunctionsRosenbrockImprovementOperator.cs" />
-    <Compile Include="TestFunctions\TestFunctionsMatyasImprovementOperator.cs" />
-    <Compile Include="TestFunctions\TestFunctionsLevyImprovementOperator.cs" />
-    <Compile Include="TestFunctions\TestFunctionsGriewankImprovementOperator.cs" />
-    <Compile Include="TestFunctions\TestFunctionsBoothImprovementOperator.cs" />
-    <Compile Include="TestFunctions\TestFunctionsBealeImprovementOperator.cs" />
-    <Compile Include="TestFunctions\TestFunctionsAckleyImprovementOperator.cs" />
     <Compile Include="TestFunctions\TestFunctionsPathRelinker.cs" />
-    <Compile Include="TestFunctions\RealVectorDiversityCalculator.cs" />
+    <Compile Include="TestFunctions\TestFunctionsSimilarityCalculator.cs" />
     <Compile Include="TestFunctions\TestFunctionsImprovementOperator.cs" />
     <Compile Include="TravelingSalesman\TravelingSalesmanMultipleGuidesPathRelinker.cs" />
@@ -111,10 +102,6 @@
     <Compile Include="TravelingSalesman\TravelingSalesmanPathRelinker.cs" />
     <Compile Include="PathRelinker.cs" />
-    <Compile Include="Knapsack\INBinaryVectorCrossover.cs" />
-    <Compile Include="IScatterSearchTargetProcessor.cs" />
-    <Compile Include="Knapsack\NBinaryVectorCrossover.cs" />
-    <Compile Include="Knapsack\NChildCrossover.cs" />
     <Compile Include="OffspringProcessor.cs" />
-    <Compile Include="TravelingSalesman\PermutationDiversityCalculator.cs" />
+    <Compile Include="TravelingSalesman\TravelingSalesmanSimilarityCalculator.cs" />
     <Compile Include="TravelingSalesman\TravelingSalesmanImprovementOperator.cs" />
     <None Include="HeuristicLab.snk" />
Index: /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/IImprovementOperator.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/IImprovementOperator.cs	(revision 7786)
+++ /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/IImprovementOperator.cs	(revision 7786)
@@ -0,0 +1,32 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+
+namespace HeuristicLab.Algorithms.ScatterSearch {
+  /// <summary>
+  /// An interface which represents an operator for improvement.
+  /// </summary>
+  public interface IImprovementOperator : IOperator, IParameterizedNamedItem, IDeepCloneable, ICloneable {
+  }
+}
Index: /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/IPathRelinker.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/IPathRelinker.cs	(revision 7785)
+++ /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/IPathRelinker.cs	(revision 7786)
@@ -20,6 +20,7 @@
 #endregion
 
+using System;
+using HeuristicLab.Common;
 using HeuristicLab.Core;
-using HeuristicLab.Optimization;
 
 namespace HeuristicLab.Algorithms.ScatterSearch {
@@ -27,6 +28,5 @@
   /// An interface which represents an operator for path relinking.
   /// </summary>
-  public interface IPathRelinker : ICrossover {
-    ILookupParameter<ItemArray<IItem>> ParentsParameter { get; }
+  public interface IPathRelinker : IOperator, IParameterizedNamedItem, IDeepCloneable, ICloneable {
   }
 }
Index: anches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/IScatterSearchTargetProcessor.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/IScatterSearchTargetProcessor.cs	(revision 7785)
+++ 	(revision )
@@ -1,31 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 HeuristicLab.Core;
-
-namespace HeuristicLab.Algorithms.ScatterSearch {
-  /// <summary>
-  /// An interface which represents an operator that uses a target parameter.
-  /// </summary>
-  public interface IScatterSearchTargetProcessor {
-    IValueLookupParameter<IItem> TargetParameter { get; }
-  }
-}
Index: anches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/Knapsack/BinaryVectorDiversityCalculator.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/Knapsack/BinaryVectorDiversityCalculator.cs	(revision 7785)
+++ 	(revision )
@@ -1,56 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Encodings.BinaryVectorEncoding;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Algorithms.ScatterSearch.Knapsack {
-  /// <summary>
-  /// An operator that performs diversity calculation between bool-valued vectors.
-  /// </summary>
-  [Item("BinaryVectorDiversityCalculator", "An operator that performs diversity calculation between bool-valued vectors.")]
-  [StorableClass]
-  public sealed class BinaryVectorDiversityCalculator : DiversityCalculator {
-    [StorableConstructor]
-    private BinaryVectorDiversityCalculator(bool deserializing) : base(deserializing) { }
-    private BinaryVectorDiversityCalculator(BinaryVectorDiversityCalculator original, Cloner cloner) : base(original, cloner) { }
-    public BinaryVectorDiversityCalculator() : base() { }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new BinaryVectorDiversityCalculator(this, cloner);
-    }
-
-    protected override double CalculateDiversity(IItem left, IItem right) {
-      if (!(left is BinaryVector) || !(right is BinaryVector))
-        throw new ArgumentException("Cannot calculate diversity because one of the provided objects or both have the wrong type.");
-
-      var v1 = left as BinaryVector;
-      var v2 = right as BinaryVector;
-      double diversity = 0;
-      for (int i = 0; i < v1.Length; i++)
-        if (v1[i] != v2[i]) diversity++;
-      return diversity;
-    }
-  }
-}
Index: anches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/Knapsack/INBinaryVectorCrossover.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/Knapsack/INBinaryVectorCrossover.cs	(revision 7785)
+++ 	(revision )
@@ -1,33 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 HeuristicLab.Core;
-using HeuristicLab.Encodings.BinaryVectorEncoding;
-using HeuristicLab.Optimization;
-
-namespace HeuristicLab.Algorithms.ScatterSearch.Knapsack {
-  /// <summary>
-  /// An interface which represents an operator for crossing vectors of bool-valued data.
-  /// </summary>
-  public interface INBinaryVectorCrossover : IBinaryVectorOperator, ICrossover {
-    ILookupParameter<ItemArray<BinaryVector>> ParentsParameter { get; }
-  }
-}
Index: /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/Knapsack/KnapsackImprovementOperator.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/Knapsack/KnapsackImprovementOperator.cs	(revision 7785)
+++ /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/Knapsack/KnapsackImprovementOperator.cs	(revision 7786)
@@ -20,5 +20,4 @@
 #endregion
 
-using System;
 using System.Linq;
 using HeuristicLab.Common;
@@ -27,5 +26,4 @@
 using HeuristicLab.Encodings.BinaryVectorEncoding;
 using HeuristicLab.Operators;
-using HeuristicLab.Optimization;
 using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
@@ -38,47 +36,24 @@
   [Item("KnapsackImprovementOperator", "An operator that improves knapsack solutions.")]
   [StorableClass]
-  public sealed class KnapsackImprovementOperator : SingleSuccessorOperator, ILocalImprovementOperator, IScatterSearchTargetProcessor {
-    #region Problem properties
-    public Type ProblemType {
-      get { return typeof(KnapsackProblem); }
-    }
-    [Storable]
-    private KnapsackProblem problem;
-    public IProblem Problem {
-      get { return problem; }
-      set { problem = (KnapsackProblem)value; }
-    }
-    #endregion
-
+  public sealed class KnapsackImprovementOperator : SingleSuccessorOperator, IImprovementOperator {
     #region Parameter properties
     public ScopeParameter CurrentScopeParameter {
       get { return (ScopeParameter)Parameters["CurrentScope"]; }
     }
-    public IValueLookupParameter<IntArray> ValuesParameter {
-      get { return (IValueLookupParameter<IntArray>)Parameters["Values"]; }
+    public ILookupParameter<IntValue> KnapsackCapacityParameter {
+      get { return (ILookupParameter<IntValue>)Parameters["KnapsackCapacity"]; }
     }
-    public IValueLookupParameter<IntArray> WeightsParameter {
-      get { return (IValueLookupParameter<IntArray>)Parameters["Weights"]; }
-    }
-    public IValueLookupParameter<IntValue> KnapsackCapacityParameter {
-      get { return (IValueLookupParameter<IntValue>)Parameters["KnapsackCapacity"]; }
+    public ILookupParameter<DoubleValue> PenaltyParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["Penalty"]; }
     }
     public IValueLookupParameter<IItem> TargetParameter {
       get { return (IValueLookupParameter<IItem>)Parameters["Target"]; }
     }
-    public IValueLookupParameter<DoubleValue> PenaltyParameter {
-      get { return (IValueLookupParameter<DoubleValue>)Parameters["Penalty"]; }
+    public ILookupParameter<IntArray> ValuesParameter {
+      get { return (ILookupParameter<IntArray>)Parameters["Values"]; }
     }
-    #region ILocalImprovementOperator Parameters
-    public IValueLookupParameter<IntValue> MaximumIterationsParameter {
-      get { return (IValueLookupParameter<IntValue>)Parameters["MaximumIterations"]; }
+    public ILookupParameter<IntArray> WeightsParameter {
+      get { return (ILookupParameter<IntArray>)Parameters["Weights"]; }
     }
-    public ILookupParameter<IntValue> EvaluatedSolutionsParameter {
-      get { return (ILookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; }
-    }
-    public ILookupParameter<ResultCollection> ResultsParameter {
-      get { return (ILookupParameter<ResultCollection>)Parameters["Results"]; }
-    }
-    #endregion
     #endregion
 
@@ -86,4 +61,15 @@
     private IScope CurrentScope {
       get { return CurrentScopeParameter.ActualValue; }
+    }
+    private IntValue KnapsackCapacity {
+      get { return KnapsackCapacityParameter.ActualValue; }
+      set { KnapsackCapacityParameter.ActualValue = value; }
+    }
+    private DoubleValue Penalty {
+      get { return PenaltyParameter.ActualValue; }
+      set { PenaltyParameter.ActualValue = value; }
+    }
+    private IItem Target {
+      get { return TargetParameter.ActualValue; }
     }
     private IntArray Values {
@@ -95,32 +81,18 @@
       set { WeightsParameter.ActualValue = value; }
     }
-    private IntValue KnapsackCapacity {
-      get { return KnapsackCapacityParameter.ActualValue; }
-      set { KnapsackCapacityParameter.ActualValue = value; }
-    }
-    private IItem Target {
-      get { return TargetParameter.ActualValue; }
-    }
-    private DoubleValue Penalty {
-      get { return PenaltyParameter.ActualValue; }
-      set { PenaltyParameter.ActualValue = value; }
-    }
     #endregion
 
     [StorableConstructor]
     private KnapsackImprovementOperator(bool deserializing) : base(deserializing) { }
-    private KnapsackImprovementOperator(KnapsackImprovementOperator original, Cloner cloner)
-      : base(original, cloner) {
-      this.problem = cloner.Clone(original.problem);
-    }
+    private KnapsackImprovementOperator(KnapsackImprovementOperator original, Cloner cloner) : base(original, cloner) { }
     public KnapsackImprovementOperator()
       : base() {
       #region Create parameters
       Parameters.Add(new ScopeParameter("CurrentScope"));
-      Parameters.Add(new ValueLookupParameter<IntArray>("Values"));
-      Parameters.Add(new ValueLookupParameter<IntArray>("Weights"));
-      Parameters.Add(new ValueLookupParameter<IntValue>("KnapsackCapacity"));
+      Parameters.Add(new LookupParameter<IntValue>("KnapsackCapacity"));
+      Parameters.Add(new LookupParameter<DoubleValue>("Penalty"));
       Parameters.Add(new ValueLookupParameter<IItem>("Target"));
-      Parameters.Add(new ValueLookupParameter<DoubleValue>("Penalty"));
+      Parameters.Add(new LookupParameter<IntArray>("Values"));
+      Parameters.Add(new LookupParameter<IntArray>("Weights"));
       #endregion
       TargetParameter.ActualName = "KnapsackSolution"; // temporary solution for the knapsack problem
@@ -132,5 +104,5 @@
 
     public override IOperation Apply() {
-      var sol = CurrentScope.Variables[TargetParameter.ActualName].Value as BinaryVector;
+      BinaryVector sol = CurrentScope.Variables[TargetParameter.ActualName].Value as BinaryVector;
 
       // calculate value-to-weight ratio
Index: /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/Knapsack/KnapsackMultipleGuidesPathRelinker.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/Knapsack/KnapsackMultipleGuidesPathRelinker.cs	(revision 7785)
+++ /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/Knapsack/KnapsackMultipleGuidesPathRelinker.cs	(revision 7786)
@@ -54,6 +54,6 @@
         throw new ArgumentException("RelinkingAccuracy must be greater than 0.");
 
-      var v1 = initiator.Clone() as BinaryVector;
-      var targets = new BinaryVector[guides.Length];
+      BinaryVector v1 = initiator.Clone() as BinaryVector;
+      BinaryVector[] targets = new BinaryVector[guides.Length];
       Array.Copy(guides, targets, guides.Length);
 
@@ -61,16 +61,16 @@
         throw new ArgumentException("At least one solution is of different length.");
 
-      var solutions = new List<BinaryVector>();
+      IList<BinaryVector> solutions = new List<BinaryVector>();
       for (int i = 0; i < v1.Length; i++) {
         // TODO: path relinking
       }
 
-      var selection = new List<IItem>();
+      IList<IItem> selection = new List<IItem>();
       if (solutions.Count > 0) {
-        var noSol = (int)Math.Round(solutions.Count * n.Value);
+        int noSol = (int)(solutions.Count * n.Value);
         if (noSol <= 0) noSol++;
-        var stepSize = (double)solutions.Count / (double)noSol;
+        double stepSize = (double)solutions.Count / (double)noSol;
         for (int i = 0; i < noSol; i++)
-          selection.Add(solutions.ElementAt((int)Math.Round((i + 1) * stepSize - stepSize * 0.5)));
+          selection.Add(solutions.ElementAt((int)((i + 1) * stepSize - stepSize * 0.5)));
       }
 
Index: /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/Knapsack/KnapsackPathRelinker.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/Knapsack/KnapsackPathRelinker.cs	(revision 7785)
+++ /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/Knapsack/KnapsackPathRelinker.cs	(revision 7786)
@@ -54,11 +54,11 @@
         throw new ArgumentException("RelinkingAccuracy must be greater than 0.");
 
-      var v1 = initiator.Clone() as BinaryVector;
-      var v2 = guide as BinaryVector;
+      BinaryVector v1 = initiator.Clone() as BinaryVector;
+      BinaryVector v2 = guide as BinaryVector;
 
       if (v1.Length != v2.Length)
         throw new ArgumentException("The solutions are of different length.");
 
-      var solutions = new List<BinaryVector>();
+      IList<BinaryVector> solutions = new List<BinaryVector>();
       for (int i = 0; i < v1.Length; i++)
         if (v1[i] != v2[i]) {
@@ -67,11 +67,11 @@
         }
 
-      var selection = new List<IItem>();
+      IList<IItem> selection = new List<IItem>();
       if (solutions.Count > 0) {
-        var noSol = (int)Math.Round(solutions.Count * n.Value);
+        int noSol = (int)(solutions.Count * n.Value);
         if (noSol <= 0) noSol++;
-        var stepSize = (double)solutions.Count / (double)noSol;
+        double stepSize = (double)solutions.Count / (double)noSol;
         for (int i = 0; i < noSol; i++)
-          selection.Add(solutions.ElementAt((int)Math.Round((i + 1) * stepSize - stepSize * 0.5)));
+          selection.Add(solutions.ElementAt((int)((i + 1) * stepSize - stepSize * 0.5)));
       }
 
Index: /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/Knapsack/KnapsackSimilarityCalculator.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/Knapsack/KnapsackSimilarityCalculator.cs	(revision 7786)
+++ /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/Knapsack/KnapsackSimilarityCalculator.cs	(revision 7786)
@@ -0,0 +1,53 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.BinaryVectorEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Algorithms.ScatterSearch.Knapsack {
+  /// <summary>
+  /// An operator that performs similarity calculation between two knapsack solutions.
+  /// </summary>
+  [Item("KnapsackSimilarityCalculator", "An operator that performs similarity calculation between two knapsack solutions.")]
+  [StorableClass]
+  public sealed class KnapsackSimilarityCalculator : SimilarityCalculator {
+    [StorableConstructor]
+    private KnapsackSimilarityCalculator(bool deserializing) : base(deserializing) { }
+    private KnapsackSimilarityCalculator(KnapsackSimilarityCalculator original, Cloner cloner) : base(original, cloner) { }
+    public KnapsackSimilarityCalculator() : base() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new KnapsackSimilarityCalculator(this, cloner);
+    }
+
+    protected override double CalculateDiversity(IScope left, IScope right) {
+      BinaryVector sol1 = left.Variables["KnapsackSolution"].Value as BinaryVector;
+      BinaryVector sol2 = right.Variables["KnapsackSolution"].Value as BinaryVector;
+
+      double similarity = 0.0;
+      for (int i = 0; i < sol1.Length; i++)
+        if (sol1[i] == sol2[i]) similarity++;
+      return similarity / sol1.Length;
+    }
+  }
+}
Index: /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/Knapsack/KnapsackSimultaneousPathRelinker.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/Knapsack/KnapsackSimultaneousPathRelinker.cs	(revision 7785)
+++ /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/Knapsack/KnapsackSimultaneousPathRelinker.cs	(revision 7786)
@@ -54,13 +54,13 @@
         throw new ArgumentException("RelinkingAccuracy must be greater than 0.");
 
-      var firstInitiator = initiator.Clone() as BinaryVector;
-      var firstGuide = guide.Clone() as BinaryVector;
-      var secondInitiator = firstGuide.Clone() as BinaryVector;
-      var secondGuide = firstInitiator.Clone() as BinaryVector;
+      BinaryVector firstInitiator = initiator.Clone() as BinaryVector;
+      BinaryVector firstGuide = guide.Clone() as BinaryVector;
+      BinaryVector secondInitiator = firstGuide.Clone() as BinaryVector;
+      BinaryVector secondGuide = firstInitiator.Clone() as BinaryVector;
 
       if (firstInitiator.Length != firstGuide.Length)
         throw new ArgumentException("The solutions are of different length.");
 
-      var solutions = new List<BinaryVector>();
+      IList<BinaryVector> solutions = new List<BinaryVector>();
       for (int i = 0; i < firstInitiator.Length / 2; i++) {
         if (firstInitiator[i] != firstGuide[i]) {
@@ -68,5 +68,5 @@
           solutions.Add(firstInitiator.Clone() as BinaryVector);
         }
-        var j = secondInitiator.Length - 1 - i;
+        int j = secondInitiator.Length - 1 - i;
         if (secondInitiator[j] != secondGuide[j]) {
           secondInitiator[j] = secondGuide[j];
@@ -75,11 +75,11 @@
       }
 
-      var selection = new List<IItem>();
+      IList<IItem> selection = new List<IItem>();
       if (solutions.Count > 0) {
-        var noSol = (int)Math.Round(solutions.Count * n.Value);
+        int noSol = (int)(solutions.Count * n.Value);
         if (noSol <= 0) noSol++;
-        var stepSize = (double)solutions.Count / (double)noSol;
+        double stepSize = (double)solutions.Count / (double)noSol;
         for (int i = 0; i < noSol; i++)
-          selection.Add(solutions.ElementAt((int)Math.Round((i + 1) * stepSize - stepSize * 0.5)));
+          selection.Add(solutions.ElementAt((int)((i + 1) * stepSize - stepSize * 0.5)));
       }
 
Index: anches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/Knapsack/NBinaryVectorCrossover.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/Knapsack/NBinaryVectorCrossover.cs	(revision 7785)
+++ 	(revision )
@@ -1,81 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Encodings.BinaryVectorEncoding;
-using HeuristicLab.Operators;
-using HeuristicLab.Optimization;
-using HeuristicLab.Parameters;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Algorithms.ScatterSearch.Knapsack {
-  /// <summary>
-  /// A base class for operators that perform a crossover of bool-valued vectors.
-  /// </summary>
-  [Item("NBinaryVectorCrossover", "A base class for operators that perform a crossover of bool-valued vectors.")]
-  [StorableClass]
-  public abstract class NBinaryVectorCrossover : SingleSuccessorOperator, INBinaryVectorCrossover, IStochasticOperator {
-    public override bool CanChangeName {
-      get { return false; }
-    }
-
-    #region Parameter properties
-    public ScopeParameter CurrentScopeParameter {
-      get { return (ScopeParameter)Parameters["CurrentScope"]; }
-    }
-    public ILookupParameter<IRandom> RandomParameter {
-      get { return (ILookupParameter<IRandom>)Parameters["Random"]; }
-    }
-    public ILookupParameter<ItemArray<BinaryVector>> ParentsParameter {
-      get { return (IScopeTreeLookupParameter<BinaryVector>)Parameters["Parents"]; }
-    }
-    #endregion
-
-    #region Properties
-    private IScope CurrentScope {
-      get { return CurrentScopeParameter.ActualValue; }
-    }
-    #endregion
-
-    [StorableConstructor]
-    protected NBinaryVectorCrossover(bool deserializing) : base(deserializing) { }
-    protected NBinaryVectorCrossover(NBinaryVectorCrossover original, Cloner cloner) : base(original, cloner) { }
-    protected NBinaryVectorCrossover()
-      : base() {
-      #region Create parameters
-      Parameters.Add(new ScopeParameter("CurrentScope"));
-      Parameters.Add(new LookupParameter<IRandom>("Random"));
-      Parameters.Add(new ScopeTreeLookupParameter<BinaryVector>("Parents"));
-      #endregion
-      ParentsParameter.ActualName = "BinaryVector";
-    }
-
-    public sealed override IOperation Apply() {
-      var offspringSolutions = Cross(RandomParameter.ActualValue, ParentsParameter.ActualValue);
-      for (int i = 0; i < offspringSolutions.Length; i++)
-        CurrentScope.Variables.Add(new Variable(string.Format("Child {0}", i), offspringSolutions[i]));
-      return base.Apply();
-    }
-
-    protected abstract ItemArray<BinaryVector> Cross(IRandom random, ItemArray<BinaryVector> parents);
-  }
-}
Index: anches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/Knapsack/NChildCrossover.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/Knapsack/NChildCrossover.cs	(revision 7785)
+++ 	(revision )
@@ -1,84 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Encodings.BinaryVectorEncoding;
-using HeuristicLab.Parameters;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Algorithms.ScatterSearch.Knapsack {
-  /// <summary>
-  /// N child crossover for binary vectors.
-  /// </summary>
-  [Item("NChildCrossover", "N child crossover for binary vectors.")]
-  [StorableClass]
-  public sealed class NChildCrossover : NBinaryVectorCrossover {
-    #region Parameter properties
-    public IValueLookupParameter<IntValue> NParameter {
-      get { return (IValueLookupParameter<IntValue>)Parameters["N"]; }
-    }
-    #endregion
-
-    [StorableConstructor]
-    private NChildCrossover(bool deserializing) : base(deserializing) { }
-    private NChildCrossover(NChildCrossover original, Cloner cloner) : base(original, cloner) { }
-    public NChildCrossover()
-      : base() {
-      #region Create parameters
-      Parameters.Add(new ValueLookupParameter<IntValue>("N", "Number of children.", new IntValue(2)));
-      #endregion
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new NChildCrossover(this, cloner);
-    }
-
-    public static ItemArray<BinaryVector> Apply(IRandom random, BinaryVector parent1, BinaryVector parent2, IntValue n) {
-      if (parent1.Length != parent2.Length)
-        throw new ArgumentException("NChildCrossover: The parents are of different length.");
-      if (n.Value > Math.Pow(2, parent1.Length) - 2)
-        throw new ArgumentException("NChildCrossover: There cannot be more children than 2^size of parents - 2.");
-      if (n.Value < 1)
-        throw new ArgumentException("NChildCrossover: N cannot be < 1.");
-
-      var solutions = new BinaryVector[n.Value];
-      for (int i = 0; i < n.Value; i++) {
-        var solution = new BinaryVector(parent1.Length);
-        for (int j = 0; j < solution.Length; j++)
-          solution[j] = random.Next(2) % 2 == 0 ? parent1[j] : parent2[j];
-        solutions[i] = solution;
-      }
-
-      return new ItemArray<BinaryVector>(solutions);
-    }
-
-    protected override ItemArray<BinaryVector> Cross(IRandom random, ItemArray<BinaryVector> parents) {
-      if (parents.Length != 2)
-        throw new ArgumentException("NChildCrossover: The number of parents is not equal to 2.");
-      if (NParameter.ActualValue == null)
-        throw new InvalidOperationException("NChildCrossover: Parameter " + NParameter.ActualName + " could not be found.");
-      return Apply(random, parents[0], parents[1], NParameter.Value);
-    }
-  }
-}
Index: /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/OffspringProcessor.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/OffspringProcessor.cs	(revision 7785)
+++ /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/OffspringProcessor.cs	(revision 7786)
@@ -32,5 +32,5 @@
   [Item("OffspringProcessor", "An operator that creates a subscope with subscopes for every variable in the current scope.")]
   [StorableClass]
-  public sealed class OffspringProcessor : SingleSuccessorOperator, IScatterSearchTargetProcessor {
+  public sealed class OffspringProcessor : SingleSuccessorOperator {
     #region Parameter properties
     public ScopeParameter CurrentScopeParameter {
@@ -54,5 +54,11 @@
     private OffspringProcessor(bool deserializing) : base(deserializing) { }
     private OffspringProcessor(OffspringProcessor original, Cloner cloner) : base(original, cloner) { }
-    public OffspringProcessor() : base() { Initialize(); }
+    public OffspringProcessor()
+      : base() {
+      #region Create parameters
+      Parameters.Add(new ScopeParameter("CurrentScope"));
+      Parameters.Add(new ValueLookupParameter<IItem>("Target"));
+      #endregion
+    }
 
     public override IDeepCloneable Clone(Cloner cloner) {
@@ -60,17 +66,9 @@
     }
 
-    private void Initialize() {
-      #region Create parameters
-      Parameters.Add(new ScopeParameter("CurrentScope"));
-      Parameters.Add(new ValueLookupParameter<IItem>("Target"));
-      #endregion
-      TargetParameter.ActualName = "KnapsackSolution"; // temporary solution for the knapsack problem
-    }
-
     public override IOperation Apply() {
-      var offspringSolutions = CurrentScope.Variables;
-      var offspringScope = new Scope("Offspring");
+      VariableCollection offspringSolutions = CurrentScope.Variables;
+      IScope offspringScope = new Scope("Offspring");
       foreach (var solution in offspringSolutions) {
-        var scope = new Scope();
+        IScope scope = new Scope();
         scope.Variables.Add(new Variable(TargetParameter.ActualName, solution.Value));
         offspringScope.SubScopes.Add(scope);
Index: /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/PathRelinker.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/PathRelinker.cs	(revision 7785)
+++ /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/PathRelinker.cs	(revision 7786)
@@ -38,9 +38,9 @@
       get { return (ScopeParameter)Parameters["CurrentScope"]; }
     }
+    public ILookupParameter<ItemArray<IItem>> ParentsParameter {
+      get { return (IScopeTreeLookupParameter<IItem>)Parameters["Parents"]; }
+    }
     public IValueParameter<PercentValue> RelinkingAccuracyParameter {
       get { return (IValueParameter<PercentValue>)Parameters["RelinkingAccuracy"]; }
-    }
-    public ILookupParameter<ItemArray<IItem>> ParentsParameter {
-      get { return (IScopeTreeLookupParameter<IItem>)Parameters["Parents"]; }
     }
     #endregion
@@ -50,9 +50,9 @@
       get { return CurrentScopeParameter.ActualValue; }
     }
+    private ItemArray<IItem> Parents {
+      get { return ParentsParameter.ActualValue; }
+    }
     private PercentValue RelinkingAccuracy {
       get { return RelinkingAccuracyParameter.Value; }
-    }
-    private ItemArray<IItem> Parents {
-      get { return ParentsParameter.ActualValue; }
     }
     #endregion
@@ -65,11 +65,11 @@
       #region Create parameters
       Parameters.Add(new ScopeParameter("CurrentScope"));
+      Parameters.Add(new ScopeTreeLookupParameter<IItem>("Parents"));
       Parameters.Add(new ValueParameter<PercentValue>("RelinkingAccuracy", new PercentValue(0.25)));
-      Parameters.Add(new ScopeTreeLookupParameter<IItem>("Parents"));
       #endregion
     }
 
     public sealed override IOperation Apply() {
-      var relinkedSolutions = Relink(Parents, RelinkingAccuracy);
+      ItemArray<IItem> relinkedSolutions = Relink(Parents, RelinkingAccuracy);
       for (int i = 0; i < relinkedSolutions.Length; i++)
         CurrentScope.Variables.Add(new Variable(string.Format("Child {0}", i), relinkedSolutions[i]));
Index: /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/PopulationRebuildMethod.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/PopulationRebuildMethod.cs	(revision 7785)
+++ /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/PopulationRebuildMethod.cs	(revision 7786)
@@ -45,9 +45,9 @@
       get { return (IValueLookupParameter<IntValue>)Parameters["NumberOfHighQualitySolutions"]; }
     }
+    public IValueLookupParameter<IItem> QualityParameter {
+      get { return (IValueLookupParameter<IItem>)Parameters["Quality"]; }
+    }
     public IValueLookupParameter<IntValue> ReferenceSetSizeParameter {
       get { return (IValueLookupParameter<IntValue>)Parameters["ReferenceSetSize"]; }
-    }
-    public IValueLookupParameter<IItem> QualityParameter {
-      get { return (IValueLookupParameter<IItem>)Parameters["Quality"]; }
     }
     #endregion
@@ -65,10 +65,10 @@
       set { NumberOfHighQualitySolutionsParameter.ActualValue = value; }
     }
+    private IItem Quality {
+      get { return QualityParameter.ActualValue; }
+    }
     private IntValue ReferenceSetSize {
       get { return ReferenceSetSizeParameter.ActualValue; }
       set { ReferenceSetSizeParameter.ActualValue = value; }
-    }
-    private IItem Quality {
-      get { return QualityParameter.ActualValue; }
     }
     #endregion
@@ -77,5 +77,14 @@
     private PopulationRebuildMethod(bool deserializing) : base(deserializing) { }
     private PopulationRebuildMethod(PopulationRebuildMethod original, Cloner cloner) : base(original, cloner) { }
-    public PopulationRebuildMethod() : base() { Initialize(); }
+    public PopulationRebuildMethod()
+      : base() {
+      #region Create parameters
+      Parameters.Add(new ScopeParameter("CurrentScope"));
+      Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization"));
+      Parameters.Add(new ValueLookupParameter<IntValue>("NumberOfHighQualitySolutions"));
+      Parameters.Add(new ValueLookupParameter<IItem>("Quality"));
+      Parameters.Add(new ValueLookupParameter<IntValue>("ReferenceSetSize"));
+      #endregion
+    }
 
     public override IDeepCloneable Clone(Cloner cloner) {
@@ -83,17 +92,7 @@
     }
 
-    private void Initialize() {
-      #region Create parameters
-      Parameters.Add(new ScopeParameter("CurrentScope"));
-      Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization"));
-      Parameters.Add(new ValueLookupParameter<IntValue>("NumberOfHighQualitySolutions"));
-      Parameters.Add(new ValueLookupParameter<IntValue>("ReferenceSetSize"));
-      Parameters.Add(new ValueLookupParameter<IItem>("Quality"));
-      #endregion
-    }
-
     public override IOperation Apply() {
-      var populationScope = CurrentScope.SubScopes[0];
-      var referenceSetScope = CurrentScope.SubScopes[1];
+      IScope populationScope = CurrentScope.SubScopes[0];
+      IScope referenceSetScope = CurrentScope.SubScopes[1];
       var orderedReferenceSet = Maximization.Value ? referenceSetScope.SubScopes.OrderByDescending(r => r.Variables[QualityParameter.ActualName].Value) :
                                                      referenceSetScope.SubScopes.OrderBy(r => r.Variables[QualityParameter.ActualName].Value);
Index: /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/ReferenceSetUpdateMethod.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/ReferenceSetUpdateMethod.cs	(revision 7785)
+++ /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/ReferenceSetUpdateMethod.cs	(revision 7786)
@@ -40,15 +40,12 @@
       get { return (ScopeParameter)Parameters["CurrentScope"]; }
     }
-    public IValueLookupParameter<IntValue> NumberOfHighQualitySolutionsParameter {
-      get { return (IValueLookupParameter<IntValue>)Parameters["NumberOfHighQualitySolutions"]; }
-    }
     public IValueLookupParameter<IntValue> ReferenceSetSizeParameter {
       get { return (IValueLookupParameter<IntValue>)Parameters["ReferenceSetSize"]; }
     }
+    public IValueLookupParameter<SimilarityCalculator> SimilarityCalculatorParameter {
+      get { return (IValueLookupParameter<SimilarityCalculator>)Parameters["SimilarityCalculator"]; }
+    }
     public IValueLookupParameter<IItem> TargetParameter {
       get { return (IValueLookupParameter<IItem>)Parameters["Target"]; }
-    }
-    public IValueLookupParameter<DiversityCalculator> DiversityCalculatorParameter {
-      get { return (IValueLookupParameter<DiversityCalculator>)Parameters["DiversityCalculator"]; }
     }
     #endregion
@@ -58,15 +55,12 @@
       get { return CurrentScopeParameter.ActualValue; }
     }
-    private IntValue NumberOfHighQualitySolutions {
-      get { return NumberOfHighQualitySolutionsParameter.ActualValue; }
-    }
     private IntValue ReferenceSetSize {
       get { return ReferenceSetSizeParameter.ActualValue; }
     }
+    private SimilarityCalculator SimilarityCalculator {
+      get { return SimilarityCalculatorParameter.ActualValue; }
+    }
     private IItem Target {
       get { return TargetParameter.ActualValue; }
-    }
-    private DiversityCalculator DiversityCalculator {
-      get { return DiversityCalculatorParameter.ActualValue; }
     }
     #endregion
@@ -75,5 +69,13 @@
     private ReferenceSetUpdateMethod(bool deserializing) : base(deserializing) { }
     private ReferenceSetUpdateMethod(ReferenceSetUpdateMethod original, Cloner cloner) : base(original, cloner) { }
-    public ReferenceSetUpdateMethod() : base() { Initialize(); }
+    public ReferenceSetUpdateMethod()
+      : base() {
+      #region Create parameters
+      Parameters.Add(new ScopeParameter("CurrentScope"));
+      Parameters.Add(new ValueLookupParameter<IntValue>("ReferenceSetSize"));
+      Parameters.Add(new ValueLookupParameter<SimilarityCalculator>("SimilarityCalculator"));
+      Parameters.Add(new ValueLookupParameter<IItem>("Target"));
+      #endregion
+    }
 
     public override IDeepCloneable Clone(Cloner cloner) {
@@ -81,27 +83,15 @@
     }
 
-    private void Initialize() {
-      #region Create parameters
-      Parameters.Add(new ScopeParameter("CurrentScope"));
-      Parameters.Add(new ValueLookupParameter<IntValue>("NumberOfHighQualitySolutions"));
-      Parameters.Add(new ValueLookupParameter<IntValue>("ReferenceSetSize"));
-      Parameters.Add(new ValueLookupParameter<IItem>("Target"));
-      Parameters.Add(new ValueLookupParameter<DiversityCalculator>("DiversityCalculator"));
-      #endregion
-      TargetParameter.ActualName = "KnapsackSolution"; // temporary solution for the knapsack problem
-    }
-
     public override IOperation Apply() {
-      var population = new Dictionary<IScope, double>();
+      IDictionary<IScope, double> population = new Dictionary<IScope, double>();
       foreach (var pScope in CurrentScope.SubScopes[0].SubScopes) {
-        double diversity = 0;
-        var pSol = pScope.Variables[TargetParameter.ActualName].Value;
+        double similarity = 0;
         foreach (var rScope in CurrentScope.SubScopes[1].SubScopes) {
-          var rSol = rScope.Variables[TargetParameter.ActualName].Value;
-          diversity += DiversityCalculator.ExecuteCalculation(pSol, rSol);
+          similarity += SimilarityCalculator.ExecuteCalculation(pScope, rScope);
         }
-        population[pScope] = diversity;
+        population[pScope] = similarity;
       }
-      foreach (var entry in population.OrderByDescending(x => x.Value).Take(ReferenceSetSize.Value - NumberOfHighQualitySolutions.Value)) {
+      int numberOfHighQualitySolutions = CurrentScope.SubScopes[1].SubScopes.Count;
+      foreach (var entry in population.OrderBy(x => x.Value).Take(ReferenceSetSize.Value - numberOfHighQualitySolutions)) {
         CurrentScope.SubScopes[1].SubScopes.Add(entry.Key);
         CurrentScope.SubScopes[0].SubScopes.Remove(entry.Key);
Index: /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/ScatterSearch.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/ScatterSearch.cs	(revision 7785)
+++ /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/ScatterSearch.cs	(revision 7786)
@@ -31,4 +31,5 @@
 using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.PluginInfrastructure;
 using HeuristicLab.Random;
 using HeuristicLab.Selection;
@@ -61,9 +62,9 @@
       get { return (ConstrainedValueParameter<ICrossover>)Parameters["Crossover"]; }
     }
-    public ConstrainedValueParameter<ILocalImprovementOperator> ImproverParameter {
-      get { return (ConstrainedValueParameter<ILocalImprovementOperator>)Parameters["Improver"]; }
-    }
-    public ConstrainedValueParameter<DiversityCalculator> DiversityCalculatorParameter {
-      get { return (ConstrainedValueParameter<DiversityCalculator>)Parameters["DiversityCalculator"]; }
+    public IValueParameter<BoolValue> ExecutePathRelinkingParameter {
+      get { return (IValueLookupParameter<BoolValue>)Parameters["ExecutePathRelinking"]; }
+    }
+    public ConstrainedValueParameter<IImprovementOperator> ImproverParameter {
+      get { return (ConstrainedValueParameter<IImprovementOperator>)Parameters["Improver"]; }
     }
     public IValueParameter<IntValue> MaximumIterationsParameter {
@@ -73,4 +74,7 @@
       get { return (IValueParameter<IntValue>)Parameters["NumberOfHighQualitySolutions"]; }
     }
+    public ConstrainedValueParameter<IPathRelinker> PathRelinkerParameter {
+      get { return (ConstrainedValueParameter<IPathRelinker>)Parameters["PathRelinker"]; }
+    }
     public IValueParameter<IntValue> PopulationSizeParameter {
       get { return (IValueParameter<IntValue>)Parameters["PopulationSize"]; }
@@ -84,4 +88,7 @@
     public IValueParameter<BoolValue> SetSeedRandomlyParameter {
       get { return (IValueParameter<BoolValue>)Parameters["SetSeedRandomly"]; }
+    }
+    public ConstrainedValueParameter<SimilarityCalculator> SimilarityCalculatorParameter {
+      get { return (ConstrainedValueParameter<SimilarityCalculator>)Parameters["SimilarityCalculator"]; }
     }
     #endregion
@@ -96,11 +103,11 @@
       set { CrossoverParameter.Value = value; }
     }
-    private ILocalImprovementOperator Improver {
+    private BoolValue ExecutePathRelinking {
+      get { return ExecutePathRelinkingParameter.Value; }
+      set { ExecutePathRelinkingParameter.Value = value; }
+    }
+    private IImprovementOperator Improver {
       get { return ImproverParameter.Value; }
       set { ImproverParameter.Value = value; }
-    }
-    private DiversityCalculator DiversityCalculator {
-      get { return DiversityCalculatorParameter.Value; }
-      set { DiversityCalculatorParameter.Value = value; }
     }
     private IntValue MaximumIterations {
@@ -112,4 +119,8 @@
       set { NumberOfHighQualitySolutionsParameter.Value = value; }
     }
+    private IPathRelinker PathRelinker {
+      get { return PathRelinkerParameter.Value; }
+      set { PathRelinkerParameter.Value = value; }
+    }
     private IntValue PopulationSize {
       get { return PopulationSizeParameter.Value; }
@@ -128,11 +139,15 @@
       set { SetSeedRandomlyParameter.Value = value; }
     }
-    public RandomCreator RandomCreator {
+    private SimilarityCalculator SimilarityCalculator {
+      get { return SimilarityCalculatorParameter.Value; }
+      set { SimilarityCalculatorParameter.Value = value; }
+    }
+    private RandomCreator RandomCreator {
       get { return (RandomCreator)OperatorGraph.InitialOperator; }
     }
-    public SolutionsCreator SolutionsCreator {
+    private SolutionsCreator SolutionsCreator {
       get { return (SolutionsCreator)RandomCreator.Successor; }
     }
-    public ScatterSearchMainLoop MainLoop {
+    private ScatterSearchMainLoop MainLoop {
       get { return FindMainLoop(SolutionsCreator.Successor); }
     }
@@ -159,14 +174,16 @@
       : base() {
       #region Create parameters
-      Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze the solution and moves.", new MultiAnalyzer()));
-      Parameters.Add(new ConstrainedValueParameter<ICrossover>("Crossover", "The operator used to combine solutions."));
-      Parameters.Add(new ConstrainedValueParameter<ILocalImprovementOperator>("Improver", "The operator used to improve solutions."));
-      Parameters.Add(new ConstrainedValueParameter<DiversityCalculator>("DiversityCalculator", "The operator used to calculate the diversity of two solutions."));
-      Parameters.Add(new ValueParameter<IntValue>("MaximumIterations", "The maximum number of generations which should be processed.", new IntValue(100)));
-      Parameters.Add(new ValueParameter<IntValue>("NumberOfHighQualitySolutions", "The number of high quality solutions that should be added to the reference set.", new IntValue(10)));
-      Parameters.Add(new ValueParameter<IntValue>("PopulationSize", "The size of the population.", new IntValue(300)));
-      Parameters.Add(new ValueParameter<IntValue>("ReferenceSetSize", "The size of the reference set.", new IntValue(100)));
-      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 ValueParameter<MultiAnalyzer>("Analyzer", new MultiAnalyzer()));
+      Parameters.Add(new ConstrainedValueParameter<ICrossover>("Crossover"));
+      Parameters.Add(new ValueParameter<BoolValue>("ExecutePathRelinking", new BoolValue(true)));
+      Parameters.Add(new ConstrainedValueParameter<IImprovementOperator>("Improver"));
+      Parameters.Add(new ValueParameter<IntValue>("MaximumIterations", new IntValue(100)));
+      Parameters.Add(new ValueParameter<IntValue>("NumberOfHighQualitySolutions", new IntValue(10)));
+      Parameters.Add(new ConstrainedValueParameter<IPathRelinker>("PathRelinker"));
+      Parameters.Add(new ValueParameter<IntValue>("PopulationSize", new IntValue(300)));
+      Parameters.Add(new ValueParameter<IntValue>("ReferenceSetSize", new IntValue(100)));
+      Parameters.Add(new ValueParameter<IntValue>("Seed", new IntValue(0)));
+      Parameters.Add(new ValueParameter<BoolValue>("SetSeedRandomly", new BoolValue(true)));
+      Parameters.Add(new ConstrainedValueParameter<SimilarityCalculator>("SimilarityCalculator"));
       #endregion
 
@@ -178,6 +195,4 @@
       Placeholder solutionImprover = new Placeholder();
       BestSelector bestSelector = new BestSelector();
-      VariableCreator variableCreator = new VariableCreator();
-      ResultsCollector resultsCollector = new ResultsCollector();
       ScatterSearchMainLoop mainLoop = new ScatterSearchMainLoop();
       #endregion
@@ -207,13 +222,5 @@
       bestSelector.NumberOfSelectedSubScopesParameter.ActualName = NumberOfHighQualitySolutionsParameter.Name;
       bestSelector.CopySelected = new BoolValue(false);
-      bestSelector.Successor = variableCreator;
-
-      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Iterations", new IntValue(0)));
-      variableCreator.CollectedValues.Add(new ValueParameter<BoolValue>("NewSolutions", new BoolValue(false)));
-      variableCreator.Successor = resultsCollector;
-
-      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Iterations"));
-      resultsCollector.ResultsParameter.ActualName = "Results";
-      resultsCollector.Successor = mainLoop;
+      bestSelector.Successor = mainLoop;
 
       mainLoop.MaximumIterationsParameter.ActualName = MaximumIterationsParameter.Name;
@@ -236,5 +243,5 @@
 
     public override void Prepare() {
-      base.Prepare();
+      if (Problem != null) base.Prepare();
     }
 
@@ -249,7 +256,8 @@
       UpdateAnalyzers();
       UpdateCrossovers();
-      UpdateDiversityCalculators();
+      UpdatePathRelinkers();
+      UpdateSimilarityCalculators();
       UpdateImprovers();
-      UpdateDiversityCalculators();
+      UpdateSimilarityCalculators();
       Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
       base.OnProblemChanged();
@@ -272,5 +280,6 @@
       UpdateAnalyzers();
       UpdateCrossovers();
-      UpdateDiversityCalculators();
+      UpdatePathRelinkers();
+      UpdateSimilarityCalculators();
       UpdateImprovers();
       ParameterizeMainLoop();
@@ -306,16 +315,6 @@
       ICrossover defaultCrossover = Problem.Operators.OfType<ICrossover>().FirstOrDefault();
 
-      CrossoverParameter.ValidValues.Add(new Knapsack.KnapsackPathRelinker());
-      CrossoverParameter.ValidValues.Add(new Knapsack.KnapsackSimultaneousPathRelinker());
-      CrossoverParameter.ValidValues.Add(new TestFunctions.TestFunctionsPathRelinker());
-      CrossoverParameter.ValidValues.Add(new TravelingSalesman.TravelingSalesmanPathRelinker());
-      CrossoverParameter.ValidValues.Add(new TravelingSalesman.TravelingSalesmanSimultaneousPathRelinker());
-      CrossoverParameter.ValidValues.Add(new TravelingSalesman.TravelingSalesmanMultipleGuidesPathRelinker());
-
       foreach (ICrossover crossover in Problem.Operators.OfType<ICrossover>().OrderBy(x => x.Name))
         CrossoverParameter.ValidValues.Add(crossover);
-
-      foreach (var crossover in CrossoverParameter.ValidValues.OfType<Knapsack.INBinaryVectorCrossover>())
-        crossover.ParentsParameter.ActualName = "KnapsackSolution"; // temporary solution for the knapsack problem
 
       if (oldCrossover != null) {
@@ -327,50 +326,17 @@
         CrossoverParameter.Value = defaultCrossover;
     }
-    private void UpdateDiversityCalculators() {
-      DiversityCalculator oldDiversityCalculator = DiversityCalculatorParameter.Value;
-      DiversityCalculatorParameter.ValidValues.Clear();
-      DiversityCalculator defaultDiversityCalculator = Problem.Operators.OfType<DiversityCalculator>().FirstOrDefault();
-
-      DiversityCalculatorParameter.ValidValues.Add(new Knapsack.BinaryVectorDiversityCalculator());
-      DiversityCalculatorParameter.ValidValues.Add(new TestFunctions.RealVectorDiversityCalculator());
-      DiversityCalculatorParameter.ValidValues.Add(new TravelingSalesman.PermutationDiversityCalculator());
-
-      foreach (DiversityCalculator diversityCalculator in Problem.Operators.OfType<DiversityCalculator>().OrderBy(x => x.Name))
-        DiversityCalculatorParameter.ValidValues.Add(diversityCalculator);
-
-      if (oldDiversityCalculator != null) {
-        DiversityCalculator diversityCalculator = DiversityCalculatorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldDiversityCalculator.GetType());
-        if (diversityCalculator != null) DiversityCalculatorParameter.Value = diversityCalculator;
-        else oldDiversityCalculator = null;
-      }
-      if (oldDiversityCalculator == null && defaultDiversityCalculator != null)
-        DiversityCalculatorParameter.Value = defaultDiversityCalculator;
-    }
     private void UpdateImprovers() {
-      ILocalImprovementOperator oldImprover = ImproverParameter.Value;
+      IImprovementOperator oldImprover = ImproverParameter.Value;
       ImproverParameter.ValidValues.Clear();
-      ILocalImprovementOperator defaultImprover = Problem.Operators.OfType<ILocalImprovementOperator>().FirstOrDefault();
-
-      ImproverParameter.ValidValues.Add(new Knapsack.KnapsackImprovementOperator());
-      ImproverParameter.ValidValues.Add(new TestFunctions.TestFunctionsAckleyImprovementOperator());
-      ImproverParameter.ValidValues.Add(new TestFunctions.TestFunctionsBealeImprovementOperator());
-      ImproverParameter.ValidValues.Add(new TestFunctions.TestFunctionsBoothImprovementOperator());
-      ImproverParameter.ValidValues.Add(new TestFunctions.TestFunctionsGriewankImprovementOperator());
-      ImproverParameter.ValidValues.Add(new TestFunctions.TestFunctionsLevyImprovementOperator());
-      ImproverParameter.ValidValues.Add(new TestFunctions.TestFunctionsMatyasImprovementOperator());
-      ImproverParameter.ValidValues.Add(new TestFunctions.TestFunctionsRosenbrockImprovementOperator());
-      ImproverParameter.ValidValues.Add(new TestFunctions.TestFunctionsSchwefelImprovementOperator());
-      ImproverParameter.ValidValues.Add(new TestFunctions.TestFunctionsSumSquaresImprovementOperator());
-      ImproverParameter.ValidValues.Add(new TestFunctions.TestFunctionsZakharovImprovementOperator());
-      ImproverParameter.ValidValues.Add(new TravelingSalesman.TravelingSalesmanImprovementOperator());
-
-      foreach (ILocalImprovementOperator improver in Problem.Operators.OfType<ILocalImprovementOperator>().OrderBy(x => x.Name))
+      IImprovementOperator defaultImprover = Problem.Operators.OfType<IImprovementOperator>().FirstOrDefault();
+
+      foreach (IImprovementOperator improver in ApplicationManager.Manager.GetInstances<IImprovementOperator>().OrderBy(x => x.Name))
         ImproverParameter.ValidValues.Add(improver);
 
-      foreach (var improver in ImproverParameter.ValidValues.OfType<IScatterSearchTargetProcessor>())
-        improver.TargetParameter.ActualName = "KnapsackSolution"; // temporary solution for the knapsack problem
+      foreach (IImprovementOperator improver in Problem.Operators.OfType<IImprovementOperator>().OrderBy(x => x.Name))
+        ImproverParameter.ValidValues.Add(improver);
 
       if (oldImprover != null) {
-        ILocalImprovementOperator improver = ImproverParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldImprover.GetType());
+        IImprovementOperator improver = ImproverParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldImprover.GetType());
         if (improver != null) ImproverParameter.Value = improver;
         else oldImprover = null;
@@ -378,4 +344,42 @@
       if (oldImprover == null && defaultImprover != null)
         ImproverParameter.Value = defaultImprover;
+    }
+    private void UpdatePathRelinkers() {
+      IPathRelinker oldPathRelinker = PathRelinkerParameter.Value;
+      PathRelinkerParameter.ValidValues.Clear();
+      IPathRelinker defaultPathRelinker = Problem.Operators.OfType<IPathRelinker>().FirstOrDefault();
+
+      foreach (IPathRelinker pathRelinker in ApplicationManager.Manager.GetInstances<IPathRelinker>().OrderBy(x => x.Name))
+        PathRelinkerParameter.ValidValues.Add(pathRelinker);
+
+      foreach (IPathRelinker pathRelinker in Problem.Operators.OfType<IPathRelinker>().OrderBy(x => x.Name))
+        PathRelinkerParameter.ValidValues.Add(pathRelinker);
+
+      if (oldPathRelinker != null) {
+        IPathRelinker pathRelinker = PathRelinkerParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldPathRelinker.GetType());
+        if (pathRelinker != null) PathRelinkerParameter.Value = pathRelinker;
+        else oldPathRelinker = null;
+      }
+      if (oldPathRelinker == null && defaultPathRelinker != null)
+        PathRelinkerParameter.Value = defaultPathRelinker;
+    }
+    private void UpdateSimilarityCalculators() {
+      SimilarityCalculator oldDiversityCalculator = SimilarityCalculatorParameter.Value;
+      SimilarityCalculatorParameter.ValidValues.Clear();
+      SimilarityCalculator defaultDiversityCalculator = Problem.Operators.OfType<SimilarityCalculator>().FirstOrDefault();
+
+      foreach (SimilarityCalculator diversityCalculator in ApplicationManager.Manager.GetInstances<SimilarityCalculator>().OrderBy(x => x.Name))
+        SimilarityCalculatorParameter.ValidValues.Add(diversityCalculator);
+
+      foreach (SimilarityCalculator diversityCalculator in Problem.Operators.OfType<SimilarityCalculator>().OrderBy(x => x.Name))
+        SimilarityCalculatorParameter.ValidValues.Add(diversityCalculator);
+
+      if (oldDiversityCalculator != null) {
+        SimilarityCalculator diversityCalculator = SimilarityCalculatorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldDiversityCalculator.GetType());
+        if (diversityCalculator != null) SimilarityCalculatorParameter.Value = diversityCalculator;
+        else oldDiversityCalculator = null;
+      }
+      if (oldDiversityCalculator == null && defaultDiversityCalculator != null)
+        SimilarityCalculatorParameter.Value = defaultDiversityCalculator;
     }
     private void ParameterizeSolutionsCreator() {
@@ -397,11 +401,4 @@
       }
     }
-    //private void ParameterizeScatterSearchTargetProcessor(IOperator op) {
-    //  if (op is IScatterSearchTargetProcessor) {
-    //    IScatterSearchTargetProcessor ssOp = (IScatterSearchTargetProcessor)op;
-    //    ssOp.TargetParameter.ActualName = "KnapsackSolution"; // temporary solution for the knapsack problem
-    //    ssOp.TargetParameter.Hidden = true;
-    //  }
-    //}
     private void ParameterizeAnalyzers() {
       qualityAnalyzer.ResultsParameter.ActualName = "Results";
@@ -422,6 +419,5 @@
       while (mainLoop != null && !(mainLoop is ScatterSearchMainLoop))
         mainLoop = ((SingleSuccessorOperator)mainLoop).Successor;
-      if (mainLoop == null) return null;
-      else return (ScatterSearchMainLoop)mainLoop;
+      return mainLoop as ScatterSearchMainLoop;
     }
     #endregion
Index: /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/ScatterSearchMainLoop.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/ScatterSearchMainLoop.cs	(revision 7785)
+++ /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/ScatterSearchMainLoop.cs	(revision 7786)
@@ -41,16 +41,34 @@
       get { return (IValueLookupParameter<IMultiAnalyzer>)Parameters["Analyzer"]; }
     }
+    public IValueLookupParameter<DoubleValue> BestKnownQualityParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
+    }
     public IValueLookupParameter<ICrossover> CrossoverParameter {
       get { return (IValueLookupParameter<ICrossover>)Parameters["Crossover"]; }
     }
-    public IValueLookupParameter<IOperator> ImproverParameter {
-      get { return (IValueLookupParameter<IOperator>)Parameters["Improver"]; }
-    }
-    public IValueLookupParameter<DiversityCalculator> DiversityCalculatorParameter {
-      get { return (IValueLookupParameter<DiversityCalculator>)Parameters["DiversityCalculator"]; }
+    public IValueLookupParameter<IEvaluator> EvaluatorParameter {
+      get { return (IValueLookupParameter<IEvaluator>)Parameters["Evaluator"]; }
+    }
+    public IValueLookupParameter<BoolValue> ExecutePathRelinkingParameter {
+      get { return (IValueLookupParameter<BoolValue>)Parameters["ExecutePathRelinking"]; }
+    }
+    public IValueLookupParameter<IImprovementOperator> ImproverParameter {
+      get { return (IValueLookupParameter<IImprovementOperator>)Parameters["Improver"]; }
+    }
+    public IValueLookupParameter<IntValue> IterationsParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters["Iterations"]; }
+    }
+    public IValueLookupParameter<BoolValue> MaximizationParameter {
+      get { return (IValueLookupParameter<BoolValue>)Parameters["Maximization"]; }
+    }
+    public IValueLookupParameter<IntValue> MaximumIterationsParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters["MaximumIterations"]; }
     }
     public IValueLookupParameter<IntValue> NumberOfHighQualitySolutionsParameter {
       get { return (IValueLookupParameter<IntValue>)Parameters["NumberOfHighQualitySolutions"]; }
     }
+    public IValueLookupParameter<IPathRelinker> PathRelinkerParameter {
+      get { return (IValueLookupParameter<IPathRelinker>)Parameters["PathRelinker"]; }
+    }
     public IValueLookupParameter<IntValue> PopulationSizeParameter {
       get { return (IValueLookupParameter<IntValue>)Parameters["PopulationSize"]; }
@@ -59,19 +77,4 @@
       get { return (IValueLookupParameter<IntValue>)Parameters["ReferenceSetSize"]; }
     }
-    public IValueLookupParameter<DoubleValue> BestKnownQualityParameter {
-      get { return (IValueLookupParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
-    }
-    public IValueLookupParameter<IEvaluator> EvaluatorParameter {
-      get { return (IValueLookupParameter<IEvaluator>)Parameters["Evaluator"]; }
-    }
-    public IValueLookupParameter<IntValue> IterationsParameter {
-      get { return (IValueLookupParameter<IntValue>)Parameters["Iterations"]; }
-    }
-    public IValueLookupParameter<BoolValue> MaximizationParameter {
-      get { return (IValueLookupParameter<BoolValue>)Parameters["Maximization"]; }
-    }
-    public IValueLookupParameter<IntValue> MaximumIterationsParameter {
-      get { return (IValueLookupParameter<IntValue>)Parameters["MaximumIterations"]; }
-    }
     public IValueLookupParameter<DoubleValue> QualityParameter {
       get { return (IValueLookupParameter<DoubleValue>)Parameters["Quality"]; }
@@ -83,6 +86,6 @@
       get { return (IValueLookupParameter<VariableCollection>)Parameters["Results"]; }
     }
-    public IValueLookupParameter<IntValue> SampleSizeParameter {
-      get { return (IValueLookupParameter<IntValue>)Parameters["SampleSize"]; }
+    public IValueLookupParameter<SimilarityCalculator> SimilarityCalculatorParameter {
+      get { return (IValueLookupParameter<SimilarityCalculator>)Parameters["SimilarityCalculator"]; }
     }
     public IValueLookupParameter<ISolutionCreator> SolutionCreatorParameter {
@@ -96,15 +99,35 @@
       set { AnalyzerParameter.ActualValue = value; }
     }
+    private DoubleValue BestKnownQuality {
+      get { return BestKnownQualityParameter.ActualValue; }
+      set { BestKnownQualityParameter.ActualValue = value; }
+    }
     private ICrossover Crossover {
       get { return CrossoverParameter.ActualValue; }
       set { CrossoverParameter.ActualValue = value; }
     }
-    private IOperator Improver {
+    private IEvaluator Evaluator {
+      get { return EvaluatorParameter.ActualValue; }
+      set { EvaluatorParameter.ActualValue = value; }
+    }
+    private BoolValue ExecutePathRelinking {
+      get { return ExecutePathRelinkingParameter.ActualValue; }
+      set { ExecutePathRelinkingParameter.ActualValue = value; }
+    }
+    private IImprovementOperator Improver {
       get { return ImproverParameter.ActualValue; }
       set { ImproverParameter.ActualValue = value; }
     }
-    private DiversityCalculator DiversityCalculator {
-      get { return DiversityCalculatorParameter.ActualValue; }
-      set { DiversityCalculatorParameter.ActualValue = value; }
+    private IntValue Iterations {
+      get { return IterationsParameter.ActualValue; }
+      set { IterationsParameter.ActualValue = value; }
+    }
+    private BoolValue Maximization {
+      get { return MaximizationParameter.ActualValue; }
+      set { MaximizationParameter.ActualValue = value; }
+    }
+    private IntValue MaximumIterations {
+      get { return MaximumIterationsParameter.ActualValue; }
+      set { MaximumIterationsParameter.ActualValue = value; }
     }
     private IntValue NumberOfHighQualitySolutions {
@@ -112,4 +135,8 @@
       set { NumberOfHighQualitySolutionsParameter.ActualValue = value; }
     }
+    private IPathRelinker PathRelinker {
+      get { return PathRelinkerParameter.ActualValue; }
+      set { PathRelinkerParameter.ActualValue = value; }
+    }
     private IntValue PopulationSize {
       get { return PopulationSizeParameter.ActualValue; }
@@ -120,24 +147,4 @@
       set { ReferenceSetSizeParameter.ActualValue = value; }
     }
-    private DoubleValue BestKnownQuality {
-      get { return BestKnownQualityParameter.ActualValue; }
-      set { BestKnownQualityParameter.ActualValue = value; }
-    }
-    private IEvaluator Evaluator {
-      get { return EvaluatorParameter.ActualValue; }
-      set { EvaluatorParameter.ActualValue = value; }
-    }
-    private IntValue Iterations {
-      get { return IterationsParameter.ActualValue; }
-      set { IterationsParameter.ActualValue = value; }
-    }
-    private BoolValue Maximization {
-      get { return MaximizationParameter.ActualValue; }
-      set { MaximizationParameter.ActualValue = value; }
-    }
-    private IntValue MaximumIterations {
-      get { return MaximumIterationsParameter.ActualValue; }
-      set { MaximumIterationsParameter.ActualValue = value; }
-    }
     private DoubleValue Quality {
       get { return QualityParameter.ActualValue; }
@@ -152,7 +159,7 @@
       set { ResultsParameter.ActualValue = value; }
     }
-    private IntValue SampleSize {
-      get { return SampleSizeParameter.ActualValue; }
-      set { SampleSizeParameter.ActualValue = value; }
+    private SimilarityCalculator SimilarityCalculator {
+      get { return SimilarityCalculatorParameter.ActualValue; }
+      set { SimilarityCalculatorParameter.ActualValue = value; }
     }
     private ISolutionCreator SolutionCreator {
@@ -173,43 +180,45 @@
     private void Initialize() {
       #region Create parameters
-      Parameters.Add(new ValueLookupParameter<IMultiAnalyzer>("Analyzer", "The operator used to analyze the solution and moves."));
-      Parameters.Add(new ValueLookupParameter<ICrossover>("Crossover", "The operator used to combine solutions."));
-      Parameters.Add(new ValueLookupParameter<IOperator>("Improver", "The operator used to improve solutions."));
-      Parameters.Add(new ValueLookupParameter<DiversityCalculator>("DiversityCalculator", "The operator used to calculate the diversity of two solutions."));
-      Parameters.Add(new ValueLookupParameter<IntValue>("NumberOfHighQualitySolutions", "The number of high quality solutions that should be added to the reference set."));
-      Parameters.Add(new ValueLookupParameter<IntValue>("PopulationSize", "The size of the population."));
-      Parameters.Add(new ValueLookupParameter<IntValue>("ReferenceSetSize", "The size of the reference set."));
-      Parameters.Add(new ValueLookupParameter<DoubleValue>("BestKnownQuality", "The problem's best known quality value found so far."));
-      Parameters.Add(new ValueLookupParameter<IEvaluator>("Evaluator", "The operator which is used to evaluate new solutions."));
-      Parameters.Add(new ValueLookupParameter<IntValue>("Iterations", "The number of iterations performed."));
-      Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, otherwise false."));
-      Parameters.Add(new ValueLookupParameter<IntValue>("MaximumIterations", "The maximum number of generations which should be processed."));
-      Parameters.Add(new ValueLookupParameter<DoubleValue>("Quality", "The value which represents the quality of a solution."));
-      Parameters.Add(new ValueLookupParameter<IRandom>("Random", "A pseudo random number generator."));
-      Parameters.Add(new ValueLookupParameter<VariableCollection>("Results", "The variable collection where results should be stored."));
-      Parameters.Add(new ValueLookupParameter<IntValue>("SampleSize", "Number of moves that MultiMoveGenerators should create. This is ignored for Exhaustive- and SingleMoveGenerators."));
-      Parameters.Add(new ValueLookupParameter<ISolutionCreator>("SolutionCreator", "The operator which is used to create new solutions."));
+      Parameters.Add(new ValueLookupParameter<IMultiAnalyzer>("Analyzer"));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>("BestKnownQuality"));
+      Parameters.Add(new ValueLookupParameter<ICrossover>("Crossover"));
+      Parameters.Add(new ValueLookupParameter<IEvaluator>("Evaluator"));
+      Parameters.Add(new ValueLookupParameter<BoolValue>("ExecutePathRelinking"));
+      Parameters.Add(new ValueLookupParameter<IOperator>("Improver"));
+      Parameters.Add(new ValueLookupParameter<IntValue>("Iterations"));
+      Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization"));
+      Parameters.Add(new ValueLookupParameter<IntValue>("MaximumIterations"));
+      Parameters.Add(new ValueLookupParameter<IntValue>("NumberOfHighQualitySolutions"));
+      Parameters.Add(new ValueLookupParameter<IPathRelinker>("PathRelinker"));
+      Parameters.Add(new ValueLookupParameter<IntValue>("PopulationSize"));
+      Parameters.Add(new ValueLookupParameter<IntValue>("ReferenceSetSize"));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>("Quality"));
+      Parameters.Add(new ValueLookupParameter<IRandom>("Random"));
+      Parameters.Add(new ValueLookupParameter<VariableCollection>("Results"));
+      Parameters.Add(new ValueLookupParameter<SimilarityCalculator>("SimilarityCalculator"));
+      Parameters.Add(new ValueLookupParameter<ISolutionCreator>("SolutionCreator"));
       #endregion
 
       #region Create operators
+      Placeholder analyzer = new Placeholder();
       Assigner assigner1 = new Assigner();
       Assigner assigner2 = new Assigner();
       ChildrenCreator childrenCreator = new ChildrenCreator();
+      Placeholder crossover = new Placeholder();
       Comparator iterationsChecker = new Comparator();
+      IntCounter iterationsCounter = new IntCounter();
+      MergingReducer mergingReducer = new MergingReducer();
+      ConditionalBranch executePathRelinkingBranch = new ConditionalBranch();
       ConditionalBranch newSolutionsBranch = new ConditionalBranch();
-      ConditionalBranch terminateBranch = new ConditionalBranch();
-      IntCounter interationsCounter = new IntCounter();
-      MergingReducer mergingReducer = new MergingReducer();
       OffspringProcessor offspringProcessor = new OffspringProcessor();
-      Placeholder analyzer = new Placeholder();
-      Placeholder crossover = new Placeholder();
+      Placeholder pathRelinker = new Placeholder();
+      PopulationRebuildMethod populationRebuildMethod = new PopulationRebuildMethod();
+      ReferenceSetUpdateMethod referenceSetUpdateMethod = new ReferenceSetUpdateMethod();
+      ResultsCollector resultsCollector = new ResultsCollector();
+      RightSelector rightSelector = new RightSelector();
       Placeholder solutionEvaluator1 = new Placeholder();
       Placeholder solutionEvaluator2 = new Placeholder();
       Placeholder solutionImprover1 = new Placeholder();
       Placeholder solutionImprover2 = new Placeholder();
-      PopulationRebuildMethod populationRebuildMethod = new PopulationRebuildMethod();
-      ResultsCollector resultsCollector = new ResultsCollector();
-      ReferenceSetUpdateMethod referenceSetUpdateMethod = new ReferenceSetUpdateMethod();
-      RightSelector rightSelector = new RightSelector();
       SolutionPoolUpdateMethod solutionPoolUpdateMethod = new SolutionPoolUpdateMethod();
       SolutionsCreator solutionsCreator = new SolutionsCreator();
@@ -217,24 +226,21 @@
       SubScopesProcessor subScopesProcessor2 = new SubScopesProcessor();
       SubScopesProcessor subScopesProcessor3 = new SubScopesProcessor();
+      ConditionalBranch terminateBranch = new ConditionalBranch();
       UniformSubScopesProcessor uniformSubScopesProcessor1 = new UniformSubScopesProcessor();
       UniformSubScopesProcessor uniformSubScopesProcessor2 = new UniformSubScopesProcessor();
       UniformSubScopesProcessor uniformSubScopesProcessor3 = new UniformSubScopesProcessor();
+      VariableCreator variableCreator = new VariableCreator();
       #endregion
 
       #region Create operator graph
-      OperatorGraph.InitialOperator = interationsCounter;
-      assigner1.Name = "NewSolutions = true";
-      assigner1.LeftSideParameter.ActualName = "NewSolutions";
-      assigner1.RightSideParameter.Value = new BoolValue(true);
-      assigner1.Successor = newSolutionsBranch;
-
-      assigner2.Name = "NewSolutions = false";
-      assigner2.LeftSideParameter.ActualName = "NewSolutions";
-      assigner2.RightSideParameter.Value = new BoolValue(false);
-      assigner2.Successor = uniformSubScopesProcessor1;
-
-      childrenCreator.Name = "SubsetGenerator";
-      childrenCreator.ParentsPerChildParameter.Value = new IntValue(2);
-      childrenCreator.Successor = assigner2;
+      OperatorGraph.InitialOperator = variableCreator;
+      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Iterations", new IntValue(0)));
+      variableCreator.CollectedValues.Add(new ValueParameter<BoolValue>("NewSolutions", new BoolValue(false)));
+      variableCreator.Successor = resultsCollector;
+
+      resultsCollector.CopyValue = new BoolValue(false);
+      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>(IterationsParameter.Name));
+      resultsCollector.ResultsParameter.ActualName = ResultsParameter.Name;
+      resultsCollector.Successor = iterationsChecker;
 
       iterationsChecker.Name = "IterationsChecker";
@@ -245,65 +251,14 @@
       iterationsChecker.Successor = terminateBranch;
 
-      solutionImprover2.Name = "SolutionImprover";
-      solutionImprover2.OperatorParameter.ActualName = "Improver";
-      solutionImprover2.Successor = solutionEvaluator2;
-
-      solutionEvaluator2.Name = "SolutionEvaluator";
-      solutionEvaluator2.OperatorParameter.ActualName = "Evaluator";
-      solutionEvaluator2.Successor = null;
-
-      newSolutionsBranch.Name = "NewSolutionChecker";
-      newSolutionsBranch.ConditionParameter.ActualName = "NewSolutions";
-      newSolutionsBranch.TrueBranch = subScopesProcessor1;
-      newSolutionsBranch.FalseBranch = populationRebuildMethod;
-      newSolutionsBranch.Successor = null;
-
       terminateBranch.Name = "TerminateChecker";
       terminateBranch.ConditionParameter.ActualName = "Terminate";
-      terminateBranch.TrueBranch = new EmptyOperator();
       terminateBranch.FalseBranch = referenceSetUpdateMethod;
-      terminateBranch.Successor = null;
-
-      interationsCounter.Name = "IterationCounter";
-      interationsCounter.IncrementParameter.Value = new IntValue(1);
-      interationsCounter.ValueParameter.ActualName = "Iterations";
-      interationsCounter.Successor = resultsCollector;
-
-      offspringProcessor.Successor = rightSelector;
-
-      rightSelector.NumberOfSelectedSubScopesParameter.Value = new IntValue(1);
-      rightSelector.CopySelected = new BoolValue(false);
-      rightSelector.Successor = subScopesProcessor2;
-
-      analyzer.Name = "Analyzer";
-      analyzer.OperatorParameter.ActualName = "Analyzer";
-
-      crossover.Name = "Crossover";
-      crossover.OperatorParameter.ActualName = "Crossover";
-      crossover.Successor = offspringProcessor;
-
-      solutionImprover1.Name = "SolutionImprover";
-      solutionImprover1.OperatorParameter.ActualName = "Improver";
-      solutionImprover1.Successor = solutionEvaluator1;
-
-      solutionEvaluator1.Name = "SolutionEvaluator";
-      solutionEvaluator1.OperatorParameter.ActualName = "Evaluator";
-      solutionEvaluator1.Successor = null;
-
-      populationRebuildMethod.Successor = subScopesProcessor3;
-
-      resultsCollector.CopyValue = new BoolValue(false);
-      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>(IterationsParameter.Name));
-      resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>(BestKnownQualityParameter.Name, null, BestKnownQualityParameter.Name));
-      resultsCollector.ResultsParameter.ActualName = ResultsParameter.Name;
-      resultsCollector.Successor = iterationsChecker;
 
       referenceSetUpdateMethod.Successor = assigner1;
 
-      solutionPoolUpdateMethod.Successor = analyzer;
-
-      solutionsCreator.Name = "DiversificationGenerationMethod";
-      solutionsCreator.NumberOfSolutionsParameter.ActualName = "PopulationSize";
-      solutionsCreator.Successor = uniformSubScopesProcessor3;
+      assigner1.Name = "NewSolutions = true";
+      assigner1.LeftSideParameter.ActualName = "NewSolutions";
+      assigner1.RightSideParameter.Value = new BoolValue(true);
+      assigner1.Successor = subScopesProcessor1;
 
       subScopesProcessor1.DepthParameter.Value = new IntValue(1);
@@ -312,4 +267,36 @@
       subScopesProcessor1.Successor = newSolutionsBranch;
 
+      childrenCreator.Name = "SubsetGenerator";
+      childrenCreator.ParentsPerChildParameter.Value = new IntValue(2);
+      childrenCreator.Successor = assigner2;
+
+      assigner2.Name = "NewSolutions = false";
+      assigner2.LeftSideParameter.ActualName = "NewSolutions";
+      assigner2.RightSideParameter.Value = new BoolValue(false);
+      assigner2.Successor = uniformSubScopesProcessor1;
+
+      uniformSubScopesProcessor1.DepthParameter.Value = new IntValue(1);
+      uniformSubScopesProcessor1.Operator = executePathRelinkingBranch;
+      uniformSubScopesProcessor1.Successor = solutionPoolUpdateMethod;
+
+      executePathRelinkingBranch.Name = "ExecutePathRelinkingChecker";
+      executePathRelinkingBranch.ConditionParameter.ActualName = ExecutePathRelinkingParameter.ActualName;
+      executePathRelinkingBranch.TrueBranch = pathRelinker;
+      executePathRelinkingBranch.FalseBranch = crossover;
+
+      pathRelinker.Name = "PathRelinker";
+      pathRelinker.OperatorParameter.ActualName = "PathRelinker";
+      pathRelinker.Successor = offspringProcessor;
+
+      crossover.Name = "Crossover";
+      crossover.OperatorParameter.ActualName = "Crossover";
+      crossover.Successor = offspringProcessor;
+
+      offspringProcessor.Successor = rightSelector;
+
+      rightSelector.NumberOfSelectedSubScopesParameter.Value = new IntValue(1);
+      rightSelector.CopySelected = new BoolValue(false);
+      rightSelector.Successor = subScopesProcessor2;
+
       subScopesProcessor2.DepthParameter.Value = new IntValue(1);
       subScopesProcessor2.Operators.Add(new EmptyOperator());
@@ -317,20 +304,49 @@
       subScopesProcessor2.Successor = mergingReducer;
 
+      uniformSubScopesProcessor2.DepthParameter.Value = new IntValue(2);
+      uniformSubScopesProcessor2.Operator = solutionImprover1;
+
+      solutionImprover1.Name = "SolutionImprover";
+      solutionImprover1.OperatorParameter.ActualName = "Improver";
+      solutionImprover1.Successor = solutionEvaluator1;
+
+      solutionEvaluator1.Name = "SolutionEvaluator";
+      solutionEvaluator1.OperatorParameter.ActualName = "Evaluator";
+
+      solutionPoolUpdateMethod.Successor = analyzer;
+
+      analyzer.Name = "Analyzer";
+      analyzer.OperatorParameter.ActualName = "Analyzer";
+
+      newSolutionsBranch.Name = "NewSolutionsChecker";
+      newSolutionsBranch.ConditionParameter.ActualName = "NewSolutions";
+      newSolutionsBranch.TrueBranch = subScopesProcessor1;
+      newSolutionsBranch.FalseBranch = populationRebuildMethod;
+
+      populationRebuildMethod.Successor = subScopesProcessor3;
+
       subScopesProcessor3.DepthParameter.Value = new IntValue(1);
       subScopesProcessor3.Operators.Add(solutionsCreator);
       subScopesProcessor3.Operators.Add(new EmptyOperator());
-      subScopesProcessor3.Successor = interationsCounter;
-
-      uniformSubScopesProcessor1.DepthParameter.Value = new IntValue(1);
-      uniformSubScopesProcessor1.Operator = crossover;
-      uniformSubScopesProcessor1.Successor = solutionPoolUpdateMethod;
-
-      uniformSubScopesProcessor2.DepthParameter.Value = new IntValue(2);
-      uniformSubScopesProcessor2.Operator = solutionImprover1;
-      uniformSubScopesProcessor2.Successor = null;
+      subScopesProcessor3.Successor = iterationsCounter;
+
+      solutionsCreator.Name = "DiversificationGenerationMethod";
+      solutionsCreator.NumberOfSolutionsParameter.ActualName = "PopulationSize";
+      solutionsCreator.Successor = uniformSubScopesProcessor3;
 
       uniformSubScopesProcessor3.DepthParameter.Value = new IntValue(1);
       uniformSubScopesProcessor3.Operator = solutionImprover2;
-      uniformSubScopesProcessor3.Successor = null;
+
+      solutionImprover2.Name = "SolutionImprover";
+      solutionImprover2.OperatorParameter.ActualName = "Improver";
+      solutionImprover2.Successor = solutionEvaluator2;
+
+      solutionEvaluator2.Name = "SolutionEvaluator";
+      solutionEvaluator2.OperatorParameter.ActualName = "Evaluator";
+
+      iterationsCounter.Name = "IterationCounter";
+      iterationsCounter.IncrementParameter.Value = new IntValue(1);
+      iterationsCounter.ValueParameter.ActualName = "Iterations";
+      iterationsCounter.Successor = resultsCollector;
       #endregion
     }
Index: /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/SimilarityCalculator.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/SimilarityCalculator.cs	(revision 7786)
+++ /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/SimilarityCalculator.cs	(revision 7786)
@@ -0,0 +1,54 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Operators;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Algorithms.ScatterSearch {
+  /// <summary>
+  /// A base class for operators that perform diversity calculation between two solutions.
+  /// </summary>
+  [Item("DiversityCalculator", "A base class for operators that perform diversity calculation between two solutions.")]
+  [StorableClass]
+  public abstract class SimilarityCalculator : SingleSuccessorOperator {
+    [StorableConstructor]
+    protected SimilarityCalculator(bool deserializing) : base(deserializing) { }
+    protected SimilarityCalculator(SimilarityCalculator original, Cloner cloner) : base(original, cloner) { }
+    protected SimilarityCalculator() : base() { }
+
+    public sealed override IOperation Apply() { // TODO: check if sealed fits here?
+      return base.Apply();
+    }
+
+    public double ExecuteCalculation(IScope left, IScope right) {
+      if (left == null || right == null)
+        throw new ArgumentException("Cannot calculate diversity because one or both of the provided scopes is null.");
+
+      if (left == right) return 0;
+      else return CalculateDiversity(left, right);
+    }
+
+    protected abstract double CalculateDiversity(IScope left, IScope right);
+  }
+}
Index: /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/SolutionPool2TierUpdateMethod.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/SolutionPool2TierUpdateMethod.cs	(revision 7785)
+++ /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/SolutionPool2TierUpdateMethod.cs	(revision 7786)
@@ -36,11 +36,11 @@
   [Item("SolutionPool2TierUpdateMethod", "An operator that updates the solution pool using a 2-tier strategy.")]
   [StorableClass]
-  public sealed class SolutionPool2TierUpdateMethod : SingleSuccessorOperator, IScatterSearchTargetProcessor {
+  public sealed class SolutionPool2TierUpdateMethod : SingleSuccessorOperator {
     #region Parameter properties
     public ScopeParameter CurrentScopeParameter {
       get { return (ScopeParameter)Parameters["CurrentScope"]; }
     }
-    public IValueLookupParameter<DiversityCalculator> DiversityCalculatorParameter {
-      get { return (IValueLookupParameter<DiversityCalculator>)Parameters["DiversityCalculator"]; }
+    public IValueLookupParameter<SimilarityCalculator> SimilarityCalculatorParameter {
+      get { return (IValueLookupParameter<SimilarityCalculator>)Parameters["SimilarityCalculator"]; }
     }
     public IValueLookupParameter<BoolValue> MaximizationParameter {
@@ -53,9 +53,9 @@
       get { return (IValueLookupParameter<IntValue>)Parameters["NumberOfHighQualitySolutions"]; }
     }
+    public IValueLookupParameter<IItem> QualityParameter {
+      get { return (IValueLookupParameter<IItem>)Parameters["Quality"]; }
+    }
     public IValueLookupParameter<IntValue> ReferenceSetSizeParameter {
       get { return (IValueLookupParameter<IntValue>)Parameters["ReferenceSetSize"]; }
-    }
-    public IValueLookupParameter<IItem> QualityParameter {
-      get { return (IValueLookupParameter<IItem>)Parameters["Quality"]; }
     }
     public IValueLookupParameter<IItem> TargetParameter {
@@ -68,6 +68,6 @@
       get { return CurrentScopeParameter.ActualValue; }
     }
-    private DiversityCalculator DiversityCalculator {
-      get { return DiversityCalculatorParameter.ActualValue; }
+    private SimilarityCalculator SimilarityCalculator {
+      get { return SimilarityCalculatorParameter.ActualValue; }
     }
     private BoolValue Maximization {
@@ -81,10 +81,10 @@
       get { return NumberOfHighQualitySolutionsParameter.ActualValue; }
     }
+    private IItem Quality {
+      get { return QualityParameter.ActualValue; }
+    }
     private IntValue ReferenceSetSize {
       get { return ReferenceSetSizeParameter.ActualValue; }
       set { ReferenceSetSizeParameter.ActualValue = value; }
-    }
-    private IItem Quality {
-      get { return QualityParameter.ActualValue; }
     }
     private IItem Target {
@@ -105,18 +105,17 @@
       #region Create parameters
       Parameters.Add(new ScopeParameter("CurrentScope"));
-      Parameters.Add(new ValueLookupParameter<DiversityCalculator>("DiversityCalculator"));
       Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization"));
       Parameters.Add(new ValueLookupParameter<BoolValue>("NewSolutions"));
       Parameters.Add(new ValueLookupParameter<IntValue>("NumberOfHighQualitySolutions"));
+      Parameters.Add(new ValueLookupParameter<IItem>("Quality"));
       Parameters.Add(new ValueLookupParameter<IntValue>("ReferenceSetSize"));
-      Parameters.Add(new ValueLookupParameter<IItem>("Quality"));
+      Parameters.Add(new ValueLookupParameter<SimilarityCalculator>("SimilarityCalculator"));
       Parameters.Add(new ValueLookupParameter<IItem>("Target"));
       #endregion
-      TargetParameter.ActualName = "KnapsackSolution"; // temporary solution for the knapsack problem
     }
 
     public override IOperation Apply() {
-      var parentsScope = new Scope("Parents");
-      var offspringScope = new Scope("Offspring");
+      IScope parentsScope = new Scope("Parents");
+      IScope offspringScope = new Scope("Offspring");
 
       // split parents and offspring
@@ -132,24 +131,20 @@
 
       var highQualityParents = orderedParents.Take(NumberOfHighQualitySolutions.Value).ToList();
-      var highDiversityParents = new List<Tuple<IScope, double>>();
+      IList<Tuple<IScope, double>> highSimilarityParents = new List<Tuple<IScope, double>>();
       foreach (var oScope in orderedParents.Skip(NumberOfHighQualitySolutions.Value)) {
-        double diversity = 0.0;
-        var oSol = oScope.Variables[TargetParameter.ActualName].Value;
+        double similarity = 0.0;
         foreach (var hScope in highQualityParents) {
-          var hSol = hScope.Variables[TargetParameter.ActualName].Value;
-          diversity += DiversityCalculator.ExecuteCalculation(oSol, hSol);
+          similarity += SimilarityCalculator.ExecuteCalculation(oScope, hScope);
         }
-        highDiversityParents.Add(new Tuple<IScope, double>(oScope, diversity));
+        highSimilarityParents.Add(new Tuple<IScope, double>(oScope, similarity));
       }
 
-      var offspring = new List<Tuple<IScope, double>>();
+      IList<Tuple<IScope, double>> offspring = new List<Tuple<IScope, double>>();
       foreach (var oScope in orderedOffspring) {
-        double diversity = 0.0;
-        var oSol = oScope.Variables[TargetParameter.ActualName].Value;
+        double similarity = 0.0;
         foreach (var hScope in highQualityParents) {
-          var hSol = hScope.Variables[TargetParameter.ActualName].Value;
-          diversity += DiversityCalculator.ExecuteCalculation(oSol, hSol);
+          similarity += SimilarityCalculator.ExecuteCalculation(oScope, hScope);
         }
-        offspring.Add(new Tuple<IScope, double>(oScope, diversity));
+        offspring.Add(new Tuple<IScope, double>(oScope, similarity));
       }
 
@@ -171,36 +166,20 @@
 
       // update diversity part of the reference set
-      var hasBetterDiversity = (Func<Tuple<IScope, double>, bool>)(x => { return x.Item2 > highDiversityParents.OrderBy(y => y.Item2).First().Item2; });
+      var hasBetterDiversity = (Func<Tuple<IScope, double>, bool>)(x => { return x.Item2 < highSimilarityParents.OrderByDescending(y => y.Item2).First().Item2; });
       if (offspring.Any(hasBetterDiversity)) NewSolutions.Value = true;
       while (offspring.Any(hasBetterDiversity)) { // better offspring available
         // select best offspring
-        var bestChild = offspring.OrderByDescending(x => x.Item2).First();
+        var bestChild = offspring.OrderBy(x => x.Item2).First();
         // select worst parent
-        var worstParent = highDiversityParents.OrderBy(x => x.Item2).First();
-        highDiversityParents.Remove(worstParent);
-        highDiversityParents.Add(bestChild);
+        var worstParent = highSimilarityParents.OrderByDescending(x => x.Item2).First();
+        highSimilarityParents.Remove(worstParent);
+        highSimilarityParents.Add(bestChild);
         offspring.Remove(bestChild);
       }
 
-      CurrentScope.SubScopes.Replace(highQualityParents.Concat(highDiversityParents.Select(x => x.Item1)).ToList());
+      CurrentScope.SubScopes.Replace(highQualityParents.Concat(highSimilarityParents.Select(x => x.Item1)).ToList());
 
       return base.Apply();
     }
-
-    private class KeyEqualityComparer<T> : IEqualityComparer<T> {
-      private readonly Func<T, object> keyExtractor;
-
-      public KeyEqualityComparer(Func<T, object> keyExtractor) {
-        this.keyExtractor = keyExtractor;
-      }
-
-      public bool Equals(T x, T y) {
-        return keyExtractor(x).Equals(keyExtractor(y));
-      }
-
-      public int GetHashCode(T obj) {
-        return keyExtractor(obj).GetHashCode();
-      }
-    }
   }
 }
Index: /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/SolutionPoolUpdateMethod.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/SolutionPoolUpdateMethod.cs	(revision 7785)
+++ /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/SolutionPoolUpdateMethod.cs	(revision 7786)
@@ -36,5 +36,5 @@
   [Item("SolutionPoolUpdateMethod", "An operator that updates the solution pool.")]
   [StorableClass]
-  public sealed class SolutionPoolUpdateMethod : SingleSuccessorOperator, IScatterSearchTargetProcessor {
+  public sealed class SolutionPoolUpdateMethod : SingleSuccessorOperator {
     #region Parameter properties
     public ScopeParameter CurrentScopeParameter {
@@ -47,9 +47,12 @@
       get { return (IValueLookupParameter<BoolValue>)Parameters["NewSolutions"]; }
     }
+    public IValueLookupParameter<IItem> QualityParameter {
+      get { return (IValueLookupParameter<IItem>)Parameters["Quality"]; }
+    }
     public IValueLookupParameter<IntValue> ReferenceSetSizeParameter {
       get { return (IValueLookupParameter<IntValue>)Parameters["ReferenceSetSize"]; }
     }
-    public IValueLookupParameter<IItem> QualityParameter {
-      get { return (IValueLookupParameter<IItem>)Parameters["Quality"]; }
+    public IValueLookupParameter<SimilarityCalculator> SimilarityCalculatorParameter {
+      get { return (IValueLookupParameter<SimilarityCalculator>)Parameters["SimilarityCalculator"]; }
     }
     public IValueLookupParameter<IItem> TargetParameter {
@@ -69,10 +72,13 @@
       get { return NewSolutionsParameter.ActualValue; }
     }
+    private IItem Quality {
+      get { return QualityParameter.ActualValue; }
+    }
     private IntValue ReferenceSetSize {
       get { return ReferenceSetSizeParameter.ActualValue; }
       set { ReferenceSetSizeParameter.ActualValue = value; }
     }
-    private IItem Quality {
-      get { return QualityParameter.ActualValue; }
+    private SimilarityCalculator SimilarityCalculator {
+      get { return SimilarityCalculatorParameter.ActualValue; }
     }
     private IItem Target {
@@ -95,14 +101,14 @@
       Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization"));
       Parameters.Add(new ValueLookupParameter<BoolValue>("NewSolutions"));
+      Parameters.Add(new ValueLookupParameter<IItem>("Quality"));
       Parameters.Add(new ValueLookupParameter<IntValue>("ReferenceSetSize"));
-      Parameters.Add(new ValueLookupParameter<IItem>("Quality"));
+      Parameters.Add(new ValueLookupParameter<SimilarityCalculator>("SimilarityCalculator"));
       Parameters.Add(new ValueLookupParameter<IItem>("Target"));
       #endregion
-      TargetParameter.ActualName = "KnapsackSolution"; // temporary solution for the knapsack problem
     }
 
     public override IOperation Apply() {
-      var parentsScope = new Scope("Parents");
-      var offspringScope = new Scope("Offspring");
+      IScope parentsScope = new Scope("Parents");
+      IScope offspringScope = new Scope("Offspring");
 
       // split parents and offspring
@@ -121,8 +127,8 @@
       CurrentScope.SubScopes.AddRange(orderedParents);
 
-      var worstParentQuality = (orderedParents.Last().Variables[QualityParameter.ActualName].Value as DoubleValue).Value;
+      double worstParentQuality = (orderedParents.Last().Variables[QualityParameter.ActualName].Value as DoubleValue).Value;
 
       var hasBetterQuality = Maximization.Value ? (Func<IScope, bool>)(x => { return (x.Variables[QualityParameter.ActualName].Value as DoubleValue).Value > worstParentQuality; }) :
-                                            (Func<IScope, bool>)(x => { return (x.Variables[QualityParameter.ActualName].Value as DoubleValue).Value < worstParentQuality; });
+                                                  (Func<IScope, bool>)(x => { return (x.Variables[QualityParameter.ActualName].Value as DoubleValue).Value < worstParentQuality; });
 
       // is there any offspring better than the worst parent?
@@ -130,5 +136,5 @@
         // produce the set union
         // attention: distinction might cause a too small reference set! (e.g. reference set = {1, 2, 2, 2, ..., 2} -> union = {1, 2}
-        var union = orderedParents.Union(orderedOffspring.Where(hasBetterQuality), new KeyEqualityComparer<IScope>(x => x.Variables[TargetParameter.ActualName].Value.ToString()));
+        var union = orderedParents.Union(orderedOffspring.Where(hasBetterQuality), new SolutionEqualityComparer<IScope>(SimilarityCalculator.ExecuteCalculation));
         if (union.Count() > orderedParents/*.Distinct(new KeyEqualityComparer<IScope>(x => x.Variables[TargetParameter.ActualName].Value.ToString()))*/.Count()) {
           var orderedUnion = Maximization.Value ? union.OrderByDescending(x => x.Variables[QualityParameter.ActualName].Value) :
@@ -142,17 +148,17 @@
     }
 
-    private class KeyEqualityComparer<T> : IEqualityComparer<T> {
-      private readonly Func<T, object> keyExtractor;
+    private class SolutionEqualityComparer<T> : EqualityComparer<T> {
+      private readonly Func<T, T, double> diversityCalculator;
 
-      public KeyEqualityComparer(Func<T, object> keyExtractor) {
-        this.keyExtractor = keyExtractor;
+      public SolutionEqualityComparer(Func<T, T, double> diversityCalculator) {
+        this.diversityCalculator = diversityCalculator;
       }
 
-      public bool Equals(T x, T y) {
-        return keyExtractor(x).Equals(keyExtractor(y));
+      public override bool Equals(T x, T y) {
+        return diversityCalculator(x, y) == 0.0;
       }
 
-      public int GetHashCode(T obj) {
-        return keyExtractor(obj).GetHashCode();
+      public override int GetHashCode(T obj) {
+        return obj.GetHashCode();
       }
     }
Index: anches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TestFunctions/RealVectorDiversityCalculator.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TestFunctions/RealVectorDiversityCalculator.cs	(revision 7785)
+++ 	(revision )
@@ -1,56 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Encodings.RealVectorEncoding;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Algorithms.ScatterSearch.TestFunctions {
-  /// <summary>
-  /// An operator that performs diversity calculation between real vectors.
-  /// </summary>
-  [Item("RealVectorDiversityCalculator", "An operator that performs diversity calculation between real vectors.")]
-  [StorableClass]
-  public sealed class RealVectorDiversityCalculator : DiversityCalculator {
-    [StorableConstructor]
-    private RealVectorDiversityCalculator(bool deserializing) : base(deserializing) { }
-    private RealVectorDiversityCalculator(RealVectorDiversityCalculator original, Cloner cloner) : base(original, cloner) { }
-    public RealVectorDiversityCalculator() : base() { }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new RealVectorDiversityCalculator(this, cloner);
-    }
-
-    protected override double CalculateDiversity(IItem left, IItem right) {
-      if (!(left is RealVector) || !(right is RealVector))
-        throw new ArgumentException("Cannot calculate diversity because one of the provided objects or both have the wrong type.");
-
-      var v1 = left as RealVector;
-      var v2 = right as RealVector;
-      double sum = 0.0;
-      for (int i = 0; i < v1.Length; i++)
-        sum += Math.Pow(v1[i] - v2[i], 2);
-      return Math.Sqrt(sum);
-    }
-  }
-}
Index: anches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TestFunctions/TestFunctionsAckleyImprovementOperator.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TestFunctions/TestFunctionsAckleyImprovementOperator.cs	(revision 7785)
+++ 	(revision )
@@ -1,48 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.Problems.TestFunctions;
-
-namespace HeuristicLab.Algorithms.ScatterSearch.TestFunctions {
-  /// <summary>
-  /// An operator that improves Ackley test function solutions.
-  /// </summary>
-  [Item("TestFunctionsAckleyImprovementOperator", "An operator that improves Ackley test function solutions.")]
-  [StorableClass]
-  public sealed class TestFunctionsAckleyImprovementOperator : TestFunctionsImprovementOperator {
-    [StorableConstructor]
-    private TestFunctionsAckleyImprovementOperator(bool deserializing) : base(deserializing) { }
-    private TestFunctionsAckleyImprovementOperator(TestFunctionsAckleyImprovementOperator original, Cloner cloner) : base(original, cloner) { }
-    public TestFunctionsAckleyImprovementOperator() : base() { }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new TestFunctionsAckleyImprovementOperator(this, cloner);
-    }
-
-    public override IOperation Apply() {
-      FunctionEvaluator = x => { return AckleyEvaluator.Apply(x); };
-      return base.Apply();
-    }
-  }
-}
Index: anches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TestFunctions/TestFunctionsBealeImprovementOperator.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TestFunctions/TestFunctionsBealeImprovementOperator.cs	(revision 7785)
+++ 	(revision )
@@ -1,48 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.Problems.TestFunctions;
-
-namespace HeuristicLab.Algorithms.ScatterSearch.TestFunctions {
-  /// <summary>
-  /// An operator that improves Beale test function solutions.
-  /// </summary>
-  [Item("TestFunctionsBealeImprovementOperator", "An operator that improves Beale test function solutions.")]
-  [StorableClass]
-  public sealed class TestFunctionsBealeImprovementOperator : TestFunctionsImprovementOperator {
-    [StorableConstructor]
-    private TestFunctionsBealeImprovementOperator(bool deserializing) : base(deserializing) { }
-    private TestFunctionsBealeImprovementOperator(TestFunctionsBealeImprovementOperator original, Cloner cloner) : base(original, cloner) { }
-    public TestFunctionsBealeImprovementOperator() : base() { }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new TestFunctionsBealeImprovementOperator(this, cloner);
-    }
-
-    public override IOperation Apply() {
-      FunctionEvaluator = x => { return BealeEvaluator.Apply(x); };
-      return base.Apply();
-    }
-  }
-}
Index: anches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TestFunctions/TestFunctionsBoothImprovementOperator.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TestFunctions/TestFunctionsBoothImprovementOperator.cs	(revision 7785)
+++ 	(revision )
@@ -1,48 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.Problems.TestFunctions;
-
-namespace HeuristicLab.Algorithms.ScatterSearch.TestFunctions {
-  /// <summary>
-  /// An operator that improves Booth test function solutions.
-  /// </summary>
-  [Item("TestFunctionsBoothImprovementOperator", "An operator that improves Booth test function solutions.")]
-  [StorableClass]
-  public sealed class TestFunctionsBoothImprovementOperator : TestFunctionsImprovementOperator {
-    [StorableConstructor]
-    private TestFunctionsBoothImprovementOperator(bool deserializing) : base(deserializing) { }
-    private TestFunctionsBoothImprovementOperator(TestFunctionsBoothImprovementOperator original, Cloner cloner) : base(original, cloner) { }
-    public TestFunctionsBoothImprovementOperator() : base() { }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new TestFunctionsBoothImprovementOperator(this, cloner);
-    }
-
-    public override IOperation Apply() {
-      FunctionEvaluator = x => { return BoothEvaluator.Apply(x); };
-      return base.Apply();
-    }
-  }
-}
Index: anches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TestFunctions/TestFunctionsGriewankImprovementOperator.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TestFunctions/TestFunctionsGriewankImprovementOperator.cs	(revision 7785)
+++ 	(revision )
@@ -1,48 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.Problems.TestFunctions;
-
-namespace HeuristicLab.Algorithms.ScatterSearch.TestFunctions {
-  /// <summary>
-  /// An operator that improves Griewank test function solutions.
-  /// </summary>
-  [Item("TestFunctionsGriewankImprovementOperator", "An operator that improves Griewank test function solutions.")]
-  [StorableClass]
-  public sealed class TestFunctionsGriewankImprovementOperator : TestFunctionsImprovementOperator {
-    [StorableConstructor]
-    private TestFunctionsGriewankImprovementOperator(bool deserializing) : base(deserializing) { }
-    private TestFunctionsGriewankImprovementOperator(TestFunctionsGriewankImprovementOperator original, Cloner cloner) : base(original, cloner) { }
-    public TestFunctionsGriewankImprovementOperator() : base() { }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new TestFunctionsGriewankImprovementOperator(this, cloner);
-    }
-
-    public override IOperation Apply() {
-      FunctionEvaluator = x => { return GriewankEvaluator.Apply(x); };
-      return base.Apply();
-    }
-  }
-}
Index: /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TestFunctions/TestFunctionsImprovementOperator.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TestFunctions/TestFunctionsImprovementOperator.cs	(revision 7785)
+++ /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TestFunctions/TestFunctionsImprovementOperator.cs	(revision 7786)
@@ -21,4 +21,5 @@
 
 using System;
+using System.Reflection;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -26,8 +27,6 @@
 using HeuristicLab.Encodings.RealVectorEncoding;
 using HeuristicLab.Operators;
-using HeuristicLab.Optimization;
 using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.Problems.Knapsack;
 using HeuristicLab.Problems.TestFunctions;
 
@@ -38,27 +37,24 @@
   [Item("TestFunctionsImprovementOperator", "An operator that improves test functions solutions.")]
   [StorableClass]
-  public abstract class TestFunctionsImprovementOperator : SingleSuccessorOperator, ILocalImprovementOperator, IScatterSearchTargetProcessor {
-    #region Problem properties
-    public Type ProblemType {
-      get { return typeof(KnapsackProblem); }
-    }
-    [Storable]
-    private KnapsackProblem problem;
-    public IProblem Problem {
-      get { return problem; }
-      set { problem = (KnapsackProblem)value; }
-    }
-    #endregion
-
+  public sealed class TestFunctionsImprovementOperator : SingleSuccessorOperator, IImprovementOperator {
     #region Parameter properties
+    public IValueParameter<DoubleValue> AlphaParameter {
+      get { return (IValueParameter<DoubleValue>)Parameters["Alpha"]; }
+    }
+    public IValueParameter<DoubleValue> BetaParameter {
+      get { return (IValueParameter<DoubleValue>)Parameters["Beta"]; }
+    }
     public ScopeParameter CurrentScopeParameter {
       get { return (ScopeParameter)Parameters["CurrentScope"]; }
     }
-    public IValueLookupParameter<DoubleMatrix> CoordinatesParameter {
-      get { return (IValueLookupParameter<DoubleMatrix>)Parameters["Coordinates"]; }
+    public IValueParameter<DoubleValue> DeltaParameter {
+      get { return (IValueParameter<DoubleValue>)Parameters["Delta"]; }
     }
     public IValueLookupParameter<ISingleObjectiveTestFunctionProblemEvaluator> EvaluatorParameter {
       get { return (IValueLookupParameter<ISingleObjectiveTestFunctionProblemEvaluator>)Parameters["Evaluator"]; }
     }
+    public IValueParameter<DoubleValue> GammaParameter {
+      get { return (IValueParameter<DoubleValue>)Parameters["Gamma"]; }
+    }
     public IValueLookupParameter<IntValue> ImprovementAttemptsParameter {
       get { return (IValueLookupParameter<IntValue>)Parameters["ImprovementAttempts"]; }
@@ -70,33 +66,7 @@
       get { return (IValueLookupParameter<IItem>)Parameters["Target"]; }
     }
-    public IValueParameter<DoubleValue> AlphaParameter {
-      get { return (IValueParameter<DoubleValue>)Parameters["Alpha"]; }
-    }
-    public IValueParameter<DoubleValue> BetaParameter {
-      get { return (IValueParameter<DoubleValue>)Parameters["Beta"]; }
-    }
-    public IValueParameter<DoubleValue> GammaParameter {
-      get { return (IValueParameter<DoubleValue>)Parameters["Gamma"]; }
-    }
-    public IValueParameter<DoubleValue> DeltaParameter {
-      get { return (IValueParameter<DoubleValue>)Parameters["Delta"]; }
-    }
-    #region ILocalImprovementOperator Parameters
-    public IValueLookupParameter<IntValue> MaximumIterationsParameter {
-      get { return (IValueLookupParameter<IntValue>)Parameters["MaximumIterations"]; }
-    }
-    public ILookupParameter<IntValue> EvaluatedSolutionsParameter {
-      get { return (ILookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; }
-    }
-    public ILookupParameter<ResultCollection> ResultsParameter {
-      get { return (ILookupParameter<ResultCollection>)Parameters["Results"]; }
-    }
     #endregion
-    #endregion
 
     #region Properties
-    private IItem Target {
-      get { return TargetParameter.ActualValue; }
-    }
     private DoubleValue Alpha {
       get { return AlphaParameter.Value; }
@@ -105,17 +75,9 @@
       get { return BetaParameter.Value; }
     }
-    private DoubleValue Gamma {
-      get { return GammaParameter.Value; }
+    public IScope CurrentScope {
+      get { return CurrentScopeParameter.ActualValue; }
     }
     private DoubleValue Delta {
       get { return DeltaParameter.Value; }
-    }
-    protected Func<RealVector, double> FunctionEvaluator { get; set; }
-    public IScope CurrentScope {
-      get { return CurrentScopeParameter.ActualValue; }
-    }
-    public DoubleMatrix Coordinates {
-      get { return CoordinatesParameter.ActualValue; }
-      set { CoordinatesParameter.ActualValue = value; }
     }
     public ISingleObjectiveTestFunctionProblemEvaluator Evaluator {
@@ -123,4 +85,7 @@
       set { EvaluatorParameter.ActualValue = value; }
     }
+    private DoubleValue Gamma {
+      get { return GammaParameter.Value; }
+    }
     public IntValue ImprovementAttempts {
       get { return ImprovementAttemptsParameter.ActualValue; }
@@ -131,35 +96,43 @@
       set { RandomParameter.ActualValue = value; }
     }
+    private IItem Target {
+      get { return TargetParameter.ActualValue; }
+    }
     #endregion
 
     [StorableConstructor]
-    protected TestFunctionsImprovementOperator(bool deserializing) : base(deserializing) { }
-    protected TestFunctionsImprovementOperator(TestFunctionsImprovementOperator original, Cloner cloner)
-      : base(original, cloner) {
-      this.problem = cloner.Clone(original.problem);
-    }
+    private TestFunctionsImprovementOperator(bool deserializing) : base(deserializing) { }
+    private TestFunctionsImprovementOperator(TestFunctionsImprovementOperator original, Cloner cloner) : base(original, cloner) { }
     public TestFunctionsImprovementOperator()
       : base() {
       #region Create parameters
-      Parameters.Add(new ScopeParameter("CurrentScope"));
-      Parameters.Add(new ValueLookupParameter<DoubleMatrix>("Coordinates"));
-      Parameters.Add(new ValueLookupParameter<ISingleObjectiveTestFunctionProblemEvaluator>("Evaluator"));
-      Parameters.Add(new ValueLookupParameter<IntValue>("ImprovementAttempts", new IntValue(100)));
-      Parameters.Add(new ValueLookupParameter<IRandom>("Random"));
-      Parameters.Add(new ValueLookupParameter<IItem>("Target"));
       Parameters.Add(new ValueParameter<DoubleValue>("Alpha", new DoubleValue(1.0)));
       Parameters.Add(new ValueParameter<DoubleValue>("Beta", new DoubleValue(2.0)));
+      Parameters.Add(new ScopeParameter("CurrentScope"));
+      Parameters.Add(new ValueParameter<DoubleValue>("Delta", new DoubleValue(0.5)));
+      Parameters.Add(new ValueLookupParameter<ISingleObjectiveTestFunctionProblemEvaluator>("Evaluator"));
       Parameters.Add(new ValueParameter<DoubleValue>("Gamma", new DoubleValue(0.5)));
-      Parameters.Add(new ValueParameter<DoubleValue>("Delta", new DoubleValue(0.5)));
+      Parameters.Add(new ValueLookupParameter<IntValue>("ImprovementAttempts", new IntValue(100)));
+      Parameters.Add(new ValueLookupParameter<IItem>("Target"));
+      Parameters.Add(new ValueLookupParameter<IRandom>("Random"));
       #endregion
       TargetParameter.ActualName = "Point"; // temporary solution for the test functions problem
     }
 
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new TestFunctionsImprovementOperator(this, cloner);
+    }
+
     public override IOperation Apply() {
-      var bestSol = CurrentScope.Variables[TargetParameter.ActualName].Value as RealVector;
-      var bestSolQuality = FunctionEvaluator(bestSol);
+      RealVector bestSol = CurrentScope.Variables[TargetParameter.ActualName].Value as RealVector;
+      MethodInfo evaluationMethod = Evaluator.GetType().GetMethod("Apply",
+                                                                  BindingFlags.Public | BindingFlags.Static,
+                                                                  null,
+                                                                  new Type[] { typeof(RealVector) }, null);
+      Func<RealVector, double> functionEvaluator = x => (double)evaluationMethod.Invoke(Evaluator, new object[] { x });
+      double bestSolQuality = functionEvaluator(bestSol);
 
       // create perturbed solutions
-      var simplex = new RealVector[bestSol.Length];
+      RealVector[] simplex = new RealVector[bestSol.Length];
       for (int i = 0; i < simplex.Length; i++) {
         simplex[i] = bestSol.Clone() as RealVector;
@@ -172,8 +145,8 @@
       for (int i = 0; i < ImprovementAttempts.Value; i++) {
         // order according to their objective function value
-        Array.Sort(simplex, (x, y) => FunctionEvaluator(x).CompareTo(FunctionEvaluator(y)));
+        Array.Sort(simplex, (x, y) => functionEvaluator(x).CompareTo(functionEvaluator(y)));
 
         // calculate centroid
-        var centroid = new RealVector(bestSol.Length);
+        RealVector centroid = new RealVector(bestSol.Length);
         foreach (var vector in simplex)
           for (int j = 0; j < centroid.Length; j++)
@@ -183,33 +156,33 @@
 
         // reflection
-        var reflectionPoint = new RealVector(bestSol.Length);
+        RealVector reflectionPoint = new RealVector(bestSol.Length);
         for (int j = 0; j < reflectionPoint.Length; j++)
           reflectionPoint[j] = centroid[j] + Alpha.Value * (centroid[j] - simplex[simplex.Length - 1][j]);
-        double reflectionPointQuality = FunctionEvaluator(reflectionPoint);
-        if (FunctionEvaluator(simplex[0]) <= reflectionPointQuality
-            && reflectionPointQuality < FunctionEvaluator(simplex[simplex.Length - 2]))
+        double reflectionPointQuality = functionEvaluator(reflectionPoint);
+        if (functionEvaluator(simplex[0]) <= reflectionPointQuality
+            && reflectionPointQuality < functionEvaluator(simplex[simplex.Length - 2]))
           simplex[simplex.Length - 1] = reflectionPoint;
 
         // expansion
-        if (reflectionPointQuality < FunctionEvaluator(simplex[0])) {
-          var expansionPoint = new RealVector(bestSol.Length);
+        if (reflectionPointQuality < functionEvaluator(simplex[0])) {
+          RealVector expansionPoint = new RealVector(bestSol.Length);
           for (int j = 0; j < expansionPoint.Length; j++)
             expansionPoint[j] = centroid[j] + Beta.Value * (reflectionPoint[j] - centroid[j]);
-          simplex[simplex.Length - 1] = FunctionEvaluator(expansionPoint) < reflectionPointQuality ? expansionPoint : reflectionPoint;
+          simplex[simplex.Length - 1] = functionEvaluator(expansionPoint) < reflectionPointQuality ? expansionPoint : reflectionPoint;
         }
 
         // contraction
-        if (FunctionEvaluator(simplex[simplex.Length - 2]) <= reflectionPointQuality
-            && reflectionPointQuality < FunctionEvaluator(simplex[simplex.Length - 1])) {
-          var outsideContractionPoint = new RealVector(bestSol.Length);
+        if (functionEvaluator(simplex[simplex.Length - 2]) <= reflectionPointQuality
+            && reflectionPointQuality < functionEvaluator(simplex[simplex.Length - 1])) {
+          RealVector outsideContractionPoint = new RealVector(bestSol.Length);
           for (int j = 0; j < outsideContractionPoint.Length; j++)
             outsideContractionPoint[j] = centroid[j] + Gamma.Value * (reflectionPoint[j] - centroid[j]);
-          if (FunctionEvaluator(outsideContractionPoint) <= reflectionPointQuality) {
+          if (functionEvaluator(outsideContractionPoint) <= reflectionPointQuality) {
             simplex[simplex.Length - 1] = outsideContractionPoint;
-            if (FunctionEvaluator(reflectionPoint) >= FunctionEvaluator(simplex[simplex.Length - 1])) {
-              var insideContractionPoint = new RealVector(bestSol.Length);
+            if (functionEvaluator(reflectionPoint) >= functionEvaluator(simplex[simplex.Length - 1])) {
+              RealVector insideContractionPoint = new RealVector(bestSol.Length);
               for (int j = 0; j < insideContractionPoint.Length; j++)
                 insideContractionPoint[j] = centroid[j] - Gamma.Value * (reflectionPoint[j] - centroid[j]);
-              if (FunctionEvaluator(insideContractionPoint) < FunctionEvaluator(simplex[simplex.Length - 1])) simplex[simplex.Length - 1] = insideContractionPoint;
+              if (functionEvaluator(insideContractionPoint) < functionEvaluator(simplex[simplex.Length - 1])) simplex[simplex.Length - 1] = insideContractionPoint;
             }
           }
Index: anches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TestFunctions/TestFunctionsLevyImprovementOperator.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TestFunctions/TestFunctionsLevyImprovementOperator.cs	(revision 7785)
+++ 	(revision )
@@ -1,48 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.Problems.TestFunctions;
-
-namespace HeuristicLab.Algorithms.ScatterSearch.TestFunctions {
-  /// <summary>
-  /// An operator that improves Levy test function solutions.
-  /// </summary>
-  [Item("TestFunctionsLevyImprovementOperator", "An operator that improves Levy test function solutions.")]
-  [StorableClass]
-  public sealed class TestFunctionsLevyImprovementOperator : TestFunctionsImprovementOperator {
-    [StorableConstructor]
-    private TestFunctionsLevyImprovementOperator(bool deserializing) : base(deserializing) { }
-    private TestFunctionsLevyImprovementOperator(TestFunctionsLevyImprovementOperator original, Cloner cloner) : base(original, cloner) { }
-    public TestFunctionsLevyImprovementOperator() : base() { }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new TestFunctionsLevyImprovementOperator(this, cloner);
-    }
-
-    public override IOperation Apply() {
-      FunctionEvaluator = x => { return LevyEvaluator.Apply(x); };
-      return base.Apply();
-    }
-  }
-}
Index: anches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TestFunctions/TestFunctionsMatyasImprovementOperator.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TestFunctions/TestFunctionsMatyasImprovementOperator.cs	(revision 7785)
+++ 	(revision )
@@ -1,48 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.Problems.TestFunctions;
-
-namespace HeuristicLab.Algorithms.ScatterSearch.TestFunctions {
-  /// <summary>
-  /// An operator that improves Matyas test function solutions.
-  /// </summary>
-  [Item("TestFunctionsMatyasImprovementOperator", "An operator that improves Matyas test function solutions.")]
-  [StorableClass]
-  public sealed class TestFunctionsMatyasImprovementOperator : TestFunctionsImprovementOperator {
-    [StorableConstructor]
-    private TestFunctionsMatyasImprovementOperator(bool deserializing) : base(deserializing) { }
-    private TestFunctionsMatyasImprovementOperator(TestFunctionsMatyasImprovementOperator original, Cloner cloner) : base(original, cloner) { }
-    public TestFunctionsMatyasImprovementOperator() : base() { }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new TestFunctionsMatyasImprovementOperator(this, cloner);
-    }
-
-    public override IOperation Apply() {
-      FunctionEvaluator = x => { return MatyasEvaluator.Apply(x); };
-      return base.Apply();
-    }
-  }
-}
Index: /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TestFunctions/TestFunctionsPathRelinker.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TestFunctions/TestFunctionsPathRelinker.cs	(revision 7785)
+++ /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TestFunctions/TestFunctionsPathRelinker.cs	(revision 7786)
@@ -71,13 +71,13 @@
         throw new ArgumentException("RelinkingAccuracy must be greater than 0.");
 
-      var v1 = initiator.Clone() as RealVector;
-      var v2 = guide as RealVector;
+      RealVector v1 = initiator.Clone() as RealVector;
+      RealVector v2 = guide as RealVector;
 
       if (v1.Length != v2.Length)
         throw new ArgumentException("The solutions are of different length.");
 
-      var solutions = new List<RealVector>();
+      IList<RealVector> solutions = new List<RealVector>();
       for (int i = 0; i < k.Value; i++) {
-        var solution = v1.Clone() as RealVector;
+        RealVector solution = v1.Clone() as RealVector;
         for (int j = 0; j < solution.Length; j++)
           solution[j] = v1[j] + 1 / (k.Value - i) * (v2[j] - v1[j]);
@@ -85,11 +85,11 @@
       }
 
-      var selection = new List<IItem>();
+      IList<IItem> selection = new List<IItem>();
       if (solutions.Count > 0) {
-        var noSol = (int)Math.Round(solutions.Count * n.Value);
+        int noSol = (int)(solutions.Count * n.Value);
         if (noSol <= 0) noSol++;
-        var stepSize = (double)solutions.Count / (double)noSol;
+        double stepSize = (double)solutions.Count / (double)noSol;
         for (int i = 0; i < noSol; i++)
-          selection.Add(solutions.ElementAt((int)Math.Round((i + 1) * stepSize - stepSize * 0.5)));
+          selection.Add(solutions.ElementAt((int)((i + 1) * stepSize - stepSize * 0.5)));
       }
 
Index: anches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TestFunctions/TestFunctionsRosenbrockImprovementOperator.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TestFunctions/TestFunctionsRosenbrockImprovementOperator.cs	(revision 7785)
+++ 	(revision )
@@ -1,48 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.Problems.TestFunctions;
-
-namespace HeuristicLab.Algorithms.ScatterSearch.TestFunctions {
-  /// <summary>
-  /// An operator that improves Rosenbrock test function solutions.
-  /// </summary>
-  [Item("TestFunctionsRosenbrockImprovementOperator", "An operator that improves Rosenbrock test function solutions.")]
-  [StorableClass]
-  public sealed class TestFunctionsRosenbrockImprovementOperator : TestFunctionsImprovementOperator {
-    [StorableConstructor]
-    private TestFunctionsRosenbrockImprovementOperator(bool deserializing) : base(deserializing) { }
-    private TestFunctionsRosenbrockImprovementOperator(TestFunctionsRosenbrockImprovementOperator original, Cloner cloner) : base(original, cloner) { }
-    public TestFunctionsRosenbrockImprovementOperator() : base() { }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new TestFunctionsRosenbrockImprovementOperator(this, cloner);
-    }
-
-    public override IOperation Apply() {
-      FunctionEvaluator = x => { return RosenbrockEvaluator.Apply(x); };
-      return base.Apply();
-    }
-  }
-}
Index: anches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TestFunctions/TestFunctionsSchwefelImprovementOperator.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TestFunctions/TestFunctionsSchwefelImprovementOperator.cs	(revision 7785)
+++ 	(revision )
@@ -1,48 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.Problems.TestFunctions;
-
-namespace HeuristicLab.Algorithms.ScatterSearch.TestFunctions {
-  /// <summary>
-  /// An operator that improves Schwefel test function solutions.
-  /// </summary>
-  [Item("TestFunctionsSchwefelImprovementOperator", "An operator that improves Schwefel test function solutions.")]
-  [StorableClass]
-  public sealed class TestFunctionsSchwefelImprovementOperator : TestFunctionsImprovementOperator {
-    [StorableConstructor]
-    private TestFunctionsSchwefelImprovementOperator(bool deserializing) : base(deserializing) { }
-    private TestFunctionsSchwefelImprovementOperator(TestFunctionsSchwefelImprovementOperator original, Cloner cloner) : base(original, cloner) { }
-    public TestFunctionsSchwefelImprovementOperator() : base() { }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new TestFunctionsSchwefelImprovementOperator(this, cloner);
-    }
-
-    public override IOperation Apply() {
-      FunctionEvaluator = x => { return SchwefelEvaluator.Apply(x); };
-      return base.Apply();
-    }
-  }
-}
Index: /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TestFunctions/TestFunctionsSimilarityCalculator.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TestFunctions/TestFunctionsSimilarityCalculator.cs	(revision 7786)
+++ /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TestFunctions/TestFunctionsSimilarityCalculator.cs	(revision 7786)
@@ -0,0 +1,81 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.RealVectorEncoding;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Algorithms.ScatterSearch.TestFunctions {
+  /// <summary>
+  /// An operator that performs similarity calculation between two test functions solutions.
+  /// </summary>
+  [Item("TestFunctionsSimilarityCalculator", "An operator that performs similarity calculation between two test functions solutions.")]
+  [StorableClass]
+  public sealed class TestFunctionsSimilarityCalculator : SimilarityCalculator {
+    #region Parameter properties
+    public ILookupParameter<DoubleMatrix> BoundsParameter {
+      get { return (ILookupParameter<DoubleMatrix>)Parameters["Bounds"]; }
+    }
+    #endregion
+
+    #region Properties
+    private DoubleMatrix Bounds {
+      get { return BoundsParameter.ActualValue; }
+      set { BoundsParameter.ActualValue = value; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private TestFunctionsSimilarityCalculator(bool deserializing) : base(deserializing) { }
+    private TestFunctionsSimilarityCalculator(TestFunctionsSimilarityCalculator original, Cloner cloner) : base(original, cloner) { }
+    public TestFunctionsSimilarityCalculator()
+      : base() {
+      #region Create parameters
+      Parameters.Add(new LookupParameter<DoubleMatrix>("Bounds"));
+      #endregion
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new TestFunctionsSimilarityCalculator(this, cloner);
+    }
+
+    protected override double CalculateDiversity(IScope left, IScope right) {
+      RealVector sol1 = left.Variables["Point"].Value as RealVector;
+      RealVector sol2 = right.Variables["Point"].Value as RealVector;
+
+      double maxSum = 0.0;
+      for (int i = 0; i < sol1.Length; i++)
+        maxSum += Math.Pow(Bounds[0, 0] - Bounds[0, 1], 2);
+      double maxDistance = Math.Sqrt(maxSum) / sol1.Length;
+
+      double sum = 0.0;
+      for (int i = 0; i < sol1.Length; i++)
+        sum += Math.Pow(sol1[i] - sol2[i], 2);
+      double distance = Math.Sqrt(sum) / sol1.Length;
+
+      return 1.0 - distance / maxDistance;
+    }
+  }
+}
Index: anches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TestFunctions/TestFunctionsSumSquaresImprovementOperator.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TestFunctions/TestFunctionsSumSquaresImprovementOperator.cs	(revision 7785)
+++ 	(revision )
@@ -1,48 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.Problems.TestFunctions;
-
-namespace HeuristicLab.Algorithms.ScatterSearch.TestFunctions {
-  /// <summary>
-  /// An operator that improves SumSquares test function solutions.
-  /// </summary>
-  [Item("TestFunctionsSumSquaresImprovementOperator", "An operator that improves SumSquares test function solutions.")]
-  [StorableClass]
-  public sealed class TestFunctionsSumSquaresImprovementOperator : TestFunctionsImprovementOperator {
-    [StorableConstructor]
-    private TestFunctionsSumSquaresImprovementOperator(bool deserializing) : base(deserializing) { }
-    private TestFunctionsSumSquaresImprovementOperator(TestFunctionsSumSquaresImprovementOperator original, Cloner cloner) : base(original, cloner) { }
-    public TestFunctionsSumSquaresImprovementOperator() : base() { }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new TestFunctionsSumSquaresImprovementOperator(this, cloner);
-    }
-
-    public override IOperation Apply() {
-      FunctionEvaluator = x => { return SumSquaresEvaluator.Apply(x); };
-      return base.Apply();
-    }
-  }
-}
Index: anches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TestFunctions/TestFunctionsZakharovImprovementOperator.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TestFunctions/TestFunctionsZakharovImprovementOperator.cs	(revision 7785)
+++ 	(revision )
@@ -1,48 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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 HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.Problems.TestFunctions;
-
-namespace HeuristicLab.Algorithms.ScatterSearch.TestFunctions {
-  /// <summary>
-  /// An operator that improves Zakharov test function solutions.
-  /// </summary>
-  [Item("TestFunctionsZakharovImprovementOperator", "An operator that improves Zakharov test function solutions.")]
-  [StorableClass]
-  public sealed class TestFunctionsZakharovImprovementOperator : TestFunctionsImprovementOperator {
-    [StorableConstructor]
-    private TestFunctionsZakharovImprovementOperator(bool deserializing) : base(deserializing) { }
-    private TestFunctionsZakharovImprovementOperator(TestFunctionsZakharovImprovementOperator original, Cloner cloner) : base(original, cloner) { }
-    public TestFunctionsZakharovImprovementOperator() : base() { }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new TestFunctionsZakharovImprovementOperator(this, cloner);
-    }
-
-    public override IOperation Apply() {
-      FunctionEvaluator = x => { return ZakharovEvaluator.Apply(x); };
-      return base.Apply();
-    }
-  }
-}
Index: anches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TravelingSalesman/PermutationDiversityCalculator.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TravelingSalesman/PermutationDiversityCalculator.cs	(revision 7785)
+++ 	(revision )
@@ -1,61 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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.Linq;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Encodings.PermutationEncoding;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Algorithms.ScatterSearch.TravelingSalesman {
-  /// <summary>
-  /// An operator that performs diversity calculation between permutations.
-  /// </summary>
-  [Item("PermutationDiversityCalculator", "An operator that performs diversity calculation between permutations.")]
-  [StorableClass]
-  public sealed class PermutationDiversityCalculator : DiversityCalculator {
-    [StorableConstructor]
-    private PermutationDiversityCalculator(bool deserializing) : base(deserializing) { }
-    private PermutationDiversityCalculator(PermutationDiversityCalculator original, Cloner cloner) : base(original, cloner) { }
-    public PermutationDiversityCalculator() : base() { }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new PermutationDiversityCalculator(this, cloner);
-    }
-
-    protected override double CalculateDiversity(IItem left, IItem right) {
-      if (!(left is Permutation) || !(right is Permutation))
-        throw new ArgumentException("Cannot calculate diversity because one of the provided objects or both have the wrong type.");
-
-      var v1 = left as Permutation;
-      var v2 = right as Permutation;
-      double diversity = 0.0;
-      for (int i = 0; i < v1.Length; i++) {
-        var node = v2.Select((x, index) => new { Value = x, ValueIndex = index }).First(x => x.Value == v1[i]);
-        var pred = v2[(node.ValueIndex - 1 + v2.Length) % v2.Length];
-        var succ = v2[(node.ValueIndex + 1) % v2.Length];
-        if (new[] { pred, succ }.All(x => x != v1[(i + 1) % v1.Length])) diversity++;
-      }
-      return diversity;
-    }
-  }
-}
Index: /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TravelingSalesman/TravelingSalesmanImprovementOperator.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TravelingSalesman/TravelingSalesmanImprovementOperator.cs	(revision 7785)
+++ /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TravelingSalesman/TravelingSalesmanImprovementOperator.cs	(revision 7786)
@@ -29,5 +29,4 @@
 using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.Problems.Knapsack;
 using HeuristicLab.Problems.TravelingSalesman;
 
@@ -38,47 +37,24 @@
   [Item("TravelingSalesmanImprovementOperator", "An operator that improves traveling salesman solutions.")]
   [StorableClass]
-  public sealed class TravelingSalesmanImprovementOperator : SingleSuccessorOperator, ILocalImprovementOperator, IScatterSearchTargetProcessor {
-    #region Problem properties
-    public Type ProblemType {
-      get { return typeof(KnapsackProblem); }
-    }
-    [Storable]
-    private KnapsackProblem problem;
-    public IProblem Problem {
-      get { return problem; }
-      set { problem = (KnapsackProblem)value; }
-    }
-    #endregion
-
+  public sealed class TravelingSalesmanImprovementOperator : SingleSuccessorOperator, IImprovementOperator {
     #region Parameter properties
     public ScopeParameter CurrentScopeParameter {
       get { return (ScopeParameter)Parameters["CurrentScope"]; }
     }
-    public IValueLookupParameter<DoubleMatrix> CoordinatesParameter {
-      get { return (IValueLookupParameter<DoubleMatrix>)Parameters["Coordinates"]; }
+    public ILookupParameter<DistanceMatrix> DistanceMatrixParameter {
+      get { return (ILookupParameter<DistanceMatrix>)Parameters["DistanceMatrix"]; }
     }
-    public IValueLookupParameter<IEvaluator> EvaluatorParameter {
-      get { return (IValueLookupParameter<IEvaluator>)Parameters["Evaluator"]; }
+    public ILookupParameter<IEvaluator> EvaluatorParameter {
+      get { return (ILookupParameter<IEvaluator>)Parameters["Evaluator"]; }
     }
-    public IValueLookupParameter<IntValue> ImprovementAttemptsParameter {
-      get { return (IValueLookupParameter<IntValue>)Parameters["ImprovementAttempts"]; }
+    public IValueParameter<IntValue> ImprovementAttemptsParameter {
+      get { return (IValueParameter<IntValue>)Parameters["ImprovementAttempts"]; }
     }
-    public IValueLookupParameter<IRandom> RandomParameter {
-      get { return (IValueLookupParameter<IRandom>)Parameters["Random"]; }
+    public ILookupParameter<IRandom> RandomParameter {
+      get { return (ILookupParameter<IRandom>)Parameters["Random"]; }
     }
     public IValueLookupParameter<IItem> TargetParameter {
       get { return (IValueLookupParameter<IItem>)Parameters["Target"]; }
     }
-    #region ILocalImprovementOperator Parameters
-    public IValueLookupParameter<IntValue> MaximumIterationsParameter {
-      get { return (IValueLookupParameter<IntValue>)Parameters["MaximumIterations"]; }
-    }
-    public ILookupParameter<IntValue> EvaluatedSolutionsParameter {
-      get { return (ILookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; }
-    }
-    public ILookupParameter<ResultCollection> ResultsParameter {
-      get { return (ILookupParameter<ResultCollection>)Parameters["Results"]; }
-    }
-    #endregion
     #endregion
 
@@ -87,7 +63,7 @@
       get { return CurrentScopeParameter.ActualValue; }
     }
-    public DoubleMatrix Coordinates {
-      get { return CoordinatesParameter.ActualValue; }
-      set { CoordinatesParameter.ActualValue = value; }
+    public DistanceMatrix DistanceMatrix {
+      get { return DistanceMatrixParameter.ActualValue; }
+      set { DistanceMatrixParameter.ActualValue = value; }
     }
     public IEvaluator Evaluator {
@@ -96,6 +72,6 @@
     }
     public IntValue ImprovementAttempts {
-      get { return ImprovementAttemptsParameter.ActualValue; }
-      set { ImprovementAttemptsParameter.ActualValue = value; }
+      get { return ImprovementAttemptsParameter.Value; }
+      set { ImprovementAttemptsParameter.Value = value; }
     }
     public IRandom Random {
@@ -110,16 +86,13 @@
     [StorableConstructor]
     private TravelingSalesmanImprovementOperator(bool deserializing) : base(deserializing) { }
-    private TravelingSalesmanImprovementOperator(TravelingSalesmanImprovementOperator original, Cloner cloner)
-      : base(original, cloner) {
-      this.problem = cloner.Clone(original.problem);
-    }
+    private TravelingSalesmanImprovementOperator(TravelingSalesmanImprovementOperator original, Cloner cloner) : base(original, cloner) { }
     public TravelingSalesmanImprovementOperator()
       : base() {
       #region Create parameters
       Parameters.Add(new ScopeParameter("CurrentScope"));
-      Parameters.Add(new ValueLookupParameter<DoubleMatrix>("Coordinates"));
-      Parameters.Add(new ValueLookupParameter<IEvaluator>("Evaluator"));
-      Parameters.Add(new ValueLookupParameter<IntValue>("ImprovementAttempts", new IntValue(100)));
-      Parameters.Add(new ValueLookupParameter<IRandom>("Random"));
+      Parameters.Add(new LookupParameter<DistanceMatrix>("DistanceMatrix"));
+      Parameters.Add(new LookupParameter<IEvaluator>("Evaluator"));
+      Parameters.Add(new ValueParameter<IntValue>("ImprovementAttempts", new IntValue(100)));
+      Parameters.Add(new LookupParameter<IRandom>("Random"));
       Parameters.Add(new ValueLookupParameter<IItem>("Target"));
       #endregion
@@ -132,22 +105,18 @@
 
     public override IOperation Apply() {
-      var currSol = CurrentScope.Variables[TargetParameter.ActualName].Value as Permutation;
-      var bestSol = currSol;
-      double currLength = TSPEuclideanPathEvaluator.Apply(Evaluator as TSPCoordinatesPathEvaluator, Coordinates, currSol);
-      double bestLength = currLength;
+      Permutation currSol = CurrentScope.Variables[TargetParameter.ActualName].Value as Permutation;
+      if (currSol.PermutationType != PermutationTypes.RelativeUndirected)
+        throw new ArgumentException("Cannot improve solution because the permutation type is not supported.");
 
       for (int i = 0; i < ImprovementAttempts.Value; i++) {
         int a = Random.Next(currSol.Length);
         int b = Random.Next(currSol.Length);
-        Invert(currSol, a, b);
-        currLength = TSPEuclideanPathEvaluator.Apply(Evaluator as TSPCoordinatesPathEvaluator, Coordinates, currSol);
-        if (currLength < bestLength) {
-          bestLength = currLength;
-          bestSol = currSol.Clone() as Permutation;
-        }
-        Invert(currSol, a, b);
+        double oldFirstEdgeLength = DistanceMatrix[currSol[a], currSol[(a - 1 + currSol.Length) % currSol.Length]];
+        double oldSecondEdgeLength = DistanceMatrix[currSol[b], currSol[(b + 1) % currSol.Length]];
+        double newFirstEdgeLength = DistanceMatrix[currSol[b], currSol[(a - 1 + currSol.Length) % currSol.Length]];
+        double newSecondEdgeLength = DistanceMatrix[currSol[a], currSol[(b + 1 + currSol.Length) % currSol.Length]];
+        if (newFirstEdgeLength + newSecondEdgeLength < oldFirstEdgeLength + oldSecondEdgeLength)
+          Invert(currSol, a, b);
       }
-
-      CurrentScope.Variables[TargetParameter.ActualName].Value = bestSol;
 
       return base.Apply();
Index: /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TravelingSalesman/TravelingSalesmanMultipleGuidesPathRelinker.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TravelingSalesman/TravelingSalesmanMultipleGuidesPathRelinker.cs	(revision 7785)
+++ /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TravelingSalesman/TravelingSalesmanMultipleGuidesPathRelinker.cs	(revision 7786)
@@ -72,6 +72,6 @@
         throw new ArgumentException("RelinkingAccuracy must be greater than 0.");
 
-      var v1 = initiator.Clone() as Permutation;
-      var targets = new Permutation[guides.Length];
+      Permutation v1 = initiator.Clone() as Permutation;
+      Permutation[] targets = new Permutation[guides.Length];
       Array.Copy(guides, targets, guides.Length);
 
@@ -79,13 +79,13 @@
         throw new ArgumentException("At least one solution is of different length.");
 
-      var solutions = new List<Permutation>();
+      IList<Permutation> solutions = new List<Permutation>();
       for (int i = 0; i < v1.Length; i++) {
-        var currCityIndex = i;
-        var bestCityIndex = (i + 1) % v1.Length;
-        var currDistance = distances[v1[currCityIndex], v1[bestCityIndex]];
+        int currCityIndex = i;
+        int bestCityIndex = (i + 1) % v1.Length;
+        double currDistance = distances[v1[currCityIndex], v1[bestCityIndex]];
         targets.ToList().ForEach(solution => {
           var node = solution.Select((x, index) => new { Id = x, Index = index }).First(x => x.Id == v1[currCityIndex]);
-          var pred = solution[(node.Index - 1 + solution.Length) % solution.Length];
-          var succ = solution[(node.Index + 1) % solution.Length];
+          int pred = solution[(node.Index - 1 + solution.Length) % solution.Length];
+          int succ = solution[(node.Index + 1) % solution.Length];
           var results = new[] { pred, succ }.Select(x => new { Id = x, Distance = distances[x, node.Id] });
           if (results.Any(x => x.Distance < currDistance)) {
@@ -99,11 +99,11 @@
       }
 
-      var selection = new List<IItem>();
+      IList<IItem> selection = new List<IItem>();
       if (solutions.Count > 0) {
-        var noSol = (int)Math.Round(solutions.Count * n.Value);
+        int noSol = (int)(solutions.Count * n.Value);
         if (noSol <= 0) noSol++;
-        var stepSize = (double)solutions.Count / (double)noSol;
+        double stepSize = (double)solutions.Count / (double)noSol;
         for (int i = 0; i < noSol; i++)
-          selection.Add(solutions.ElementAt((int)Math.Round((i + 1) * stepSize - stepSize * 0.5)));
+          selection.Add(solutions.ElementAt((int)((i + 1) * stepSize - stepSize * 0.5)));
       }
 
Index: /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TravelingSalesman/TravelingSalesmanPathRelinker.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TravelingSalesman/TravelingSalesmanPathRelinker.cs	(revision 7785)
+++ /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TravelingSalesman/TravelingSalesmanPathRelinker.cs	(revision 7786)
@@ -54,11 +54,11 @@
         throw new ArgumentException("RelinkingAccuracy must be greater than 0.");
 
-      var v1 = initiator.Clone() as Permutation;
-      var v2 = guide as Permutation;
+      Permutation v1 = initiator.Clone() as Permutation;
+      Permutation v2 = guide as Permutation;
 
       if (v1.Length != v2.Length)
         throw new ArgumentException("The solutions are of different length.");
 
-      var solutions = new List<Permutation>();
+      IList<Permutation> solutions = new List<Permutation>();
       for (int i = 0; i < v1.Length; i++)
         if (v1[i] != v2[i]) {
@@ -73,11 +73,11 @@
         }
 
-      var selection = new List<IItem>();
+      IList<IItem> selection = new List<IItem>();
       if (solutions.Count > 0) {
-        var noSol = (int)Math.Round(solutions.Count * n.Value);
+        int noSol = (int)(solutions.Count * n.Value);
         if (noSol <= 0) noSol++;
-        var stepSize = (double)solutions.Count / (double)noSol;
+        double stepSize = (double)solutions.Count / (double)noSol;
         for (int i = 0; i < noSol; i++)
-          selection.Add(solutions.ElementAt((int)Math.Round((i + 1) * stepSize - stepSize * 0.5)));
+          selection.Add(solutions.ElementAt((int)((i + 1) * stepSize - stepSize * 0.5)));
       }
 
Index: /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TravelingSalesman/TravelingSalesmanSimilarityCalculator.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TravelingSalesman/TravelingSalesmanSimilarityCalculator.cs	(revision 7786)
+++ /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TravelingSalesman/TravelingSalesmanSimilarityCalculator.cs	(revision 7786)
@@ -0,0 +1,63 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.PermutationEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Algorithms.ScatterSearch.TravelingSalesman {
+  /// <summary>
+  /// An operator that performs similarity calculation between two traveling salesman solutions.
+  /// </summary>
+  [Item("TravelingSalesmanSimilarityCalculator", "An operator that performs similarity calculation between two traveling salesman solutions.")]
+  [StorableClass]
+  public sealed class TravelingSalesmanSimilarityCalculator : SimilarityCalculator {
+    [StorableConstructor]
+    private TravelingSalesmanSimilarityCalculator(bool deserializing) : base(deserializing) { }
+    private TravelingSalesmanSimilarityCalculator(TravelingSalesmanSimilarityCalculator original, Cloner cloner) : base(original, cloner) { }
+    public TravelingSalesmanSimilarityCalculator() : base() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new TravelingSalesmanSimilarityCalculator(this, cloner);
+    }
+
+    protected override double CalculateDiversity(IScope left, IScope right) {
+      Permutation v1 = left.Variables["TSPTour"].Value as Permutation;
+      Permutation v2 = right.Variables["TSPTour"].Value as Permutation;
+
+      int[,] edges = new int[v2.Length, 2];
+      for (int i = 0; i < v2.Length; i++) {
+        edges[v2[i], 0] = v2[(i + 1) % v2.Length];
+        edges[v2[i], 1] = v2[(i - 1 + v2.Length) % v2.Length];
+      }
+
+      double similarity = 0.0;
+      for (int i = 0; i < v1.Length; i++) {
+        int targetCity = v1[(i + 1) % v1.Length];
+        if (targetCity == edges[v1[i], 0] || targetCity == edges[v1[i], 1])
+          similarity++;
+      }
+
+      return similarity / v1.Length;
+    }
+  }
+}
Index: /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TravelingSalesman/TravelingSalesmanSimultaneousPathRelinker.cs
===================================================================
--- /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TravelingSalesman/TravelingSalesmanSimultaneousPathRelinker.cs	(revision 7785)
+++ /branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TravelingSalesman/TravelingSalesmanSimultaneousPathRelinker.cs	(revision 7786)
@@ -54,13 +54,13 @@
         throw new ArgumentException("RelinkingAccuracy must be greater than 0.");
 
-      var firstInitiator = initiator.Clone() as Permutation;
-      var firstGuide = guide.Clone() as Permutation;
-      var secondInitiator = firstGuide.Clone() as Permutation;
-      var secondGuide = firstInitiator.Clone() as Permutation;
+      Permutation firstInitiator = initiator.Clone() as Permutation;
+      Permutation firstGuide = guide.Clone() as Permutation;
+      Permutation secondInitiator = firstGuide.Clone() as Permutation;
+      Permutation secondGuide = firstInitiator.Clone() as Permutation;
 
       if (firstInitiator.Length != firstGuide.Length)
         throw new ArgumentException("The solutions are of different length.");
 
-      var solutions = new List<Permutation>();
+      IList<Permutation> solutions = new List<Permutation>();
       for (int i = 0; i < firstInitiator.Length / 2; i++) {
         if (firstInitiator[i] != firstGuide[i]) {
@@ -72,5 +72,5 @@
           solutions.Add(firstInitiator.Clone() as Permutation);
         }
-        var j = secondInitiator.Length - 1 - i;
+        int j = secondInitiator.Length - 1 - i;
         if (secondInitiator[j] != secondGuide[j]) {
           var target = secondInitiator.Select((x, index) => new { Value = x, ValueIndex = index }).First(x => x.Value == secondGuide[j]);
@@ -83,11 +83,11 @@
       }
 
-      var selection = new List<IItem>();
+      IList<IItem> selection = new List<IItem>();
       if (solutions.Count > 0) {
-        var noSol = (int)Math.Round(solutions.Count * n.Value);
+        int noSol = (int)(solutions.Count * n.Value);
         if (noSol <= 0) noSol++;
-        var stepSize = (double)solutions.Count / (double)noSol;
+        double stepSize = (double)solutions.Count / (double)noSol;
         for (int i = 0; i < noSol; i++)
-          selection.Add(solutions.ElementAt((int)Math.Round((i + 1) * stepSize - stepSize * 0.5)));
+          selection.Add(solutions.ElementAt((int)((i + 1) * stepSize - stepSize * 0.5)));
       }
 
