Index: branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/OneR.cs
===================================================================
--- branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/OneR.cs	(revision 9074)
+++ branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/OneR.cs	(revision 9119)
@@ -95,25 +95,34 @@
         double curSplit = Double.NegativeInfinity;
         Dictionary<double, double> splits = new Dictionary<double, double>();
-        int curBucketSize = 0;
+        bool newBucket = true;
         bool done = false;
-        for (int curRow = 0; curRow < inputVariableValues.Length; curRow++) {
-          if (curBucketSize < minBucketSize) {
-            curSplit = inputVariableValues[curRow];
-            classCount[classValuesInDataset[curRow]] += 1;
-            curBucketSize++;
-            continue;
-          }
+        int curRow = 0;
+        while (curRow < inputVariableValues.Length) {
+          if (newBucket) {
+            for (int i = 0; i < minBucketSize && curRow + i < inputVariableValues.Length; i++) {
+              classCount[classValuesInDataset[curRow + i]] += 1;
+            }
+            curRow += minBucketSize;
+            if (curRow >= inputVariableValues.Length) {
+              break;
+            }
+            curSplit = inputVariableValues[curRow];
+            curRow = SetCurRowCorrectly(curRow, inputVariableValues, classValuesInDataset, classCount, curSplit);
+            newBucket = false;
+          }
+
 
           if (ExistsDominatingClass(classCount, out dominatingClass)) {
-            int i = 1;
-            while (curRow + i < classValuesInDataset.Length
-              && classValuesInDataset[curRow + i] == dominatingClass) {
-              curSplit = inputVariableValues[curRow + i];
-              classCount[classValuesInDataset[curRow]] += 1;
-              i++;
+            while (curRow + 1 < classValuesInDataset.Length &&
+              IsNextSplitStillDominationClass(curRow, inputVariableValues, classValuesInDataset, curSplit, dominatingClass)) {
+              // curRow + i < classValuesInDataset.Length && classValuesInDataset[curRow + i] == dominatingClass) {
+              curSplit = inputVariableValues[curRow + 1];
+              classCount[classValuesInDataset[curRow + 1]] += 1;
+              curRow++;
+              curRow = SetCurRowCorrectly(curRow, inputVariableValues, classValuesInDataset, classCount, curSplit);
             }
 
             curCorrectClassified += classCount[dominatingClass];
-            done = curRow + i >= inputVariableValues.Length;
+            done = curRow >= inputVariableValues.Length - 1;
 
             if (done) {
@@ -123,18 +132,17 @@
             }
 
+            curRow++;
             //intervals exclude end
-            curSplit = inputVariableValues[curRow + i];
+            curSplit = inputVariableValues[curRow];
             splits.Add(curSplit, dominatingClass);
 
-            //intervals exclude start
-            curSplit = inputVariableValues[curRow + i - 1];
+            //intervals include start
+            curSplit = inputVariableValues[curRow];
             classCount = PrepareClassCountDictionary(classValues);
-            curBucketSize = 0;
-            curRow += i - 1;
-
+            newBucket = true;
           } else {
             curSplit = inputVariableValues[curRow];
             classCount[classValuesInDataset[curRow]] += 1;
-            curBucketSize++;
+            curRow = SetCurRowCorrectly(curRow, inputVariableValues, classValuesInDataset, classCount, curSplit);
           }
         }
@@ -173,4 +181,34 @@
 
       return solution;
+    }
+
+    private static bool IsNextSplitStillDominationClass(int curRow, double[] inputVariableValues, double[] classValuesInDataset, double curSplit, double dominatingClass) {
+      if (curRow >= classValuesInDataset.Length) {
+        return false;
+      }
+      double nextSplit = inputVariableValues[curRow + 1];
+      int i = 1;
+      while (curRow + i < classValuesInDataset.Length
+        && inputVariableValues[curRow + i] == nextSplit
+        && classValuesInDataset[curRow + i] == dominatingClass) {
+        i++;
+      }
+      if (curRow + i >= classValuesInDataset.Length) {
+        return true;
+      }
+      if (inputVariableValues[curRow + i] != nextSplit) {
+        return true;
+      }
+      // the next split would also contain values of a class which 
+      // is not dominating (classValuesInDataset[curRow + i] != dominatingClass)
+      return false;
+    }
+
+    private static int SetCurRowCorrectly(int curRow, double[] inputVariableValues, double[] classValuesInDataset, Dictionary<double, int> classCount, double curSplit) {
+      while (curRow + 1 < inputVariableValues.Length && inputVariableValues[curRow + 1] == curSplit) {
+        curRow++;
+        classCount[classValuesInDataset[curRow]] += 1;
+      }
+      return curRow;
     }
 
Index: branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/OneR/OneRClassificationModel.cs
===================================================================
--- branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/OneR/OneRClassificationModel.cs	(revision 9074)
+++ branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/OneR/OneRClassificationModel.cs	(revision 9119)
@@ -29,4 +29,6 @@
 
 namespace HeuristicLab.Algorithms.DataAnalysis {
+  [StorableClass]
+  [Item("1R Classification Model", "A model that uses intervals for one variable to determine the class.")]
   public class OneRClassificationModel : NamedItem, IClassificationModel {
     [Storable]
@@ -52,5 +54,7 @@
     protected OneRClassificationModel(OneRClassificationModel original, Cloner cloner)
       : base(original, cloner) {
-      this.splits = original.splits;
+      this.variable = (string)original.variable;
+      this.splits = (double[])original.splits.Clone();
+      this.classes = (double[])original.classes.Clone();
     }
     public override IDeepCloneable Clone(Cloner cloner) { return new OneRClassificationModel(this, cloner); }
@@ -58,4 +62,7 @@
     public OneRClassificationModel(string variable, double[] splits, double[] classes)
       : base() {
+      if (splits.Length != classes.Length) {
+        throw new ArgumentException("Number of splits and classes has to be equal.");
+      }
       if (!Double.IsPositiveInfinity(splits[splits.Length - 1])) {
         throw new ArgumentException("Last split has to be double.PositiveInfinity, so that all values are covered.");
Index: branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/OneR/OneRClassificationSolution.cs
===================================================================
--- branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/OneR/OneRClassificationSolution.cs	(revision 9074)
+++ branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/OneR/OneRClassificationSolution.cs	(revision 9119)
@@ -21,11 +21,14 @@
 
 using HeuristicLab.Common;
+using HeuristicLab.Core;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
 using HeuristicLab.Problems.DataAnalysis;
 
 namespace HeuristicLab.Algorithms.DataAnalysis {
+  [StorableClass]
+  [Item(Name = "1R Classification Solution", Description = "Represents a 1R classification solution (model + data).")]
   public class OneRClassificationSolution : ClassificationSolution {
-    public new ConstantClassificationModel Model {
-      get { return (ConstantClassificationModel)base.Model; }
+    public new OneRClassificationModel Model {
+      get { return (OneRClassificationModel)base.Model; }
       set { base.Model = value; }
     }
