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 8277)
+++ /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior/3.3/Analyzers/DistinctSolutionsAnalyzer.cs	(revision 8277)
@@ -0,0 +1,128 @@
+﻿#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.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("DistinctSolutionsAnalyzer", "An operator that analyzes broken inheritance of building blocks.")]
+  [StorableClass]
+  public sealed class DistinctSolutionsAnalyzer : 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 PopulationSizeParameterName = "PopulationSize";
+    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]; }
+    }
+    public ILookupParameter<IntValue> PopulationSizeParameter {
+      get { return (ILookupParameter<IntValue>)Parameters[PopulationSizeParameterName]; }
+    }
+    #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 DistinctSolutionsAnalyzer(bool deserializing) : base(deserializing) { }
+    private DistinctSolutionsAnalyzer(DistinctSolutionsAnalyzer original, Cloner cloner) : base(original, cloner) { }
+    public DistinctSolutionsAnalyzer()
+      : 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."));
+      Parameters.Add(new LookupParameter<IntValue>(PopulationSizeParameterName, "Population Size."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new DistinctSolutionsAnalyzer(this, cloner);
+    }
+
+    public override IOperation Apply() {
+      var graph = (GenealogyGraph<Permutation>)Results[PopulationGraphResultParameterName].Value;
+      int generations = GenerationsParameter.ActualValue.Value;
+      int popSize = PopulationSizeParameter.ActualValue.Value;
+
+      Dictionary<int, int> distinctSolsInGen = new Dictionary<int, int>();
+
+      for (int i = 0; i < generations; i++) {
+        var individuals = graph.Values.Where(x => x.Rank.Contains(i) || x.Rank.Contains(i + 0.5)); //TODO: fix needs fixing
+        distinctSolsInGen.Add(i, individuals.Count());
+      }
+
+      var stringMatrix = new StringMatrix(generations, 2);
+      for (int i = 0; i < distinctSolsInGen.Keys.Count; i++) {
+        var element = distinctSolsInGen.ElementAt(i);
+        stringMatrix[i, 0] = element.Key.ToString();
+        stringMatrix[i, 1] = element.Value.ToString();
+      }
+      stringMatrix.ColumnNames = new[] { "Generation", "Distinct Solutions" };
+
+      Results.Add(new Result(SchemaOccurenceInGenerationsMatrixParameterName, stringMatrix));
+
+      return base.Apply();
+    }
+  }
+}
Index: /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior/3.3/Analyzers/GenealogyAnalyzer.cs
===================================================================
--- /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior/3.3/Analyzers/GenealogyAnalyzer.cs	(revision 8276)
+++ /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior/3.3/Analyzers/GenealogyAnalyzer.cs	(revision 8277)
@@ -167,5 +167,5 @@
         GenealogyGraph<Permutation> graph;
         if (!Results.ContainsKey(PopulationGraphResultParameterName)) {
-          graph = new GenealogyGraph<Permutation>();
+          graph = new GenealogyGraph<Permutation>(new PermutationEqualityComparer());
           Results.Add(new Result(PopulationGraphResultParameterName, PopulationGraphResultParameterDescription, graph));
         } else {
Index: /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior/3.3/GenealogyGraph.cs
===================================================================
--- /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior/3.3/GenealogyGraph.cs	(revision 8276)
+++ /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior/3.3/GenealogyGraph.cs	(revision 8277)
@@ -36,4 +36,9 @@
       _nodes = new Dictionary<T, GenealogyGraphNode>();
     }
+
+    public GenealogyGraph(EqualityComparer<T> comp) {
+      _nodes = new Dictionary<T, GenealogyGraphNode>(comp);
+    }
+
 
     public GenealogyGraph(GenealogyGraph<T> g) {
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 8276)
+++ /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior/3.3/HeuristicLab.Analysis.AlgorithmBehavior-3.3.csproj	(revision 8277)
@@ -102,4 +102,5 @@
     <Compile Include="Analyzers\AlleleOccurencesInGenerationsAnalyzer.cs" />
     <Compile Include="Analyzers\ConvergenceSpeedAnalyzer.cs" />
+    <Compile Include="Analyzers\DistinctSolutionsAnalyzer.cs" />
     <Compile Include="Creators\BestIndividualSchemataCreator.cs" />
     <Compile Include="Analyzers\BestIndividualQualityAnalyzer.cs" />
