Index: branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/CrossoverPerformanceAnalyzer.cs
===================================================================
--- branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/CrossoverPerformanceAnalyzer.cs	(revision 8797)
+++ branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/CrossoverPerformanceAnalyzer.cs	(revision 8864)
@@ -21,4 +21,5 @@
 
 
+using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -34,21 +35,15 @@
   [Item("CrossoverPerformanceAnalyzer", "An operator that analyzes the performance of crossovers.")]
   [StorableClass]
-  public class CrossoverPerformanceAnalyzer : InitializableOperator, IAnalyzer {
+  public class CrossoverPerformanceAnalyzer : InitializableOperator {
     private const string ResultsParameterName = "Results";
     private const string GenerationsParameterName = "Generations";
     private const string SuccessfullCrossoversRowName = "Successfull Crossovers per Generation with CompFact ";
 
-    #region IAnalyzer Members
-    public bool EnabledByDefault {
-      get { return true; }
-    }
-    #endregion
-
     #region Parameter properties
     public IValueLookupParameter<BoolValue> MaximizationParameter {
       get { return (IValueLookupParameter<BoolValue>)Parameters["Maximization"]; }
     }
-    public IValueParameter<ItemCollection<DoubleValue>> ComparisonFactorParameter {
-      get { return (IValueParameter<ItemCollection<DoubleValue>>)Parameters["ComparisonFactor"]; }
+    public IValueLookupParameter<ItemCollection<DoubleValue>> ComparisonFactorParameter {
+      get { return (IValueLookupParameter<ItemCollection<DoubleValue>>)Parameters["ComparisonFactor"]; }
     }
     public ILookupParameter<ResultCollection> ResultsParameter {
@@ -85,5 +80,5 @@
 
     [Storable]
-    private ScatterPlotHelper plotHelper, childDiversityHelper, parentDiversityHelper;
+    private ScatterPlotHelper plotHelper, childDiversityToWorseParentHelper, childDiversityToBetterParentHelper, parentDiversityHelper, parentQualityHelper;
     [Storable]
     private DataTableHelper performanceHelper, successHelper, equalParentsHelper;
@@ -109,6 +104,8 @@
       qualityPoints = new List<double>(original.qualityPoints);
       plotHelper = (ScatterPlotHelper)original.plotHelper.Clone(cloner);
-      childDiversityHelper = (ScatterPlotHelper)original.childDiversityHelper.Clone(cloner);
+      childDiversityToWorseParentHelper = (ScatterPlotHelper)original.childDiversityToWorseParentHelper.Clone(cloner);
+      childDiversityToBetterParentHelper = (ScatterPlotHelper)original.childDiversityToBetterParentHelper.Clone(cloner);
       parentDiversityHelper = (ScatterPlotHelper)original.parentDiversityHelper.Clone(cloner);
+      parentQualityHelper = (ScatterPlotHelper)original.parentQualityHelper.Clone(cloner);
       performanceHelper = (DataTableHelper)original.performanceHelper.Clone(cloner);
       successHelper = (DataTableHelper)original.successHelper.Clone(cloner);
@@ -136,13 +133,12 @@
       Parameters.Add(new LookupParameter<ItemCollection<IItem>>("Operators", "The operators and items that the problem provides to the algorithms."));
       Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, false otherwise"));
-      Parameters.Add(new ValueParameter<ItemCollection<DoubleValue>>("ComparisonFactor", "Determines if the quality should be compared to the better parent (1.0), to the worse (0.0) or to any linearly interpolated value between them."));
-      ComparisonFactorParameter.Value.Add(new DoubleValue(0));
-      ComparisonFactorParameter.Value.Add(new DoubleValue(0.5));
-      ComparisonFactorParameter.Value.Add(new DoubleValue(1));
+      Parameters.Add(new ValueLookupParameter<ItemCollection<DoubleValue>>("ComparisonFactor", "Determines if the quality should be compared to the better parent (1.0), to the worse (0.0) or to any linearly interpolated value between them."));
 
 
       plotHelper = new ScatterPlotHelper(false, true);
-      childDiversityHelper = new ScatterPlotHelper(false, true);
+      childDiversityToWorseParentHelper = new ScatterPlotHelper(false, true);
+      childDiversityToBetterParentHelper = new ScatterPlotHelper(false, true);
       parentDiversityHelper = new ScatterPlotHelper(false, true);
+      parentQualityHelper = new ScatterPlotHelper(false, true);
       performanceHelper = new DataTableHelper();
       successHelper = new DataTableHelper();
@@ -159,4 +155,12 @@
       }
 
+      if (ComparisonFactorParameter.ActualValue == null) {
+        ComparisonFactorParameter.Value = new ItemCollection<DoubleValue>();
+        ComparisonFactorParameter.Value.Add(new DoubleValue(0));
+        ComparisonFactorParameter.Value.Add(new DoubleValue(0.5));
+        ComparisonFactorParameter.Value.Add(new DoubleValue(1));
+        ComparisonFactorParameter.Value.Add(new DoubleValue(1.5));
+      }
+
       if (success == null) {
         success = new int[ComparisonFactorParameter.Value.Count];
@@ -164,6 +168,8 @@
 
       plotHelper.InitializePlot(Results, "Crossover Performance", "Solution Index", "Absolut Quality Difference");
-      childDiversityHelper.InitializePlot(Results, "Child Diversity", "Solution Index", "Diversity");
+      childDiversityToWorseParentHelper.InitializePlot(Results, "Child Diversity to Worse Parent", "Solution Index", "Diversity");
+      childDiversityToBetterParentHelper.InitializePlot(Results, "Child Diversity to Better Parent", "Solution Index", "Diversity");
       parentDiversityHelper.InitializePlot(Results, "Parent Diversity", "Solution Index", "Diversity");
+      parentQualityHelper.InitializePlot(Results, "Parent Quality Difference", "Solution Index", "Absolut Quality Difference");
       performanceHelper.InitializeChart(Results, "Average Crossover Performance", new string[] { "Average Crossover Performance per Generation" });
       equalParentsHelper.InitializeChart(Results, "Number of equal parents", new string[] { "Absolut number of equal parents" });
@@ -179,22 +185,37 @@
       Initialize();
 
-      Point2D<double> qualityPoint, diversityPointChild, diversityPointParent;
+      Point2D<double> qualityPoint, childDiversityToWorseParent, childDiversityToBetterParent, diversityPointParent, qualityPointParent;
+      var parent1 = ParentsParameter.ActualValue.First();
+      var parent2 = ParentsParameter.ActualValue.Last();
       var qualityParent1 = ParentsQualityParameter.ActualValue.First().Value;
       var qualityParent2 = ParentsQualityParameter.ActualValue.Last().Value;
+      var child = ChildParameter.ActualValue;
       var qualityChild = QualityParameter.ActualValue.Value;
-      var child = ChildParameter.ActualValue;
-      var parent1 = ParentsParameter.ActualValue.First();
-      var parent2 = ParentsParameter.ActualValue.Last();
+
       var parentDiversity = SimilarityCalculatorParameter.Value.CalculateSolutionSimilarity(ExecutionContext.Scope.SubScopes.First(), ExecutionContext.Scope.SubScopes.Last());
       string curGenStr = GenerationsParameter.ActualValue.Value.ToString();
 
       diversityPointParent = new Point2D<double>(cnt, parentDiversity);
+      qualityPointParent = new Point2D<double>(cnt, Math.Abs(qualityParent1 - qualityParent2));
+
+      if (qualityParent1 > qualityParent2) {
+        if (MaximizationParameter.ActualValue.Value) {
+          childDiversityToWorseParent = new Point2D<double>(cnt, SimilarityCalculatorParameter.Value.CalculateSolutionSimilarity(ExecutionContext.Scope, ExecutionContext.Scope.SubScopes.Last()));
+          childDiversityToBetterParent = new Point2D<double>(cnt, SimilarityCalculatorParameter.Value.CalculateSolutionSimilarity(ExecutionContext.Scope, ExecutionContext.Scope.SubScopes.First()));
+        } else {
+          childDiversityToWorseParent = new Point2D<double>(cnt, SimilarityCalculatorParameter.Value.CalculateSolutionSimilarity(ExecutionContext.Scope, ExecutionContext.Scope.SubScopes.First()));
+          childDiversityToBetterParent = new Point2D<double>(cnt, SimilarityCalculatorParameter.Value.CalculateSolutionSimilarity(ExecutionContext.Scope, ExecutionContext.Scope.SubScopes.Last()));
+        }
+      } else {
+        if (MaximizationParameter.ActualValue.Value) {
+          childDiversityToWorseParent = new Point2D<double>(cnt, SimilarityCalculatorParameter.Value.CalculateSolutionSimilarity(ExecutionContext.Scope, ExecutionContext.Scope.SubScopes.First()));
+          childDiversityToBetterParent = new Point2D<double>(cnt, SimilarityCalculatorParameter.Value.CalculateSolutionSimilarity(ExecutionContext.Scope, ExecutionContext.Scope.SubScopes.Last()));
+        } else {
+          childDiversityToWorseParent = new Point2D<double>(cnt, SimilarityCalculatorParameter.Value.CalculateSolutionSimilarity(ExecutionContext.Scope, ExecutionContext.Scope.SubScopes.Last()));
+          childDiversityToBetterParent = new Point2D<double>(cnt, SimilarityCalculatorParameter.Value.CalculateSolutionSimilarity(ExecutionContext.Scope, ExecutionContext.Scope.SubScopes.First()));
+        }
+      }
+
       double worseQuality = qualityParent1 > qualityParent2 ? qualityParent1 : qualityParent2;
-      if (qualityParent1 > qualityParent2) {
-        diversityPointChild = new Point2D<double>(cnt, SimilarityCalculatorParameter.Value.CalculateSolutionSimilarity(ExecutionContext.Scope, ExecutionContext.Scope.SubScopes.First()));
-      } else {
-        diversityPointChild = new Point2D<double>(cnt, SimilarityCalculatorParameter.Value.CalculateSolutionSimilarity(ExecutionContext.Scope, ExecutionContext.Scope.SubScopes.Last()));
-      }
-
       qualityPoint = new Point2D<double>(cnt++, worseQuality - qualityChild);
       qualityPoints.Add(qualityPoint.Y);
@@ -227,6 +248,8 @@
 
         plotHelper.AddPoint(curGenStr, qualityPoint);
-        childDiversityHelper.AddPoint(curGenStr, diversityPointChild);
+        childDiversityToWorseParentHelper.AddPoint(curGenStr, childDiversityToWorseParent);
+        childDiversityToBetterParentHelper.AddPoint(curGenStr, childDiversityToBetterParent);
         parentDiversityHelper.AddPoint(curGenStr, diversityPointParent);
+        parentQualityHelper.AddPoint(curGenStr, qualityPointParent);
       } else {
         Reset();
