Index: branches/PerformanceComparison/HeuristicLab.Analysis/3.3/PopulationSimilarityAnalysis/PopulationSimilarityAnalyzer.cs
===================================================================
--- branches/PerformanceComparison/HeuristicLab.Analysis/3.3/PopulationSimilarityAnalysis/PopulationSimilarityAnalyzer.cs	(revision 13401)
+++ branches/PerformanceComparison/HeuristicLab.Analysis/3.3/PopulationSimilarityAnalysis/PopulationSimilarityAnalyzer.cs	(revision 13475)
@@ -39,4 +39,6 @@
   public class PopulationSimilarityAnalyzer : SingleSuccessorOperator, IAnalyzer, ISimilarityBasedOperator {
     private const string DiversityResultNameParameterName = "DiversityResultsName";
+    private const string ExecuteInParallelParameterName = "ExecuteInParallel";
+    private const string MaxDegreeOfParallelismParameterName = "MaxDegreeOfParallelism";
 
     #region Backwards compatible code, remove with 3.4
@@ -71,4 +73,10 @@
       get { return (FixedValueParameter<StringValue>)Parameters[DiversityResultNameParameterName]; }
     }
+    public IFixedValueParameter<BoolValue> ExecuteInParallelParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[ExecuteInParallelParameterName]; }
+    }
+    public IFixedValueParameter<IntValue> MaxDegreeOfParallelismParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters[MaxDegreeOfParallelismParameterName]; }
+    }
 
     public string DiversityResultName {
@@ -77,7 +85,22 @@
     }
 
+    public bool ExecuteInParallel {
+      get { return ExecuteInParallelParameter.Value.Value; }
+      set { ExecuteInParallelParameter.Value.Value = value; }
+    }
+
+    public int MaxDegreeOfParallelism {
+      get { return MaxDegreeOfParallelismParameter.Value.Value; }
+      set { MaxDegreeOfParallelismParameter.Value.Value = value; }
+    }
+
     [StorableConstructor]
     protected PopulationSimilarityAnalyzer(bool deserializing) : base(deserializing) { }
-    protected PopulationSimilarityAnalyzer(PopulationSimilarityAnalyzer original, Cloner cloner) : base(original, cloner) { }
+
+    protected PopulationSimilarityAnalyzer(PopulationSimilarityAnalyzer original, Cloner cloner)
+      : base(original, cloner) {
+      RegisterParametersEventHandlers();
+    }
+
     public PopulationSimilarityAnalyzer(IEnumerable<ISolutionSimilarityCalculator> validSimilarityCalculators)
       : base() {
@@ -89,12 +112,31 @@
       Parameters.Add(new LookupParameter<IntValue>("UpdateCounter", "The value which counts how many times the operator was called since the last update.", "PopulationDiversityAnalyzerUpdateCounter"));
       Parameters.Add(new FixedValueParameter<StringValue>(DiversityResultNameParameterName, "Specifies how the diversity results should be named.", new StringValue("PopulationDiversity")));
+      Parameters.Add(new FixedValueParameter<BoolValue>(ExecuteInParallelParameterName, "Specifies whether similarity calculations should be parallelized.", new BoolValue(false)));
+      Parameters.Add(new FixedValueParameter<IntValue>(MaxDegreeOfParallelismParameterName, "Specifies the maximum number of threads when calculating similarities in parallel.", new IntValue(-1)));
 
       var similarityCalculators = SimilarityCalculatorParameter.ValidValues;
-      foreach (var sc in validSimilarityCalculators)
+      foreach (var sc in validSimilarityCalculators) {
         similarityCalculators.Add(sc);
-
+      }
 
       ResultsParameter.Hidden = true;
       UpdateCounterParameter.Hidden = true;
+      ExecuteInParallelParameter.Hidden = true;
+      MaxDegreeOfParallelismParameter.Hidden = true;
+
+      RegisterParametersEventHandlers();
+    }
+
+    private void RegisterParametersEventHandlers() {
+      ExecuteInParallelParameter.Value.ValueChanged += Value_ValueChanged;
+      MaxDegreeOfParallelismParameter.Value.ValueChanged += Value_ValueChanged;
+    }
+
+    private void Value_ValueChanged(object sender, EventArgs e) {
+      var similarityCalculators = SimilarityCalculatorParameter.ValidValues;
+      foreach (var similarityCalculator in similarityCalculators) {
+        similarityCalculator.ExecuteInParallel = ExecuteInParallel;
+        similarityCalculator.MaxDegreeOfParallelism = MaxDegreeOfParallelism;
+      }
     }
 
@@ -113,5 +155,19 @@
         Parameters.Add(new ConstrainedValueParameter<ISolutionSimilarityCalculator>("SimilarityCalculator", "The similarity calculator that should be used to calculate solution similarity."));
 
-      SimilarityCalculatorParameter.ValidValues.Add(oldSimilarityCalculator);
+      if (oldSimilarityCalculator != null)
+        SimilarityCalculatorParameter.ValidValues.Add(oldSimilarityCalculator);
+
+      if (!Parameters.ContainsKey(ExecuteInParallelParameterName)) {
+        Parameters.Add(new FixedValueParameter<BoolValue>(ExecuteInParallelParameterName,
+          "Specifies whether similarity calculations should be parallelized.", new BoolValue(false)));
+        ExecuteInParallelParameter.Hidden = true;
+      }
+      if (!Parameters.ContainsKey(MaxDegreeOfParallelismParameterName)) {
+        Parameters.Add(new FixedValueParameter<IntValue>(MaxDegreeOfParallelismParameterName,
+          "Specifies the maximum number of threads when calculating similarities in parallel.", new IntValue(-1)));
+        MaxDegreeOfParallelismParameter.Hidden = true;
+      }
+
+      RegisterParametersEventHandlers();
       #endregion
     }
