Index: /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior/3.3/Analyzers/AlleleOccurencesInGenerationsAnalyzer.cs
===================================================================
--- /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior/3.3/Analyzers/AlleleOccurencesInGenerationsAnalyzer.cs	(revision 8286)
+++ /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior/3.3/Analyzers/AlleleOccurencesInGenerationsAnalyzer.cs	(revision 8287)
@@ -99,4 +99,6 @@
       var graph = (GenealogyGraph<Permutation>)Results[PopulationGraphResultParameterName].Value;
       var subtours = AlgorithmBehaviorHelpers.ExtractSubtours(BestSolution.Permutation, 2);
+      List<Point2D<double>> points = new List<Point2D<double>>();
+
 
       Dictionary<IntArray, Dictionary<int, List<int>>> occurences = new Dictionary<IntArray, Dictionary<int, List<int>>>();
@@ -106,13 +108,19 @@
 
       for (int i = 0; i < GenerationsParameter.ActualValue.Value; i++) {
-        var individuals = graph.Values.Where(x => x.Rank.Contains(i) || x.Rank.Contains(i + 0.5));
+        var individuals = graph.Values.Where(x => x.Rank.Contains(i));
+        int k = 0;
         foreach (var subtour in subtours) {
           int cnt = 0;
           double quality = 0.0;
+          double min = double.MaxValue;
+          double max = double.MinValue;
           foreach (var individual in individuals) {
             var ind = (IntArray)individual.Data;
             if (AlgorithmBehaviorHelpers.IsSubtour(subtour, (Permutation)ind)) {
               cnt++;
-              quality += TSPDistanceMatrixEvaluator.Apply(DistanceMatrix, (Permutation)individual.Data);
+              double tmp = TSPDistanceMatrixEvaluator.Apply(DistanceMatrix, (Permutation)individual.Data);
+              if (tmp < min) min = tmp;
+              if (tmp > max) max = tmp;
+              quality += tmp;
             }
           }
@@ -122,9 +130,38 @@
           if (cnt != 0) {
             double avgQuality = quality / cnt;
-            double qualityRatio = avgQuality / Qualities.Rows["CurrentAverageQuality"].Values[i] * 100;
+            double qualityRatio = avgQuality / Qualities.Rows["CurrentAverageQuality"].Values[i];
             vals.Add((int)qualityRatio);
+
+            points.Add(new Point2D<double>(k++, qualityRatio));
           }
           occurences[subtour][i] = vals;
         }
+
+        var plot = new ScatterPlot("Contained Edges of Best Found Solution and Relative Solution Qualtiy", null);
+        plot.VisualProperties.XAxisTitle = "Contained Alleles of Best Found Solution";
+        plot.VisualProperties.YAxisTitle = "Relative Solution Quality";
+        plot.VisualProperties.XAxisMinimumAuto = false;
+        plot.VisualProperties.XAxisMinimumFixedValue = 0.0;
+        plot.VisualProperties.XAxisMaximumAuto = false;
+        plot.VisualProperties.XAxisMaximumFixedValue = subtours.Count;
+        /*plot.VisualProperties.YAxisMinimumAuto = false;
+        plot.VisualProperties.YAxisMinimumFixedValue = 0.0;
+        plot.VisualProperties.YAxisMaximumAuto = false;
+        plot.VisualProperties.YAxisMaximumFixedValue = 1.0;*/
+        var row = new ScatterPlotDataRow("Solutions of Current Generation", null, points);
+        row.VisualProperties.PointStyle = ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle.Circle;
+        row.VisualProperties.PointSize = 5;
+        plot.Rows.Add(row);
+
+        if (!Results.ContainsKey("Scatter Plot"))
+          Results.Add(new Result("Scatter Plot", plot));
+        else
+          Results["Scatter Plot"].Value = plot;
+
+        if (!Results.ContainsKey("Scatter Plot History")) {
+          Results.Add(new Result("Scatter Plot History", new ScatterPlotHistory()));
+        }
+        ((ScatterPlotHistory)Results["Scatter Plot History"].Value).Add(plot);
+        points.Clear();
       }
 
Index: /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior/3.3/Analyzers/AlleleOccurencesInGenerationsPerIndAnalyzer.cs
===================================================================
--- /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior/3.3/Analyzers/AlleleOccurencesInGenerationsPerIndAnalyzer.cs	(revision 8287)
+++ /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior/3.3/Analyzers/AlleleOccurencesInGenerationsPerIndAnalyzer.cs	(revision 8287)
@@ -0,0 +1,158 @@
+﻿#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.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.PermutationEncoding;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.TravelingSalesman;
+
+namespace HeuristicLab.Analysis.AlgorithmBehavior {
+
+  /// <summary>
+  /// An operator that analyzes the quality of schemas.
+  /// </summary>
+  [Item("AlleleOccurencesInGenerationsPerInd", "An operator that analyzes broken inheritance of building blocks.")]
+  [StorableClass]
+  public sealed class AlleleOccurencesInGenerationsPerInd : SingleSuccessorOperator, IAnalyzer {
+    private const string ResultsParameterName = "Results";
+    private const string PopulationGraphResultParameterName = "PopulationGraph";
+    private const string SchemataParameterName = "Schemata";
+    private const string SchemaOccurenceInGenerationsMatrixParameterName = "SchemaOccurenceInGenerationsMatrix";
+    private const string QualitiesParameterName = "Qualities";
+    private const string DistanceMatrixParameterName = "DistanceMatrix";
+    private const string GenerationsParameterName = "Generations";
+    private const string BestSolutionParameterName = "Best TSP Solution";
+
+    #region IAnalyzer Members
+    public bool EnabledByDefault {
+      get { return true; }
+    }
+    #endregion
+
+    #region Parameter properties
+    public ILookupParameter<ResultCollection> ResultsParameter {
+      get { return (ILookupParameter<ResultCollection>)Parameters[ResultsParameterName]; }
+    }
+    public ILookupParameter<DistanceMatrix> DistanceMatrixParameter {
+      get { return (ILookupParameter<DistanceMatrix>)Parameters[DistanceMatrixParameterName]; }
+    }
+    public ILookupParameter<IntValue> GenerationsParameter {
+      get { return (ILookupParameter<IntValue>)Parameters[GenerationsParameterName]; }
+    }
+    #endregion
+
+    #region Properties
+    public ResultCollection Results {
+      get { return ResultsParameter.ActualValue; }
+    }
+    public DistanceMatrix DistanceMatrix {
+      get { return DistanceMatrixParameter.ActualValue; }
+    }
+    public HeuristicLab.Analysis.DataTable Qualities {
+      get { return ((HeuristicLab.Analysis.DataTable)ResultsParameter.ActualValue[QualitiesParameterName].Value); }
+    }
+    public PathTSPTour BestSolution {
+      get { return ((PathTSPTour)ResultsParameter.ActualValue[BestSolutionParameterName].Value); }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private AlleleOccurencesInGenerationsPerInd(bool deserializing) : base(deserializing) { }
+    private AlleleOccurencesInGenerationsPerInd(AlleleOccurencesInGenerationsPerInd original, Cloner cloner) : base(original, cloner) { }
+    public AlleleOccurencesInGenerationsPerInd()
+      : base() {
+      Parameters.Add(new LookupParameter<ResultCollection>(ResultsParameterName, "The results collection where the analysis values should be stored."));
+      Parameters.Add(new LookupParameter<DistanceMatrix>(DistanceMatrixParameterName, "The distance matrix of the TSP."));
+      Parameters.Add(new LookupParameter<IntValue>(GenerationsParameterName, "Nr of generations."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new AlleleOccurencesInGenerationsPerInd(this, cloner);
+    }
+
+    public override IOperation Apply() {
+      var graph = (GenealogyGraph<Permutation>)Results[PopulationGraphResultParameterName].Value;
+      var subtours = AlgorithmBehaviorHelpers.ExtractSubtours(BestSolution.Permutation, 2);
+      List<Point2D<double>> points = new List<Point2D<double>>();
+
+      for (int i = 0; i < GenerationsParameter.ActualValue.Value; i++) {
+        var individuals = graph.Values.Where(x => x.Rank.Contains(i));
+        List<double> qualitiesInGen = new List<double>();
+        foreach (var individual in individuals) {
+          qualitiesInGen.Add(TSPDistanceMatrixEvaluator.Apply(DistanceMatrix, (Permutation)individual.Data));
+        }
+
+        foreach (var individual in individuals) {
+          var ind = (IntArray)individual.Data;
+          int cnt = 0;
+          double curQuality = TSPDistanceMatrixEvaluator.Apply(DistanceMatrix, (Permutation)individual.Data);
+
+          foreach (var subtour in subtours) {
+            if (AlgorithmBehaviorHelpers.IsSubtour(subtour, (Permutation)ind)) {
+              cnt++;
+            }
+          }
+
+          double qualityRange = Math.Abs(qualitiesInGen.Max() - qualitiesInGen.Min());
+          points.Add(new Point2D<double>(cnt, Math.Abs(curQuality - qualitiesInGen.Min()) / qualityRange));
+
+        }
+
+        var plot = new ScatterPlot("Contained Edges of Best Found Solution and Relative Solution Qualtiy", null);
+        plot.VisualProperties.XAxisTitle = "Contained Alleles of Best Found Solution";
+        plot.VisualProperties.YAxisTitle = "Relative Solution Quality";
+        plot.VisualProperties.XAxisMinimumAuto = false;
+        plot.VisualProperties.XAxisMinimumFixedValue = 0.0;
+        plot.VisualProperties.XAxisMaximumAuto = false;
+        plot.VisualProperties.XAxisMaximumFixedValue = individuals.Count();
+        plot.VisualProperties.YAxisMinimumAuto = false;
+        plot.VisualProperties.YAxisMinimumFixedValue = 0.0;
+        plot.VisualProperties.YAxisMaximumAuto = false;
+        plot.VisualProperties.YAxisMaximumFixedValue = 1.0;
+        var row = new ScatterPlotDataRow("Solutions of Current Generation", null, points);
+        row.VisualProperties.PointStyle = ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle.Circle;
+        row.VisualProperties.PointSize = 5;
+        plot.Rows.Add(row);
+
+        if (!Results.ContainsKey("Scatter Plot per Ind"))
+          Results.Add(new Result("Scatter Plot per Ind", plot));
+        else
+          Results["Scatter Plot per Ind"].Value = plot;
+
+        if (!Results.ContainsKey("Scatter Plot per Ind History")) {
+          Results.Add(new Result("Scatter Plot per Ind History", new ScatterPlotHistory()));
+        }
+        ((ScatterPlotHistory)Results["Scatter Plot per Ind History"].Value).Add(plot);
+        points.Clear();
+      }
+
+      return base.Apply();
+    }
+  }
+}
Index: /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior/3.3/Analyzers/DistinctSolutionsAnalyzer.cs
===================================================================
--- /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior/3.3/Analyzers/DistinctSolutionsAnalyzer.cs	(revision 8286)
+++ /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior/3.3/Analyzers/DistinctSolutionsAnalyzer.cs	(revision 8287)
@@ -44,4 +44,5 @@
     private const string SchemataParameterName = "Schemata";
     private const string DistinctSolutionsInGenerationsMatrixParameterName = "DistinctSolutionsInGenerationsMatrix";
+    private const string OverallDistinctSolutionsParameterName = "OverallDistinctSolutions";
     private const string QualitiesParameterName = "Qualities";
     private const string DistanceMatrixParameterName = "DistanceMatrix";
@@ -49,4 +50,5 @@
     private const string PopulationSizeParameterName = "PopulationSize";
     private const string BestSolutionParameterName = "Best TSP Solution";
+    private const string EvaluatedSolutionsParameterName = "EvaluatedSolutions";
 
     #region IAnalyzer Members
@@ -81,4 +83,7 @@
       get { return ((HeuristicLab.Analysis.DataTable)ResultsParameter.ActualValue[QualitiesParameterName].Value); }
     }
+    public IntValue EvaluatedSolutions {
+      get { return ((IntValue)ResultsParameter.ActualValue[EvaluatedSolutionsParameterName].Value); }
+    }
     public PathTSPTour BestSolution {
       get { return ((PathTSPTour)ResultsParameter.ActualValue[BestSolutionParameterName].Value); }
@@ -105,4 +110,6 @@
       int generations = GenerationsParameter.ActualValue.Value;
       int popSize = PopulationSizeParameter.ActualValue.Value;
+      int evaluatedSolutions = EvaluatedSolutions.Value;
+      int overallDistinctSolutions = 0;
 
       Dictionary<int, int> distinctSolsInGen = new Dictionary<int, int>();
@@ -111,4 +118,5 @@
         var individuals = graph.Values.Where(x => x.Rank.Contains(i));
         distinctSolsInGen.Add(i, individuals.Count());
+        overallDistinctSolutions += individuals.Count();
       }
 
@@ -122,4 +130,5 @@
 
       Results.Add(new Result(DistinctSolutionsInGenerationsMatrixParameterName, dt));
+      Results.Add(new Result(OverallDistinctSolutionsParameterName, new DoubleValue(evaluatedSolutions / (double)overallDistinctSolutions)));
       return base.Apply();
     }
Index: /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior/3.3/HeuristicLab.Analysis.AlgorithmBehavior-3.3.csproj
===================================================================
--- /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior/3.3/HeuristicLab.Analysis.AlgorithmBehavior-3.3.csproj	(revision 8286)
+++ /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior/3.3/HeuristicLab.Analysis.AlgorithmBehavior-3.3.csproj	(revision 8287)
@@ -102,4 +102,5 @@
     <Compile Include="Analyzers\AlleleOccurencesInGenerationsAnalyzer.cs" />
     <Compile Include="Analyzers\ConvergenceSpeedAnalyzer.cs" />
+    <Compile Include="Analyzers\AlleleOccurencesInGenerationsPerIndAnalyzer.cs" />
     <Compile Include="Analyzers\DistinctSolutionsAnalyzer.cs" />
     <Compile Include="Creators\BestIndividualSchemataCreator.cs" />
