Index: trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/AccuracyEvaluator.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/AccuracyEvaluator.cs	(revision 1890)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/AccuracyEvaluator.cs	(revision 1891)
@@ -43,5 +43,5 @@
     }
 
-    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, IFunctionTree tree, Dataset dataset, int targetVariable, double[] classes, double[] thresholds, int start, int end) {
+    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, Dataset dataset, int targetVariable, double[] classes, double[] thresholds, int start, int end) {
       DoubleData accuracy = GetVariableValue<DoubleData>("Accuracy", scope, false, false);
       if (accuracy == null) {
@@ -53,5 +53,5 @@
       int nCorrect = 0;
       for (int sample = start; sample < end; sample++) {
-        double est = evaluator.Evaluate(tree, sample);
+        double est = evaluator.Evaluate(sample);
         double origClass = dataset.GetValue(sample, targetVariable);
         double estClass = double.NaN;
Index: trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/ClassificationMeanSquaredErrorEvaluator.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/ClassificationMeanSquaredErrorEvaluator.cs	(revision 1890)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/ClassificationMeanSquaredErrorEvaluator.cs	(revision 1891)
@@ -43,8 +43,8 @@
     }
 
-    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, IFunctionTree tree, HeuristicLab.DataAnalysis.Dataset dataset, int targetVariable, double[] classes, double[] thresholds, int start, int end) {
+    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, HeuristicLab.DataAnalysis.Dataset dataset, int targetVariable, double[] classes, double[] thresholds, int start, int end) {
       double errorsSquaredSum = 0;
       for (int sample = start; sample < end; sample++) {
-        double estimated = evaluator.Evaluate(tree, sample);
+        double estimated = evaluator.Evaluate(sample);
         double original = dataset.GetValue(sample, targetVariable);
         if (!double.IsNaN(original) && !double.IsInfinity(original)) {
Index: trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/ConfusionMatrixEvaluator.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/ConfusionMatrixEvaluator.cs	(revision 1890)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/ConfusionMatrixEvaluator.cs	(revision 1891)
@@ -41,5 +41,5 @@
     }
 
-    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, IFunctionTree tree, HeuristicLab.DataAnalysis.Dataset dataset, int targetVariable, double[] classes, double[] thresholds, int start, int end) {
+    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, HeuristicLab.DataAnalysis.Dataset dataset, int targetVariable, double[] classes, double[] thresholds, int start, int end) {
       IntMatrixData matrix = GetVariableValue<IntMatrixData>("ConfusionMatrix", scope, false, false);
       if (matrix == null) {
@@ -50,5 +50,5 @@
       int nSamples = end - start;
       for (int sample = start; sample < end; sample++) {
-        double est = evaluator.Evaluate(tree, sample);
+        double est = evaluator.Evaluate(sample);
         double origClass = dataset.GetValue(sample, targetVariable);
         int estClassIndex = -1;
Index: trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/GPClassificationEvaluatorBase.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/GPClassificationEvaluatorBase.cs	(revision 1890)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/GPClassificationEvaluatorBase.cs	(revision 1891)
@@ -37,5 +37,5 @@
     }
 
-    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, IFunctionTree tree, Dataset dataset, int targetVariable, int start, int end, bool updateTargetValues) {
+    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, Dataset dataset, int targetVariable, int start, int end, bool updateTargetValues) {
 
       ItemList<DoubleData> classes = GetVariableValue<ItemList<DoubleData>>("TargetClassValues", scope, true);
@@ -48,8 +48,8 @@
       }
 
-      Evaluate(scope, evaluator, tree, dataset, targetVariable, classesArr, thresholds, start, end);
+      Evaluate(scope, evaluator, dataset, targetVariable, classesArr, thresholds, start, end);
     }
 
-    public abstract void Evaluate(IScope scope, ITreeEvaluator evaluator, IFunctionTree tree, Dataset dataset, int targetVariable, double[] classes, double[] thresholds, int start, int end);
+    public abstract void Evaluate(IScope scope, ITreeEvaluator evaluator, Dataset dataset, int targetVariable, double[] classes, double[] thresholds, int start, int end);
   }
 }
Index: trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/MulticlassOneVsOneAnalyzer.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/MulticlassOneVsOneAnalyzer.cs	(revision 1890)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/MulticlassOneVsOneAnalyzer.cs	(revision 1891)
@@ -86,7 +86,7 @@
         BakedTreeEvaluator evaluator = new BakedTreeEvaluator();
         evaluator.ResetEvaluator(dataset, targetVariable, trainingSamplesStart, trainingSamplesEnd, 1.0);
-
+        evaluator.PrepareForEvaluation(functionTree);
         for(int i = 0; i < (samplesEnd - samplesStart); i++) {
-          double est = evaluator.Evaluate(functionTree, i + samplesStart);
+          double est = evaluator.Evaluate(i + samplesStart);
           if(est < 0.5) {
             CastVote(votes, i, classAValue, classValues);
Index: trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/AveragePercentageChangeEvaluator.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/AveragePercentageChangeEvaluator.cs	(revision 1890)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/AveragePercentageChangeEvaluator.cs	(revision 1891)
@@ -42,5 +42,5 @@
     }
 
-    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, IFunctionTree tree, HeuristicLab.DataAnalysis.Dataset dataset, int targetVariable, int start, int end, bool updateTargetValues) {
+    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, HeuristicLab.DataAnalysis.Dataset dataset, int targetVariable, int start, int end, bool updateTargetValues) {
       bool differential = GetVariableValue<BoolData>("Differential", scope, true).Data;
       DoubleData apc = GetVariableValue<DoubleData>("APC", scope, false, false);
@@ -58,5 +58,5 @@
           prevOriginal = dataset.GetValue(sample - 1, targetVariable);
           originalPercentageChange = (dataset.GetValue(sample, targetVariable) - prevOriginal) / prevOriginal;
-          estimatedPercentageChange = (evaluator.Evaluate(tree, sample) - prevOriginal) / prevOriginal;
+          estimatedPercentageChange = (evaluator.Evaluate(sample) - prevOriginal) / prevOriginal;
           if (updateTargetValues) {
             dataset.SetValue(sample, targetVariable, estimatedPercentageChange * prevOriginal + prevOriginal);
@@ -64,5 +64,5 @@
         } else {
           originalPercentageChange = dataset.GetValue(sample, targetVariable);
-          estimatedPercentageChange = evaluator.Evaluate(tree, sample);
+          estimatedPercentageChange = evaluator.Evaluate(sample);
           if (updateTargetValues) {
             dataset.SetValue(sample, targetVariable, estimatedPercentageChange);
Index: trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/ProfitEvaluator.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/ProfitEvaluator.cs	(revision 1890)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/ProfitEvaluator.cs	(revision 1891)
@@ -43,5 +43,5 @@
     }
 
-    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, IFunctionTree tree, HeuristicLab.DataAnalysis.Dataset dataset, int targetVariable, int start, int end, bool updateTargetValues) {
+    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, HeuristicLab.DataAnalysis.Dataset dataset, int targetVariable, int start, int end, bool updateTargetValues) {
       int exchangeRateVarIndex = GetVariableValue<IntData>("ExchangeRate", scope, true).Data;
       double transactionCost = GetVariableValue<DoubleData>("TransactionCost", scope, true).Data;
@@ -58,5 +58,5 @@
         exchangeRate = dataset.GetValue(sample, exchangeRateVarIndex);
         double originalPercentageChange = dataset.GetValue(sample, targetVariable);
-        double estimatedPercentageChange = evaluator.Evaluate(tree, sample);
+        double estimatedPercentageChange = evaluator.Evaluate(sample);
         if (updateTargetValues) {
           dataset.SetValue(sample, targetVariable, estimatedPercentageChange);
Index: trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/TheilInequalityCoefficientEvaluator.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/TheilInequalityCoefficientEvaluator.cs	(revision 1890)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/TheilInequalityCoefficientEvaluator.cs	(revision 1891)
@@ -54,5 +54,5 @@
     }
 
-    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, IFunctionTree tree, Dataset dataset, int targetVariable, int start, int end, bool updateTargetValues) {
+    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, Dataset dataset, int targetVariable, int start, int end, bool updateTargetValues) {
       #region create result variables
       DoubleData theilInequaliy = GetVariableValue<DoubleData>("TheilInequalityCoefficient", scope, false, false);
@@ -85,5 +85,5 @@
       for (int sample = start; sample < end; sample++) {
         double prevValue = dataset.GetValue(sample - 1, targetVariable);
-        double estimatedChange = evaluator.Evaluate(tree, sample) - prevValue;
+        double estimatedChange = evaluator.Evaluate(sample) - prevValue;
         double originalChange = dataset.GetValue(sample, targetVariable) - prevValue;
         if (updateTargetValues) {
Index: trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/CoefficientOfDeterminationEvaluator.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/CoefficientOfDeterminationEvaluator.cs	(revision 1890)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/CoefficientOfDeterminationEvaluator.cs	(revision 1891)
@@ -42,5 +42,5 @@
     }
 
-    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, IFunctionTree tree, HeuristicLab.DataAnalysis.Dataset dataset, int targetVariable, int start, int end, bool updateTargetValues) {
+    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, HeuristicLab.DataAnalysis.Dataset dataset, int targetVariable, int start, int end, bool updateTargetValues) {
       double errorsSquaredSum = 0.0;
       double originalDeviationTotalSumOfSquares = 0.0;
@@ -50,5 +50,5 @@
       int n = 0;
       for (int sample = start; sample < end; sample++) {
-        double estimated = evaluator.Evaluate(tree, sample);
+        double estimated = evaluator.Evaluate(sample);
         double original = dataset.GetValue(sample, targetVariable);
         if (updateTargetValues) {
Index: trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/EarlyStoppingMeanSquaredErrorEvaluator.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/EarlyStoppingMeanSquaredErrorEvaluator.cs	(revision 1890)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/EarlyStoppingMeanSquaredErrorEvaluator.cs	(revision 1891)
@@ -44,5 +44,5 @@
 
     // evaluates the function-tree for the given target-variable and the whole dataset and returns the MSE
-    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, IFunctionTree tree, HeuristicLab.DataAnalysis.Dataset dataset, int targetVariable, int start, int end, bool updateTargetValues) {
+    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, HeuristicLab.DataAnalysis.Dataset dataset, int targetVariable, int start, int end, bool updateTargetValues) {
       double qualityLimit = GetVariableValue<DoubleData>("QualityLimit", scope, false).Data;
       DoubleData mse = GetVariableValue<DoubleData>("MSE", scope, false, false);
@@ -56,5 +56,5 @@
       int n = 0;
       for (int sample = start; sample < end; sample++) {
-        double estimated = evaluator.Evaluate(tree, sample);
+        double estimated = evaluator.Evaluate(sample);
         double original = dataset.GetValue(sample, targetVariable);
         if (updateTargetValues) {
Index: trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/GPEvaluatorBase.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/GPEvaluatorBase.cs	(revision 1890)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/GPEvaluatorBase.cs	(revision 1891)
@@ -57,4 +57,5 @@
       bool useEstimatedValues = GetVariableValue<BoolData>("UseEstimatedTargetValue", scope, true).Data;
       ITreeEvaluator evaluator = GetVariableValue<ITreeEvaluator>("TreeEvaluator", scope, true);
+      evaluator.PrepareForEvaluation(functionTree);
 
       double[] backupValues = null;
@@ -68,5 +69,5 @@
       }
 
-      Evaluate(scope, evaluator, functionTree, dataset, targetVariable, start, end, useEstimatedValues);
+      Evaluate(scope, evaluator, dataset, targetVariable, start, end, useEstimatedValues);
 
       // restore the values of the target variable from the backup array if necessary
@@ -82,5 +83,5 @@
     }
 
-    public abstract void Evaluate(IScope scope, ITreeEvaluator evaluator, IFunctionTree tree, Dataset dataset, int targetVariable, int start, int end, bool updateTargetValues);
+    public abstract void Evaluate(IScope scope, ITreeEvaluator evaluator, Dataset dataset, int targetVariable, int start, int end, bool updateTargetValues);
   }
 }
Index: trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/MeanAbsolutePercentageErrorEvaluator.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/MeanAbsolutePercentageErrorEvaluator.cs	(revision 1890)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/MeanAbsolutePercentageErrorEvaluator.cs	(revision 1891)
@@ -43,9 +43,9 @@
     }
 
-    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, IFunctionTree tree, Dataset dataset, int targetVariable, int start, int end, bool updateTargetValues) {
+    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, Dataset dataset, int targetVariable, int start, int end, bool updateTargetValues) {
       double errorsSum = 0.0;
       int n = 0;
       for (int sample = start; sample < end; sample++) {
-        double estimated = evaluator.Evaluate(tree, sample);
+        double estimated = evaluator.Evaluate(sample);
         double original = dataset.GetValue(sample, targetVariable);
 
Index: trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/MeanAbsolutePercentageOfRangeErrorEvaluator.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/MeanAbsolutePercentageOfRangeErrorEvaluator.cs	(revision 1890)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/MeanAbsolutePercentageOfRangeErrorEvaluator.cs	(revision 1891)
@@ -43,10 +43,10 @@
     }
 
-    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, IFunctionTree tree, Dataset dataset, int targetVariable, int start, int end, bool updateTargetValues) {
+    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, Dataset dataset, int targetVariable, int start, int end, bool updateTargetValues) {
       double errorsSum = 0.0;
       int n = 0;
       double range = dataset.GetRange(targetVariable, start, end);
       for (int sample = start; sample < end; sample++) {
-        double estimated = evaluator.Evaluate(tree, sample);
+        double estimated = evaluator.Evaluate(sample);
         double original = dataset.GetValue(sample, targetVariable);
 
Index: trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/MeanSquaredErrorEvaluator.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/MeanSquaredErrorEvaluator.cs	(revision 1890)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/MeanSquaredErrorEvaluator.cs	(revision 1891)
@@ -43,10 +43,10 @@
     }
 
-    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, IFunctionTree tree, Dataset dataset, int targetVariable, int start, int end, bool updateTargetValues) {
+    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, Dataset dataset, int targetVariable, int start, int end, bool updateTargetValues) {
       double errorsSquaredSum = 0;
       int n = 0;
       for (int sample = start; sample < end; sample++) {
         double original = dataset.GetValue(sample, targetVariable);
-        double estimated = evaluator.Evaluate(tree, sample);
+        double estimated = evaluator.Evaluate(sample);
         if (updateTargetValues) {
           dataset.SetValue(sample, targetVariable, estimated);
Index: trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/SimpleEvaluator.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/SimpleEvaluator.cs	(revision 1890)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/SimpleEvaluator.cs	(revision 1891)
@@ -36,5 +36,5 @@
     }
 
-    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, IFunctionTree tree, Dataset dataset, int targetVariable, int start, int end, bool updateTargetValues) {
+    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, Dataset dataset, int targetVariable, int start, int end, bool updateTargetValues) {
       ItemList values = GetVariableValue<ItemList>("Values", scope, false, false);
       if (values == null) {
@@ -50,5 +50,5 @@
       for (int sample = start; sample < end; sample++) {
         ItemList row = new ItemList();
-        double estimated = evaluator.Evaluate(tree, sample);
+        double estimated = evaluator.Evaluate(sample);
         double original = dataset.GetValue(sample, targetVariable);
         if (updateTargetValues) {
Index: trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/UncertainMeanSquaredErrorEvaluator.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/UncertainMeanSquaredErrorEvaluator.cs	(revision 1890)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/UncertainMeanSquaredErrorEvaluator.cs	(revision 1891)
@@ -50,5 +50,5 @@
 
     // evaluates the function-tree for the given target-variable and the whole dataset and returns the MSE
-    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, IFunctionTree tree, HeuristicLab.DataAnalysis.Dataset dataset, int targetVariable, int start, int end, bool updateTargetValues) {
+    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, HeuristicLab.DataAnalysis.Dataset dataset, int targetVariable, int start, int end, bool updateTargetValues) {
       double qualityLimit = GetVariableValue<DoubleData>("QualityLimit", scope, false).Data;
       int minSamples = GetVariableValue<IntData>("MinEvaluatedSamples", scope, true).Data;
@@ -78,5 +78,5 @@
       int n = 0;
       for (int sample = 0; sample < rows; sample++) {
-        double estimated = evaluator.Evaluate(tree, indexes[sample]);
+        double estimated = evaluator.Evaluate(indexes[sample]);
         double original = dataset.GetValue(indexes[sample], targetVariable);
         if (!double.IsNaN(original) && !double.IsInfinity(original)) {
Index: trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/VarianceAccountedForEvaluator.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/VarianceAccountedForEvaluator.cs	(revision 1890)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/VarianceAccountedForEvaluator.cs	(revision 1891)
@@ -53,10 +53,10 @@
     }
 
-    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, IFunctionTree tree, Dataset dataset, int targetVariable, int start, int end, bool updateTargetValues) {
+    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, Dataset dataset, int targetVariable, int start, int end, bool updateTargetValues) {
       int nSamples = end - start;
       double[] errors = new double[nSamples];
       double[] originalTargetVariableValues = new double[nSamples];
       for (int sample = start; sample < end; sample++) {
-        double estimated = evaluator.Evaluate(tree, sample);
+        double estimated = evaluator.Evaluate(sample);
         double original = dataset.GetValue(sample, targetVariable);
         if (updateTargetValues) {
Index: trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/ITreeEvaluator.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/ITreeEvaluator.cs	(revision 1890)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/ITreeEvaluator.cs	(revision 1891)
@@ -32,5 +32,6 @@
   public interface ITreeEvaluator : IItem {
     void ResetEvaluator(Dataset dataset, int targetVariable, int start, int end, double punishmentFactor);
-    double Evaluate(IFunctionTree functionTree, int sampleIndex);
+    void PrepareForEvaluation(IFunctionTree functionTree);
+    double Evaluate(int sampleIndex);
   }
 }
Index: trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/TreeEvaluatorBase.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/TreeEvaluatorBase.cs	(revision 1890)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/TreeEvaluatorBase.cs	(revision 1891)
@@ -62,4 +62,16 @@
     }
 
+    public void PrepareForEvaluation(IFunctionTree functionTree) {
+      BakedFunctionTree bakedTree = functionTree as BakedFunctionTree;
+      if (bakedTree == null) throw new ArgumentException("TreeEvaluators can only evaluate BakedFunctionTrees");
+
+      List<LightWeightFunction> linearRepresentation = bakedTree.LinearRepresentation;
+      codeArr = new Instr[linearRepresentation.Count];
+      int i = 0;
+      foreach (LightWeightFunction f in linearRepresentation) {
+        codeArr[i++] = TranslateToInstr(f);
+      }
+    }
+
     private Instr TranslateToInstr(LightWeightFunction f) {
       Instr instr = new Instr();
@@ -86,15 +98,5 @@
     }
 
-    public double Evaluate(IFunctionTree functionTree, int sampleIndex) {
-      BakedFunctionTree bakedTree = functionTree as BakedFunctionTree;
-      if (bakedTree == null) throw new ArgumentException("TreeEvaluators can only evaluate BakedFunctionTrees");
-
-      List<LightWeightFunction> linearRepresentation = bakedTree.LinearRepresentation;
-      codeArr = new Instr[linearRepresentation.Count];
-      int i = 0;
-      foreach (LightWeightFunction f in linearRepresentation) {
-        codeArr[i++] = TranslateToInstr(f);
-      }
-
+    public double Evaluate(int sampleIndex) {
       PC = 0;
       this.sampleIndex = sampleIndex;
