Index: /branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/Interfaces/IConditionActionModel.cs
===================================================================
--- /branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/Interfaces/IConditionActionModel.cs	(revision 9160)
+++ /branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/Interfaces/IConditionActionModel.cs	(revision 9161)
@@ -20,4 +20,5 @@
 #endregion
 
+using System.Collections.Generic;
 using HeuristicLab.Core;
 
@@ -27,4 +28,5 @@
 
     int ClassifierCount { get; }
+    IEnumerable<IClassifier> GetAction(IEnumerable<IClassifier> classifiers);
     IClassifier GetAction(IClassifier classifier);
   }
Index: /branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/Interfaces/IConditionActionProblemData.cs
===================================================================
--- /branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/Interfaces/IConditionActionProblemData.cs	(revision 9160)
+++ /branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/Interfaces/IConditionActionProblemData.cs	(revision 9161)
@@ -34,4 +34,14 @@
     IEnumerable<string> AllowedActionVariables { get; }
 
+    IntRange TrainingPartition { get; }
+    IntRange TestPartition { get; }
+
+    IEnumerable<int> TrainingIndices { get; }
+    IEnumerable<int> TestIndices { get; }
+
+    bool IsTrainingSample(int index);
+    bool IsTestSample(int index);
+
+    IEnumerable<IClassifier> FetchClassifier(IEnumerable<int> rows);
     IClassifier FetchClassifier(int rowNumber);
 
Index: /branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/Reinforcement/ClassifierFetcher.cs
===================================================================
--- /branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/Reinforcement/ClassifierFetcher.cs	(revision 9160)
+++ /branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/Reinforcement/ClassifierFetcher.cs	(revision 9161)
@@ -20,4 +20,5 @@
 #endregion
 
+using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -44,7 +45,8 @@
     #endregion
 
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new ClassifierFetcher(this, cloner);
+    private IConditionActionProblemData ProblemData {
+      get { return ProblemDataParameter.ActualValue; }
     }
+
     protected ClassifierFetcher(ClassifierFetcher original, Cloner cloner)
       : base(original, cloner) {
@@ -58,9 +60,13 @@
       Parameters.Add(new LookupParameter<IntValue>("Iteration"));
     }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ClassifierFetcher(this, cloner);
+    }
 
     public override IOperation Apply() {
-      Dataset dataset = ProblemDataParameter.ActualValue.Dataset;
-      int row = IterationParameter.ActualValue.Value % dataset.Rows;
-      CurrentClassifierToMatchParameter.ActualValue = ProblemDataParameter.ActualValue.FetchClassifier(row);
+      Dataset dataset = ProblemData.Dataset;
+      var trainingIndices = ProblemData.TrainingIndices.ToList();
+      int index = IterationParameter.ActualValue.Value % trainingIndices.Count;
+      CurrentClassifierToMatchParameter.ActualValue = ProblemDataParameter.ActualValue.FetchClassifier(trainingIndices[index]);
       return base.Apply();
     }
Index: /branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/XCSModel.cs
===================================================================
--- /branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/XCSModel.cs	(revision 9160)
+++ /branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/XCSModel.cs	(revision 9161)
@@ -49,4 +49,10 @@
       this.name = ItemName;
       this.description = ItemDescription;
+    }
+
+    public IEnumerable<IClassifier> GetAction(IEnumerable<IClassifier> classifiers) {
+      foreach (var classifier in classifiers) {
+        yield return GetAction(classifier);
+      }
     }
 
Index: /branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/XCSSolution.cs
===================================================================
--- /branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/XCSSolution.cs	(revision 9160)
+++ /branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/XCSSolution.cs	(revision 9161)
@@ -22,4 +22,5 @@
 using System;
 using System.Collections.Generic;
+using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -34,11 +35,16 @@
     private const string ModelResultName = "Model";
     private const string ProblemDataResultName = "ProblemData";
-    private const string AccuracyResultName = "Accuracy";
+    private const string TrainingAccuracyResultName = "Accuracy (training)";
+    private const string TestAccuracyResultName = "Accuracy (test)";
 
     public string Filename { get; set; }
 
-    public double Accuracy {
-      get { return ((DoubleValue)this[AccuracyResultName].Value).Value; }
-      private set { ((DoubleValue)this[AccuracyResultName].Value).Value = value; }
+    public double TrainingAccuracy {
+      get { return ((DoubleValue)this[TrainingAccuracyResultName].Value).Value; }
+      private set { ((DoubleValue)this[TrainingAccuracyResultName].Value).Value = value; }
+    }
+    public double TestAccuracy {
+      get { return ((DoubleValue)this[TestAccuracyResultName].Value).Value; }
+      private set { ((DoubleValue)this[TestAccuracyResultName].Value).Value = value; }
     }
 
@@ -86,5 +92,6 @@
       Add(new Result(ModelResultName, "The xcs model.", model));
       Add(new Result(ProblemDataResultName, "The condition-action problem data.", problemData));
-      Add(new Result(AccuracyResultName, "Accuracy of the model (percentage of correctly classified instances).", new PercentValue()));
+      Add(new Result(TrainingAccuracyResultName, "Accuracy of the model on the training partition (percentage of correctly classified instances).", new PercentValue()));
+      Add(new Result(TestAccuracyResultName, "Accuracy of the model on the test partition (percentage of correctly classified instances).", new PercentValue()));
 
       problemData.Changed += new EventHandler(ProblemData_Changed);
@@ -94,18 +101,19 @@
 
     private void RecalculateResults() {
-      var originalClassifiers = new List<IClassifier>();
-      for (int i = 0; i < ProblemData.Dataset.Rows; i++) {
-        originalClassifiers.Add(ProblemData.FetchClassifier(i));
-      }
-
-      var estimatedAction = new List<IClassifier>();
-      foreach (var original in originalClassifiers) {
-        estimatedAction.Add(Model.GetAction(original));
-      }
-
+      var originalTrainingClassifer = ProblemData.FetchClassifier(ProblemData.TrainingIndices);
+      var originalTestClassifer = ProblemData.FetchClassifier(ProblemData.TestIndices);
+      var estimatedTrainingClassifier = Model.GetAction(originalTrainingClassifer);
+      var estimatedTestClassifier = Model.GetAction(originalTestClassifer);
+
+      TrainingAccuracy = CalculateAccuracy(originalTrainingClassifer, estimatedTrainingClassifier);
+      TestAccuracy = CalculateAccuracy(originalTestClassifer, estimatedTestClassifier);
+    }
+
+    private double CalculateAccuracy(IEnumerable<IClassifier> original, IEnumerable<IClassifier> estimated) {
       double correctClassified = 0;
-      double rows = ProblemData.Dataset.Rows;
-      var originalEnumerator = originalClassifiers.GetEnumerator();
-      var estimatedActionEnumerator = estimatedAction.GetEnumerator();
+
+      double rows = original.Count();
+      var originalEnumerator = original.GetEnumerator();
+      var estimatedActionEnumerator = estimated.GetEnumerator();
 
       while (originalEnumerator.MoveNext() && estimatedActionEnumerator.MoveNext()) {
@@ -115,5 +123,5 @@
       }
 
-      Accuracy = correctClassified / rows;
+      return correctClassified / rows;
     }
 
Index: /branches/LearningClassifierSystems/HeuristicLab.Problems.ConditionActionClassification/3.3/Implementation/ConditionActionClassificationProblemData.cs
===================================================================
--- /branches/LearningClassifierSystems/HeuristicLab.Problems.ConditionActionClassification/3.3/Implementation/ConditionActionClassificationProblemData.cs	(revision 9160)
+++ /branches/LearningClassifierSystems/HeuristicLab.Problems.ConditionActionClassification/3.3/Implementation/ConditionActionClassificationProblemData.cs	(revision 9161)
@@ -64,18 +64,22 @@
       get { return (IFixedValueParameter<IntMatrix>)Parameters["Bounds"]; }
     }
+    public IFixedValueParameter<IntRange> TrainingPartitionParameter {
+      get { return (IFixedValueParameter<IntRange>)Parameters["TrainingPartition"]; }
+    }
+    public IFixedValueParameter<IntRange> TestPartitionParameter {
+      get { return (IFixedValueParameter<IntRange>)Parameters["TestPartition"]; }
+    }
     #endregion
 
+    #region properties
     public Dataset Dataset {
       get { return DatasetParameter.Value; }
     }
-
     public ICheckedItemList<StringValue> ConditionVariables {
       get { return ConditionVariablesParameter.Value; }
     }
-
     public ICheckedItemList<StringValue> ActionVariables {
       get { return ActionVariablesParameter.Value; }
     }
-
     public IEnumerable<string> AllowedConditionVariables {
       get { return ConditionVariables.CheckedItems.Select(x => x.Value.Value); }
@@ -84,4 +88,32 @@
       get { return ActionVariables.CheckedItems.Select(x => x.Value.Value); }
     }
+    public IntRange TrainingPartition {
+      get { return TrainingPartitionParameter.Value; }
+    }
+    public IntRange TestPartition {
+      get { return TestPartitionParameter.Value; }
+    }
+    public IEnumerable<int> TrainingIndices {
+      get {
+        return Enumerable.Range(TrainingPartition.Start, Math.Max(0, TrainingPartition.End - TrainingPartition.Start))
+                         .Where(IsTrainingSample);
+      }
+    }
+    public IEnumerable<int> TestIndices {
+      get {
+        return Enumerable.Range(TestPartition.Start, Math.Max(0, TestPartition.End - TestPartition.Start))
+           .Where(IsTestSample);
+      }
+    }
+    public bool IsTrainingSample(int index) {
+      return index >= 0 && index < Dataset.Rows &&
+        TrainingPartition.Start <= index && index < TrainingPartition.End &&
+        (index < TestPartition.Start || TestPartition.End <= index);
+    }
+    public bool IsTestSample(int index) {
+      return index >= 0 && index < Dataset.Rows &&
+             TestPartition.Start <= index && index < TestPartition.End;
+    }
+    #endregion
 
     private IDictionary<int, IClassifier> fetchClassifiersCache = new Dictionary<int, IClassifier>();
@@ -113,4 +145,9 @@
         conditionVariables.SetItemCheckedState(x, allowedConditionVariables.Contains(x.Value));
       }
+
+      int trainingPartitionStart = 0;
+      int trainingPartitionEnd = dataset.Rows / 2;
+      int testPartitionStart = dataset.Rows / 2;
+      int testPartitionEnd = dataset.Rows;
 
       Parameters.Add(new FixedValueParameter<Dataset>("Dataset", "", dataset));
@@ -120,4 +157,6 @@
       Parameters.Add(new FixedValueParameter<IntValue>("ActionLength", "", new IntValue(allowedActionVariables.Count())));
       Parameters.Add(new FixedValueParameter<IntMatrix>("Bounds", "", GetBoundsMatrix(dataset, allowedConditionVariables, allowedActionVariables)));
+      Parameters.Add(new FixedValueParameter<IntRange>("TrainingPartition", "", new IntRange(trainingPartitionStart, trainingPartitionEnd)));
+      Parameters.Add(new FixedValueParameter<IntRange>("TestPartition", "", new IntRange(testPartitionStart, testPartitionEnd)));
 
       ((ValueParameter<Dataset>)DatasetParameter).ReactOnValueToStringChangedAndValueItemImageChanged = false;
@@ -158,4 +197,10 @@
     public IntMatrix Bounds {
       get { return BoundsParameter.Value; }
+    }
+
+    public IEnumerable<IClassifier> FetchClassifier(IEnumerable<int> rows) {
+      foreach (var row in rows) {
+        yield return FetchClassifier(row);
+      }
     }
 
