Index: trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/AveragePercentageChangeEvaluator.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/AveragePercentageChangeEvaluator.cs	(revision 695)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/AveragePercentageChangeEvaluator.cs	(revision 702)
@@ -30,6 +30,4 @@
 namespace HeuristicLab.GP.StructureIdentification.TimeSeries {
   public class AvergePercentageChangeEvaluator : GPEvaluatorBase {
-    protected DoubleData apc;
-    private bool differential;
     public override string Description {
       get {
@@ -44,7 +42,7 @@
     }
 
-    public override IOperation Apply(IScope scope) {
-      differential = GetVariableValue<BoolData>("Differential", scope, true).Data;
-      apc = GetVariableValue<DoubleData>("APC", scope, false, false);
+    public override void Evaluate(IScope scope, BakedTreeEvaluator 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);
       if(apc == null) {
         apc = new DoubleData();
@@ -52,8 +50,4 @@
       }
 
-      return base.Apply(scope);
-    }
-
-    public override void Evaluate(int start, int end) {
       double percentageSum = 0;
       for(int sample = start; sample < end; sample++) {
@@ -62,12 +56,16 @@
         double estimatedPercentageChange;
         if(differential) {
-          prevOriginal = GetOriginalValue(sample - 1);
-          originalPercentageChange = (GetOriginalValue(sample) - prevOriginal) / prevOriginal;
-          estimatedPercentageChange = (GetEstimatedValue(sample) - prevOriginal) / prevOriginal;
-          SetOriginalValue(sample, estimatedPercentageChange*prevOriginal + prevOriginal);
+          prevOriginal = dataset.GetValue(targetVariable,sample - 1);
+          originalPercentageChange = (dataset.GetValue(targetVariable,sample) - prevOriginal) / prevOriginal;
+          estimatedPercentageChange = (evaluator.Evaluate(sample) - prevOriginal) / prevOriginal;
+          if(updateTargetValues) {
+            dataset.SetValue(targetVariable, sample, estimatedPercentageChange * prevOriginal + prevOriginal);
+          }
         } else {
-          originalPercentageChange = GetOriginalValue(sample);
-          estimatedPercentageChange = GetEstimatedValue(sample);
-          SetOriginalValue(sample, estimatedPercentageChange);
+          originalPercentageChange = dataset.GetValue(targetVariable,sample);
+          estimatedPercentageChange = evaluator.Evaluate(sample);
+          if(updateTargetValues) {
+            dataset.SetValue(targetVariable, sample, estimatedPercentageChange);
+          }
         }
         if(!double.IsNaN(originalPercentageChange) && !double.IsInfinity(originalPercentageChange)) {
Index: trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/ProfitEvaluator.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/ProfitEvaluator.cs	(revision 695)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/ProfitEvaluator.cs	(revision 702)
@@ -30,7 +30,4 @@
 namespace HeuristicLab.GP.StructureIdentification.TimeSeries {
   public class ProfitEvaluator : GPEvaluatorBase {
-    protected DoubleData profit;
-    private int exchangeRateVarIndex;
-    private double transactionCost;
     public override string Description {
       get {
@@ -46,8 +43,8 @@
     }
 
-    public override IOperation Apply(IScope scope) {
-      exchangeRateVarIndex = GetVariableValue<IntData>("ExchangeRate", scope, true).Data;
-      transactionCost = GetVariableValue<DoubleData>("TransactionCost", scope, true).Data;
-      profit = GetVariableValue<DoubleData>("Profit", scope, false, false);
+    public override void Evaluate(IScope scope, BakedTreeEvaluator 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;
+      DoubleData profit = GetVariableValue<DoubleData>("Profit", scope, false, false);
       if(profit == null) {
         profit = new DoubleData();
@@ -55,8 +52,4 @@
       }
 
-      return base.Apply(scope);
-    }
-
-    public override void Evaluate(int start, int end) {
       double cA = 1.0; // start with a capital of one entity of A
       double cB = 0;
@@ -64,15 +57,17 @@
       for(int sample = start; sample < end; sample++) {
         exchangeRate = dataset.GetValue(sample, exchangeRateVarIndex);
-        double originalPercentageChange = GetOriginalValue(sample);
-        double estimatedPercentageChange = GetEstimatedValue(sample);
-        SetOriginalValue(sample, estimatedPercentageChange);
+        double originalPercentageChange = dataset.GetValue(targetVariable, sample);
+        double estimatedPercentageChange = evaluator.Evaluate(sample);
+        if(updateTargetValues) {
+          dataset.SetValue(targetVariable, sample, estimatedPercentageChange);
+        }
         if(!double.IsNaN(originalPercentageChange) && !double.IsInfinity(originalPercentageChange)) {
           if(estimatedPercentageChange > 0) {
             // prediction is the rate of B/A will increase (= get more B for one A) => exchange all B to A
-            cA += (cB / exchangeRate) * (1-transactionCost);
+            cA += (cB / exchangeRate) * (1 - transactionCost);
             cB = 0;
           } else if(estimatedPercentageChange < 0) {
             // prediction is the rate of B/A will drop (= get more A for one B) => exchange all A to B
-            cB += (cA * exchangeRate) * (1-transactionCost);
+            cB += (cA * exchangeRate) * (1 - transactionCost);
             cA = 0;
           }
@@ -86,5 +81,5 @@
       // at the end we must exchange all B back to A 
       // (because we want to buy the local beer not import one from B-country)
-      profit.Data = cA + ((cB / exchangeRate) * (1-transactionCost));
+      profit.Data = cA + ((cB / exchangeRate) * (1 - transactionCost));
       profit.Data -= 1.0; // substract the start capital to determine actual profit
     }
Index: trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/TheilInequalityCoefficientEvaluator.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/TheilInequalityCoefficientEvaluator.cs	(revision 695)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/TheilInequalityCoefficientEvaluator.cs	(revision 702)
@@ -31,9 +31,4 @@
 namespace HeuristicLab.GP.StructureIdentification.TimeSeries {
   public class TheilInequalityCoefficientEvaluator : GPEvaluatorBase {
-    private DoubleData theilInequaliy;
-    private DoubleData uBias;
-    private DoubleData uVariance;
-    private DoubleData uCovariance;
-
     public override string Description {
       get {
@@ -59,39 +54,40 @@
     }
 
-    public override IOperation Apply(IScope scope) {
-      theilInequaliy = GetVariableValue<DoubleData>("TheilInequalityCoefficient", scope, false, false);
+    public override void Evaluate(IScope scope, BakedTreeEvaluator evaluator, Dataset dataset, int targetVariable, int start, int end, bool updateTargetValues) {
+    #region create result variables
+      DoubleData theilInequaliy = GetVariableValue<DoubleData>("TheilInequalityCoefficient", scope, false, false);
       if(theilInequaliy == null) {
         theilInequaliy = new DoubleData();
         scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("TheilInequalityCoefficient"), theilInequaliy));
       }
-      uBias = GetVariableValue<DoubleData>("TheilInequalityCoefficientBias", scope, false, false);
+      DoubleData uBias = GetVariableValue<DoubleData>("TheilInequalityCoefficientBias", scope, false, false);
       if(uBias == null) {
         uBias = new DoubleData();
         scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("TheilInequalityCoefficientBias"), uBias));
       }
-      uVariance = GetVariableValue<DoubleData>("TheilInequalityCoefficientVariance", scope, false, false);
+      DoubleData uVariance = GetVariableValue<DoubleData>("TheilInequalityCoefficientVariance", scope, false, false);
       if(uVariance == null) {
         uVariance = new DoubleData();
         scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("TheilInequalityCoefficientVariance"), uVariance));
       }
-      uCovariance = GetVariableValue<DoubleData>("TheilInequalityCoefficientCovariance", scope, false, false);
+      DoubleData uCovariance = GetVariableValue<DoubleData>("TheilInequalityCoefficientCovariance", scope, false, false);
       if(uCovariance == null) {
         uCovariance = new DoubleData();
         scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("TheilInequalityCoefficientCovariance"), uCovariance));
       }
-      return base.Apply(scope);
-    }
+      #endregion
 
-    public override void Evaluate(int start, int end) {
       double errorsSquaredSum = 0.0;
       double originalSquaredSum = 0.0;
-      double[] estimatedChanges = new double[end-start];
-      double[] originalChanges = new double[end-start];
+      double[] estimatedChanges = new double[end - start];
+      double[] originalChanges = new double[end - start];
       int nSamples = 0;
       for(int sample = start; sample < end; sample++) {
-        double prevValue = GetOriginalValue(sample - 1);
-        double estimatedChange = GetEstimatedValue(sample) - prevValue;
-        double originalChange = GetOriginalValue(sample) - prevValue;
-        SetOriginalValue(sample, estimatedChange + prevValue);
+        double prevValue = dataset.GetValue(targetVariable, sample - 1);
+        double estimatedChange = evaluator.Evaluate(sample) - prevValue;
+        double originalChange = dataset.GetValue(targetVariable, sample) - prevValue;
+        if(updateTargetValues) {
+          dataset.SetValue(targetVariable, sample, estimatedChange + prevValue);
+        }
         if(!double.IsNaN(originalChange) && !double.IsInfinity(originalChange)) {
           double error = estimatedChange - originalChange;
@@ -118,5 +114,5 @@
 
       // all parts add up to one so I don't have to calculate the correlation coefficient for the covariance propotion
-      uCovariance.Data = 1.0 - uBias.Data - uVariance.Data; 
+      uCovariance.Data = 1.0 - uBias.Data - uVariance.Data;
     }
   }
