Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Analyzers/GenealogyAnalyzer.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Analyzers/GenealogyAnalyzer.cs	(revision 11277)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Analyzers/GenealogyAnalyzer.cs	(revision 11278)
@@ -333,7 +333,11 @@
     }
 
+    // this method works when called before the unsuccesful offspring are removed from the genealogy graph
+    // so it must always be called before RemoveUnsuccessfulOffspring()
     private void ComputeSuccessRatios() {
-      const string successfulOffspringRatioTableHistoryName = "Successful offspring ratio";
-      const string successfulOffspringRatioHeatMapName = "Successful offspring ratio heatmap";
+      const string successfulOffspringRatioTableHistoryName = "Successful offspring ratios history";
+      const string successfulOffspringAbsoluteValuesTableHistoryName = "Successful offspring values history";
+      const string successfulOffspringRatioHeatMapName = "Successful offspring ratios heatmap";
+      const string successfulOffspringValuesHeatMapName = "Successful offspring values heatmap";
 
       var population = PopulationParameter.ActualValue;
@@ -345,39 +349,67 @@
           p.Weight++;
       }
-      foreach (var v in GenealogyGraph.Ranks[generation - 1]) {
-        if (v.OutDegree > 0)
-          v.Weight /= v.OutDegree;
-      }
 
       var results = ResultsParameter.ActualValue;
 
-      DataTableHistory history;
+      DataTableHistory successfulOffspringRatioHistory;
+      DataTableHistory successfulOffspringAbsoluteHistory;
       if (!results.ContainsKey(successfulOffspringRatioTableHistoryName)) {
-        history = new DataTableHistory();
-        results.Add(new Result(successfulOffspringRatioTableHistoryName, history));
+        successfulOffspringRatioHistory = new DataTableHistory();
+        successfulOffspringAbsoluteHistory = new DataTableHistory();
+        results.Add(new Result(successfulOffspringRatioTableHistoryName, successfulOffspringRatioHistory));
+        results.Add(new Result(successfulOffspringAbsoluteValuesTableHistoryName, successfulOffspringAbsoluteHistory));
       } else {
-        history = (DataTableHistory)results[successfulOffspringRatioTableHistoryName].Value;
-      }
-      var table = new DataTable();
-      var row = new DataRow("Successful Offspring") {
+        successfulOffspringRatioHistory = (DataTableHistory)results[successfulOffspringRatioTableHistoryName].Value;
+        successfulOffspringAbsoluteHistory = (DataTableHistory)results[successfulOffspringAbsoluteValuesTableHistoryName].Value;
+      }
+      var successfulOffspringRatioTable = new DataTable();
+      var successfulOffspringRatioRow = new DataRow("Successful Offspring Ratio") { VisualProperties = { ChartType = DataRowVisualProperties.DataRowChartType.Columns, StartIndexZero = true } };
+      successfulOffspringRatioRow.Values.Replace(GenealogyGraph.Ranks[generation - 1].OrderByDescending(x => x.Quality).Select(x => x.OutDegree > 0 ? x.Weight / x.OutDegree : 0));
+      successfulOffspringRatioTable.Rows.Add(successfulOffspringRatioRow);
+      successfulOffspringRatioHistory.Add(successfulOffspringRatioTable);
+      // create heatmap
+      double[,] ratios = new double[population.Length, successfulOffspringRatioHistory.Count];
+      var ratiosHistoryList = successfulOffspringRatioHistory.AsReadOnly().ToList();
+      for (int i = 0; i < ratiosHistoryList.Count; ++i) {
+        var values = ratiosHistoryList[i].Rows.First().Values;
+        for (int j = 0; j < values.Count; ++j) {
+          ratios[j, i] = values[j];
+        }
+      }
+      var successfulOffspringRatios = new HeatMap(ratios);
+      if (!results.ContainsKey(successfulOffspringRatioHeatMapName)) {
+        results.Add(new Result(successfulOffspringRatioHeatMapName, successfulOffspringRatios));
+      } else {
+        results[successfulOffspringRatioHeatMapName].Value = successfulOffspringRatios;
+      }
+
+      var successfulOffspringValuesTable = new DataTable();
+      var successfulOffspringValuesRow = new DataRow("Successful Offspring Ratio") {
         VisualProperties = { ChartType = DataRowVisualProperties.DataRowChartType.Columns, StartIndexZero = true }
       };
-      row.Values.Replace(GenealogyGraph.Ranks[generation - 1].OrderByDescending(x => x.Quality).Select(x => x.Weight));
-      table.Rows.Add(row);
-      history.Add(table);
-      double[,] elements = new double[population.Length, history.Count];
-      var col = history.AsReadOnly().ToList();
-      for (int i = 0; i < col.Count; ++i) {
-        var values = col[i].Rows.First().Values;
+      successfulOffspringValuesRow.Values.Replace(GenealogyGraph.Ranks[generation - 1].OrderByDescending(x => x.Quality).Select(x => x.Weight));
+      successfulOffspringValuesTable.Rows.Add(successfulOffspringValuesRow);
+      successfulOffspringAbsoluteHistory.Add(successfulOffspringValuesTable);
+      // create heatmap
+      double min = 0, max = 0;
+      double[,] elements = new double[population.Length, successfulOffspringAbsoluteHistory.Count];
+      var absoluteHistoryList = successfulOffspringAbsoluteHistory.AsReadOnly().ToList();
+      for (int i = 0; i < absoluteHistoryList.Count; ++i) {
+        var values = absoluteHistoryList[i].Rows.First().Values;
         for (int j = 0; j < values.Count; ++j) {
           elements[j, i] = values[j];
-        }
-      }
-
+          if (max < values[j])
+            max = values[j];
+          if (min > values[j])
+            min = values[j];
+        }
+      }
       var heatmap = new HeatMap(elements);
-      if (!results.ContainsKey(successfulOffspringRatioHeatMapName)) {
-        results.Add(new Result(successfulOffspringRatioHeatMapName, heatmap));
+      heatmap.Maximum = max;
+      heatmap.Minimum = min;
+      if (!results.ContainsKey(successfulOffspringValuesHeatMapName)) {
+        results.Add(new Result(successfulOffspringValuesHeatMapName, heatmap));
       } else {
-        results[successfulOffspringRatioHeatMapName].Value = heatmap;
+        results[successfulOffspringValuesHeatMapName].Value = heatmap;
       }
     }
