Index: branches/DataAnalysis.PopulationDiversityAnalysis/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/FineGrainedStructuralPopulationDiversityAnalyzer.cs
===================================================================
--- branches/DataAnalysis.PopulationDiversityAnalysis/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/FineGrainedStructuralPopulationDiversityAnalyzer.cs	(revision 4942)
+++ branches/DataAnalysis.PopulationDiversityAnalysis/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/FineGrainedStructuralPopulationDiversityAnalyzer.cs	(revision 4948)
@@ -46,8 +46,18 @@
     // properties: min level delts, max level delta, etc.
 
+    #region Properties and Parameters
+
     private const string FunctionTreeGrammarParameterName = "FunctionTreeGrammar";
     private const string MinimumLevelDeltaParameterName = "MinimumLevelDelta";
     private const string MaximumLevelDeltaParameterName = "MaximumLevelDelta";
     private const string PreventMultipleComparisonContributionParameterName = "PreventMultipleComparisonContribution";
+    private const string MaximumExpressionDepthParameterName = "MaxExpressionDepth";
+    private const string LevelDifferenceCoefficientParameterName = "LevelDifferenceCoefficient";
+    private const string AncestorIndexCoefficientParameterName = "AncestorIndexCoefficient";
+    private const string ConstantValueCoefficientParameterName = "ConstantValueCoefficient";
+    private const string VariableWeightCoefficientParameterName = "VariableWeightCoefficient";
+    private const string TimeOffsetCoefficientParameterName = "TimeOffsetCoefficient";
+    private const string VariableIndexCoefficientParameterName = "VariableIndexCoefficient";
+    private const string AdditiveSimilarityCalculationParameterName = "AdditiveSimilarityCalculation";
 
     public IValueLookupParameter<GlobalSymbolicExpressionGrammar> FunctionTreeGrammarParameter {
@@ -57,4 +67,10 @@
       get { return FunctionTreeGrammarParameter.ActualValue; }
     }
+    public IValueLookupParameter<IntValue> MaximumExpressionDepthParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumExpressionDepthParameterName]; }
+    }
+    public int MaximumExpressionDepth {
+      get { return MaximumExpressionDepthParameter.ActualValue.Value; }
+    }
 
     public IValueParameter<IntValue> MinimumLevelDeltaParameter {
@@ -76,4 +92,49 @@
       get { return PreventMultipleComparisonContributionParameter.Value.Value; }
     }
+
+    public IValueParameter<DoubleValue> LevelDifferenceCoefficientParameter {
+      get { return (IValueParameter<DoubleValue>)Parameters[LevelDifferenceCoefficientParameterName]; }
+    }
+    public double LevelDifferenceCoefficient {
+      get { return LevelDifferenceCoefficientParameter.Value.Value; }
+    }
+    public IValueParameter<DoubleValue> AncestorIndexCoefficientParameter {
+      get { return (IValueParameter<DoubleValue>)Parameters[AncestorIndexCoefficientParameterName]; }
+    }
+    public double AncestorIndexCoefficient {
+      get { return AncestorIndexCoefficientParameter.Value.Value; }
+    }
+    public IValueParameter<DoubleValue> ConstantValueCoefficientParameter {
+      get { return (IValueParameter<DoubleValue>)Parameters[ConstantValueCoefficientParameterName]; }
+    }
+    public double ConstantValueCoefficient {
+      get { return ConstantValueCoefficientParameter.Value.Value; }
+    }
+    public IValueParameter<DoubleValue> VariableWeightCoefficientParameter {
+      get { return (IValueParameter<DoubleValue>)Parameters[VariableWeightCoefficientParameterName]; }
+    }
+    public double VariableWeightCoefficient {
+      get { return VariableWeightCoefficientParameter.Value.Value; }
+    }
+    public IValueParameter<DoubleValue> TimeOffsetCoefficientParameter {
+      get { return (IValueParameter<DoubleValue>)Parameters[TimeOffsetCoefficientParameterName]; }
+    }
+    public double TimeOffsetCoefficientCoefficient {
+      get { return TimeOffsetCoefficientParameter.Value.Value; }
+    }
+    public IValueParameter<DoubleValue> VariableIndexCoefficientParameter {
+      get { return (IValueParameter<DoubleValue>)Parameters[VariableIndexCoefficientParameterName]; }
+    }
+    public double VariableIndexCoefficient {
+      get { return VariableIndexCoefficientParameter.Value.Value; }
+    }
+    public IValueParameter<BoolValue> AdditiveSimilarityCalculationParameter {
+      get { return (IValueParameter<BoolValue>)Parameters[AdditiveSimilarityCalculationParameterName]; }
+    }
+    public bool AdditiveSimilarityCalculation {
+      get { return AdditiveSimilarityCalculationParameter.Value.Value; }
+    }
+
+    #endregion
 
     [StorableConstructor]
@@ -82,7 +143,15 @@
     public FineGrainedStructuralPopulationDiversityAnalyzer() : base() {
       Parameters.Add(new ValueLookupParameter<GlobalSymbolicExpressionGrammar>(FunctionTreeGrammarParameterName, "The grammar that is used for symbolic regression models."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumExpressionDepthParameterName, "Maximal depth of the analyzed symbolic expressions."));
       Parameters.Add(new ValueParameter<IntValue>(MinimumLevelDeltaParameterName, "Minimum value for the level delta of the analyzed genetic information items.", new IntValue(0)));
       Parameters.Add(new ValueParameter<IntValue>(MaximumLevelDeltaParameterName, "Maximum value for the level delta of the analyzed genetic information items.", new IntValue(int.MaxValue)));
       Parameters.Add(new ValueParameter<BoolValue>(PreventMultipleComparisonContributionParameterName, "Flag that denotes whether genetic information items are hindered from contributing to the similarity function multiple times.", new BoolValue(false)));
+      Parameters.Add(new ValueParameter<DoubleValue>(LevelDifferenceCoefficientParameterName, "Weighting coefficient for level differences.", new DoubleValue(0.2)));
+      Parameters.Add(new ValueParameter<DoubleValue>(AncestorIndexCoefficientParameterName, "Weighting coefficient for ancestor index differences.", new DoubleValue(0.2)));
+      Parameters.Add(new ValueParameter<DoubleValue>(ConstantValueCoefficientParameterName, "Weighting coefficient for constant value differences.", new DoubleValue(0.2)));
+      Parameters.Add(new ValueParameter<DoubleValue>(VariableWeightCoefficientParameterName, "Weighting coefficient for variable weight differences.", new DoubleValue(0.2)));
+      Parameters.Add(new ValueParameter<DoubleValue>(TimeOffsetCoefficientParameterName, "Weighting coefficient for time lag differences.", new DoubleValue(0.2)));
+      Parameters.Add(new ValueParameter<DoubleValue>(VariableIndexCoefficientParameterName, "Weighting coefficient for variable index differences.", new DoubleValue(0.2)));
+      Parameters.Add(new ValueParameter<BoolValue>(AdditiveSimilarityCalculationParameterName, "Flag that denotes whether the similarity of genetic information items shall be calculated using additive calculation.", new BoolValue(true)));
     }
 
@@ -135,5 +204,8 @@
               GeneticInformationItem bestPendant = GeneticInformationItem.FindBestPendant(solution1GeneticItems[k], solution2GeneticItems,
                 constantMinimumValue, constantMaximumValue, variableWeightSigma,
-                /* TODO: */ 100, 10, 1, 1, 1, 1, 1, 1, true, out bestPendantSimilarity);
+                MaximumExpressionDepth, minimumTimeOffset, maximumTimeOffset,
+                LevelDifferenceCoefficient, AncestorIndexCoefficient, ConstantValueCoefficient, VariableWeightCoefficient,
+                TimeOffsetCoefficientCoefficient, VariableIndexCoefficient, AdditiveSimilarityCalculation,
+                out bestPendantSimilarity);
               if (bestPendant != null) {
                 similarity += bestPendantSimilarity;
@@ -210,5 +282,5 @@
       public static GeneticInformationItem FindBestPendant(GeneticInformationItem Item, IList<GeneticInformationItem> ComparisonItems,
           double ConstantMinimum, double ConstantMaximum, double VariableWeightSigma,
-          int MaximumTreeHeight, int MaximumTimeOffset,
+          int MaximumTreeHeight, int MinimumTimeOffset, int MaximumTimeOffset,
           double LevelDifferenceCoefficient, double AncestorIndexCoefficient,
           double ConstantValueCoefficient, double VariableWeightCoefficient, double TimeOffsetCoefficient, double VariableIndexCoefficient,
@@ -218,5 +290,5 @@
         double similarity, maxSimilarity = -double.MaxValue;
         for (int i = 0; i < ComparisonItems.Count; i++) {
-          similarity = Similarity(Item, ComparisonItems[i], ConstantMinimum, ConstantMaximum, VariableWeightSigma, MaximumTreeHeight, MaximumTimeOffset,
+          similarity = Similarity(Item, ComparisonItems[i], ConstantMinimum, ConstantMaximum, VariableWeightSigma, MaximumTreeHeight, MinimumTimeOffset, MaximumTimeOffset,
             LevelDifferenceCoefficient, AncestorIndexCoefficient, ConstantValueCoefficient, VariableWeightSigma, TimeOffsetCoefficient,
             VariableWeightCoefficient, AdditiveSimilarityCalculation);
@@ -235,5 +307,5 @@
       public static double Similarity(GeneticInformationItem Item1, GeneticInformationItem Item2,
           double ConstantMinimum, double ConstantMaximum, double VariableWeightSigma,
-          int MaximumTreeHeight, int MaximumTimeOffset,
+          int MaximumTreeHeight, int MinimumTimeOffset, int MaximumTimeOffset,
           double LevelDifferenceCoefficient, double AncestorIndexCoefficient,
           double ConstantValueCoefficient, double VariableWeightCoefficient, double TimeOffsetCoefficient, double VariableIndexCoefficient,
@@ -307,5 +379,5 @@
             double timeOffsetDifference = Math.Abs(Item1.DescendantTimeOffset - Item2.DescendantTimeOffset);
             if (MaximumTimeOffset > 0)
-              descendantTimeOffsetDifferencePunishment = timeOffsetDifference / MaximumTimeOffset;
+              descendantTimeOffsetDifferencePunishment = timeOffsetDifference / (MaximumTimeOffset - MinimumTimeOffset);
             descendantTimeOffsetDifferencePunishment *= TimeOffsetCoefficient;
             punishmentContributionSum += TimeOffsetCoefficient;
