Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/BestSymbolicRegressionSolutionAnalyzer.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/BestSymbolicRegressionSolutionAnalyzer.cs	(revision 5198)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/BestSymbolicRegressionSolutionAnalyzer.cs	(revision 5246)
@@ -110,15 +110,15 @@
     }
 
-    public static void UpdateBestSolutionResults(SymbolicRegressionSolution bestSolution, DataAnalysisProblemData problemData, ResultCollection results, IntValue currentGeneration, DataTable variableFrequencies) {
-      RegressionSolutionAnalyzer.UpdateBestSolutionResults(bestSolution, problemData, results, currentGeneration);
-      UpdateSymbolicRegressionBestSolutionResults(bestSolution, problemData, results, variableFrequencies);
+    public static void UpdateBestSolutionResults(SymbolicRegressionSolution solution, DataAnalysisProblemData problemData, ResultCollection results, IntValue currentGeneration, DataTable variableFrequencies) {
+      RegressionSolutionAnalyzer.UpdateBestSolutionResults(solution, problemData, results, currentGeneration);
+      UpdateSymbolicRegressionBestSolutionResults(solution, problemData, results, variableFrequencies);
     }
 
-    private static void UpdateSymbolicRegressionBestSolutionResults(SymbolicRegressionSolution bestSolution, DataAnalysisProblemData problemData, ResultCollection results, DataTable variableFrequencies) {
+    private static void UpdateSymbolicRegressionBestSolutionResults(SymbolicRegressionSolution solution, DataAnalysisProblemData problemData, ResultCollection results, DataTable variableFrequencies) {
       if (results.ContainsKey(BestSolutionInputvariableCountResultName)) {
-        results[BestSolutionInputvariableCountResultName].Value = new IntValue(bestSolution.Model.InputVariables.Count());
+        results[BestSolutionInputvariableCountResultName].Value = new IntValue(solution.Model.InputVariables.Count());
         results[VariableImpactsResultName].Value = CalculateVariableImpacts(variableFrequencies);
       } else {
-        results.Add(new Result(BestSolutionInputvariableCountResultName, new IntValue(bestSolution.Model.InputVariables.Count())));
+        results.Add(new Result(BestSolutionInputvariableCountResultName, new IntValue(solution.Model.InputVariables.Count())));
         results.Add(new Result(VariableImpactsResultName, CalculateVariableImpacts(variableFrequencies)));
       }
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/FixedValidationBestScaledSymbolicRegressionSolutionAnalyzer.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/FixedValidationBestScaledSymbolicRegressionSolutionAnalyzer.cs	(revision 5198)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/FixedValidationBestScaledSymbolicRegressionSolutionAnalyzer.cs	(revision 5246)
@@ -41,6 +41,9 @@
   public sealed class FixedValidationBestScaledSymbolicRegressionSolutionAnalyzer : SymbolicRegressionValidationAnalyzer, ISymbolicRegressionAnalyzer {
     private const string MaximizationParameterName = "Maximization";
+    private const string CalculateSolutionComplexityParameterName = "CalculateSolutionComplexity";
     private const string BestSolutionParameterName = "Best solution (validation)";
     private const string BestSolutionQualityParameterName = "Best solution quality (validation)";
+    private const string BestSolutionLengthParameterName = "Best solution length (validation)";
+    private const string BestSolutionHeightParameterName = "Best solution height (validiation)";
     private const string CurrentBestValidationQualityParameterName = "Current best validation quality";
     private const string BestSolutionQualityValuesParameterName = "Validation Quality";
@@ -54,4 +57,7 @@
       get { return (ILookupParameter<BoolValue>)Parameters[MaximizationParameterName]; }
     }
+    public IValueParameter<BoolValue> CalculateSolutionComplexityParameter {
+      get { return (IValueParameter<BoolValue>)Parameters[CalculateSolutionComplexityParameterName]; }
+    }
     public ILookupParameter<SymbolicRegressionSolution> BestSolutionParameter {
       get { return (ILookupParameter<SymbolicRegressionSolution>)Parameters[BestSolutionParameterName]; }
@@ -62,4 +68,10 @@
     public ILookupParameter<DoubleValue> BestSolutionQualityParameter {
       get { return (ILookupParameter<DoubleValue>)Parameters[BestSolutionQualityParameterName]; }
+    }
+    public ILookupParameter<IntValue> BestSolutionLengthParameter {
+      get { return (ILookupParameter<IntValue>)Parameters[BestSolutionLengthParameterName]; }
+    }
+    public ILookupParameter<IntValue> BestSolutionHeightParameter {
+      get { return (ILookupParameter<IntValue>)Parameters[BestSolutionHeightParameterName]; }
     }
     public ILookupParameter<ResultCollection> ResultsParameter {
@@ -78,4 +90,8 @@
       get { return MaximizationParameter.ActualValue; }
     }
+    public BoolValue CalculateSolutionComplexity {
+      get { return CalculateSolutionComplexityParameter.Value; }
+      set { CalculateSolutionComplexityParameter.Value = value; }
+    }
     public ResultCollection Results {
       get { return ResultsParameter.ActualValue; }
@@ -89,4 +105,12 @@
     public DoubleValue BestSolutionQuality {
       get { return BestSolutionQualityParameter.ActualValue; }
+    }
+    public IntValue BestSolutionLength {
+      get { return BestSolutionLengthParameter.ActualValue; }
+      set { BestSolutionLengthParameter.ActualValue = value; }
+    }
+    public IntValue BestSolutionHeight {
+      get { return BestSolutionHeightParameter.ActualValue; }
+      set { BestSolutionHeightParameter.ActualValue = value; }
     }
 
@@ -99,7 +123,10 @@
       : base() {
       Parameters.Add(new LookupParameter<BoolValue>(MaximizationParameterName, "The direction of optimization."));
+      Parameters.Add(new ValueParameter<BoolValue>(CalculateSolutionComplexityParameterName, "Determines if the length and height of the validation best solution should be calculated.", new BoolValue(false)));
       Parameters.Add(new LookupParameter<SymbolicRegressionSolution>(BestSolutionParameterName, "The best symbolic regression solution."));
       Parameters.Add(new LookupParameter<IntValue>(GenerationsParameterName, "The number of generations calculated so far."));
       Parameters.Add(new LookupParameter<DoubleValue>(BestSolutionQualityParameterName, "The quality of the best symbolic regression solution."));
+      Parameters.Add(new LookupParameter<IntValue>(BestSolutionLengthParameterName, "The length of the best symbolic regression solution."));
+      Parameters.Add(new LookupParameter<IntValue>(BestSolutionHeightParameterName, "The height of the best symbolic regression solution."));
       Parameters.Add(new LookupParameter<ResultCollection>(ResultsParameterName, "The result collection where the best symbolic regression solution should be stored."));
       Parameters.Add(new LookupParameter<DoubleValue>(BestKnownQualityParameterName, "The best known (validation) quality achieved on the data set."));
@@ -120,12 +147,21 @@
         Parameters.Add(new LookupParameter<BoolValue>(MaximizationParameterName, "The direction of optimization."));
       }
+      if (!Parameters.ContainsKey(CalculateSolutionComplexityParameterName)) {
+        Parameters.Add(new ValueParameter<BoolValue>(CalculateSolutionComplexityParameterName, "Determines if the length and height of the validation best solution should be calculated.", new BoolValue(false)));
+      }
+      if (!Parameters.ContainsKey(BestSolutionLengthParameterName)) {
+        Parameters.Add(new LookupParameter<IntValue>(BestSolutionLengthParameterName, "The length of the best symbolic regression solution."));
+      }
+      if (!Parameters.ContainsKey(BestSolutionHeightParameterName)) {
+        Parameters.Add(new LookupParameter<IntValue>(BestSolutionHeightParameterName, "The height of the best symbolic regression solution."));
+      }
       #endregion
     }
-    
+
     protected override void Analyze(SymbolicExpressionTree[] trees, double[] validationQuality) {
       double bestQuality = Maximization.Value ? double.NegativeInfinity : double.PositiveInfinity;
       SymbolicExpressionTree bestTree = null;
 
-      for(int i=0;i<trees.Length;i++) {
+      for (int i = 0; i < trees.Length; i++) {
         double quality = validationQuality[i];
         if ((Maximization.Value && quality > bestQuality) ||
@@ -164,7 +200,17 @@
         BestSolutionQualityParameter.ActualValue = new DoubleValue(bestQuality);
 
+        if (CalculateSolutionComplexity.Value) {
+          BestSolutionLength = new IntValue(solution.Model.SymbolicExpressionTree.Size);
+          BestSolutionHeight = new IntValue(solution.Model.SymbolicExpressionTree.Height);
+          if (!Results.ContainsKey(BestSolutionLengthParameterName)) {
+            Results.Add(new Result(BestSolutionLengthParameterName, "Length of the best solution on the validation set", new IntValue()));
+            Results.Add(new Result(BestSolutionHeightParameterName, "Height of the best solution on the validation set", new IntValue()));
+          }
+          Results[BestSolutionLengthParameterName].Value = BestSolutionLength;
+          Results[BestSolutionHeightParameterName].Value = BestSolutionHeight;
+        }
+
         BestSymbolicRegressionSolutionAnalyzer.UpdateBestSolutionResults(solution, ProblemData, Results, Generations, VariableFrequencies);
       }
-
 
       if (!Results.ContainsKey(BestSolutionQualityValuesParameterName)) {
