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 8498)
+++ /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/CrossoverPerformanceAnalyzer.cs	(revision 8499)
@@ -32,4 +32,5 @@
 using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.TravelingSalesman;
 
 namespace HeuristicLab.Analysis.AlgorithmBehavior.Analyzers {
@@ -77,8 +78,11 @@
     #endregion
 
-    ScatterPlot plot, childDiversityPlot, parentDiversityPlot;
-    DataRow dtRow, dtRowSuccess;
+    ScatterPlotHelper plotHelper, childDiversityHelper, parentDiversityHelper;
+    DataTableHelper performanceHelper, successHelper, equalParentsHelper;
     int cnt = 0;
     int success = 0;
+    int lastGeneration = 0;
+    int equalParents = 0;
+    List<double> qualityPoints = new List<double>();
 
     [StorableConstructor]
@@ -103,4 +107,11 @@
 
       Parameters.Add(new ValueParameter<SingleObjectiveSolutionSimilarityCalculator>("SimilarityCalculator"));
+
+      plotHelper = new ScatterPlotHelper();
+      childDiversityHelper = new ScatterPlotHelper();
+      parentDiversityHelper = new ScatterPlotHelper();
+      performanceHelper = new DataTableHelper();
+      successHelper = new DataTableHelper();
+      equalParentsHelper = new DataTableHelper();
     }
 
@@ -113,4 +124,12 @@
       SimilarityCalculatorParameter.Value.SolutionVariableName = "TSPTour";
 
+      plotHelper.InitializePlot(Results, "Crossover Performance", "Solution Index", "Absolut Quality Difference");
+      childDiversityHelper.InitializePlot(Results, "Child Diversity", "Solution Index", "Diversity");
+      parentDiversityHelper.InitializePlot(Results, "Parent Diversity", "Solution Index", "Diversity");
+
+      performanceHelper.InitializeChart(Results, "Average Crossover Performance", "Average Crossover Performance per Generation");
+      successHelper.InitializeChart(Results, "Successfull Crossovers", "Successfull Crossovers per Generation");
+      equalParentsHelper.InitializeChart(Results, "Number of equal parents", "Absolut number of equal parents");
+
       Point2D<double> qualityPoint, diversityPointChild, diversityPointParent;
       var qualityParent1 = ParentsQualityParameter.ActualValue.First().Value;
@@ -120,4 +139,6 @@
       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);
@@ -133,79 +154,26 @@
         success++;
       }
+      qualityPoints.Add(qualityPoint.Y);
 
-      string curGenStr = GenerationsParameter.ActualValue.Value.ToString();
-
-      if (!Results.ContainsKey("Scatter Plot")) {
-        InitializePlot();
-        InitializeChildDiversityPlot();
-        InitializeParentDiversityPlot();
-
-        Results.Add(new Result("Scatter Plot", plot));
-        Results.Add(new Result("Scatter Plot History", new ScatterPlotHistory()));
-
-        Results.Add(new Result("Child Diversity Scatter Plot", childDiversityPlot));
-        Results.Add(new Result("Child Diversity Scatter Plot History", new ScatterPlotHistory()));
-
-        Results.Add(new Result("Parent Diversity Scatter Plot", parentDiversityPlot));
-        Results.Add(new Result("Parent Diversity Scatter Plot History", new ScatterPlotHistory()));
-        cnt = 0;
-
-        DataTable dt = new DataTable("Average Crossover Performance");
-        dtRow = new DataRow("Average Crossover Performance per Generation");
-        dt.Rows.Add(dtRow);
-        Results.Add(new Result("Average Crossover Performance", dt));
-
-        DataTable dtSuccess = new DataTable("Successfull Crossovers");
-        dtRowSuccess = new DataRow("Successfull Crossovers per Generation");
-        dtSuccess.Rows.Add(dtRowSuccess);
-        Results.Add(new Result("Successfull Crossovers", dtSuccess));
-
-        success = 0;
+      if (TSPSimilarityCalculator.CalculateSimilarity(parent1, parent2) == 1.0) {
+        equalParents++;
       }
 
-      if (!plot.Rows.ContainsKey(curGenStr)) {
-        if (GenerationsParameter.ActualValue.Value != 0) {
-          double avg = plot.Rows[(GenerationsParameter.ActualValue.Value - 1).ToString()].Points.Average(x => x.Y);
-          dtRow.Values.Add(avg);
-          dtRowSuccess.Values.Add(success);
+      if (GenerationsParameter.ActualValue.Value != 0) {
+        if (GenerationsParameter.ActualValue.Value > lastGeneration) {
+          double avg = qualityPoints.Average();
 
-          ((ScatterPlotHistory)Results["Scatter Plot History"].Value).Add(plot);
-          ((ScatterPlotHistory)Results["Child Diversity Scatter Plot History"].Value).Add(childDiversityPlot);
-          ((ScatterPlotHistory)Results["Parent Diversity Scatter Plot History"].Value).Add(parentDiversityPlot);
-          InitializePlot();
-          InitializeChildDiversityPlot();
-          InitializeParentDiversityPlot();
-          Results["Scatter Plot"].Value = plot;
-          Results["Child Diversity Scatter Plot"].Value = childDiversityPlot;
-          Results["Parent Diversity Scatter Plot"].Value = parentDiversityPlot;
-          cnt = 0;
-          success = 0;
+          performanceHelper.AddPoint(avg);
+          successHelper.AddPoint(success);
+          equalParentsHelper.AddPoint(equalParents);
+
+          Reset();
         }
 
-        var points = new List<Point2D<double>>();
-        points.Add(qualityPoint);
-        ScatterPlotDataRow row;
-        row = new ScatterPlotDataRow(curGenStr, null, points);
-        row.VisualProperties.PointStyle = ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle.Circle;
-        row.VisualProperties.PointSize = 5;
-        plot.Rows.Add(row);
-
-        points = new List<Point2D<double>>();
-        points.Add(diversityPointChild);
-        row = new ScatterPlotDataRow(curGenStr, null, points);
-        row.VisualProperties.PointStyle = ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle.Circle;
-        row.VisualProperties.PointSize = 5;
-        childDiversityPlot.Rows.Add(row);
-
-        points = new List<Point2D<double>>();
-        points.Add(diversityPointParent);
-        row = new ScatterPlotDataRow(curGenStr, null, points);
-        row.VisualProperties.PointStyle = ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle.Circle;
-        row.VisualProperties.PointSize = 5;
-        parentDiversityPlot.Rows.Add(row);
+        plotHelper.AddPoint(curGenStr, qualityPoint);
+        childDiversityHelper.AddPoint(curGenStr, diversityPointChild);
+        parentDiversityHelper.AddPoint(curGenStr, diversityPointParent);
       } else {
-        plot.Rows[curGenStr].Points.Add(qualityPoint);
-        childDiversityPlot.Rows[curGenStr].Points.Add(diversityPointChild);
-        parentDiversityPlot.Rows[curGenStr].Points.Add(diversityPointParent);
+        Reset();
       }
 
@@ -213,18 +181,10 @@
     }
 
-    private void InitializePlot() {
-      plot = new ScatterPlot("Crossover Performance", null);
-      plot.VisualProperties.XAxisTitle = "Solution Index";
-      plot.VisualProperties.YAxisTitle = "Absolut Quality Difference";
-    }
-    private void InitializeChildDiversityPlot() {
-      childDiversityPlot = new ScatterPlot("Child Diversity", null);
-      childDiversityPlot.VisualProperties.XAxisTitle = "Solution Index";
-      childDiversityPlot.VisualProperties.YAxisTitle = "Diversity";
-    }
-    private void InitializeParentDiversityPlot() {
-      parentDiversityPlot = new ScatterPlot("Parent Diversity", null);
-      parentDiversityPlot.VisualProperties.XAxisTitle = "Solution Index";
-      parentDiversityPlot.VisualProperties.YAxisTitle = "Diversity";
+    private void Reset() {
+      cnt = 0;
+      success = 0;
+      lastGeneration = GenerationsParameter.ActualValue.Value;
+      qualityPoints.Clear();
+      equalParents = 0;
     }
   }
Index: /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/MutationPerformanceAnalyzer.cs
===================================================================
--- /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/MutationPerformanceAnalyzer.cs	(revision 8498)
+++ /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/MutationPerformanceAnalyzer.cs	(revision 8499)
@@ -134,12 +134,18 @@
           double avg = qualityPoints.Average();
           avgDataTableHelper.AddPoint(avg);
-          cnt = 0;
-          lastGeneration = GenerationsParameter.ActualValue.Value;
-          qualityPoints.Clear();
+          Reset();
         }
+      } else {
+        Reset();
       }
 
       return base.Apply();
     }
+
+    private void Reset() {
+      cnt = 0;
+      lastGeneration = GenerationsParameter.ActualValue.Value;
+      qualityPoints.Clear();
+    }
   }
 }
