Index: /branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/Dataset.cs
===================================================================
--- /branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/Dataset.cs	(revision 11588)
+++ /branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/Dataset.cs	(revision 11589)
@@ -33,8 +33,8 @@
   [Item("Dataset", "Represents a dataset containing data that should be analyzed.")]
   [StorableClass]
-  public sealed class Dataset : NamedItem, IDataset {
+  public class Dataset : NamedItem, IDataset {
     [StorableConstructor]
-    private Dataset(bool deserializing) : base(deserializing) { }
-    private Dataset(Dataset original, Cloner cloner)
+    protected Dataset(bool deserializing) : base(deserializing) { }
+    protected Dataset(Dataset original, Cloner cloner)
       : base(original, cloner) {
       variableValues = new Dictionary<string, IList>(original.variableValues);
@@ -143,82 +143,50 @@
 
     [Storable(Name = "VariableValues")]
-    private Dictionary<string, IList> variableValues;
-
-    private List<string> variableNames;
+    protected Dictionary<string, IList> variableValues;
+
+    protected List<string> variableNames;
     [Storable]
     public IEnumerable<string> VariableNames {
       get { return variableNames; }
-      private set {
+      protected set {
         if (variableNames != null) throw new InvalidOperationException();
         variableNames = new List<string>(value);
       }
     }
-
     public IEnumerable<string> DoubleVariables {
       get { return variableValues.Where(p => p.Value is List<double>).Select(p => p.Key); }
     }
-
     public IEnumerable<double> GetDoubleValues(string variableName) {
+      return GetValues<double>(variableName);
+    }
+    public IEnumerable<string> GetStringValues(string variableName) {
+      return GetValues<string>(variableName);
+    }
+    public IEnumerable<DateTime> GetDateTimeValues(string variableName) {
+      return GetValues<DateTime>(variableName);
+    }
+    public ReadOnlyCollection<double> GetReadOnlyDoubleValues(string variableName) {
+      var values = GetValues<double>(variableName).ToList();
+      return values.AsReadOnly();
+    }
+    public double GetDoubleValue(string variableName, int row) {
+      var values = GetValues<double>(variableName) as List<double>;
+      return values[row];
+    }
+    public IEnumerable<double> GetDoubleValues(string variableName, IEnumerable<int> rows) {
+      return GetValues<double>(variableName, rows);
+    }
+    private IEnumerable<T> GetValues<T>(string variableName, IEnumerable<int> rows) {
+      var values = GetValues<T>(variableName) as List<T>;
+      return rows.Select(x => values[x]);
+    }
+    private IEnumerable<T> GetValues<T>(string variableName) {
       IList list;
       if (!variableValues.TryGetValue(variableName, out list))
         throw new ArgumentException("The variable " + variableName + " does not exist in the dataset.");
-      List<double> values = list as List<double>;
-      if (values == null) throw new ArgumentException("The variable " + variableName + " is not a double variable.");
-
-      //mkommend yield return used to enable lazy evaluation
-      foreach (double value in values)
-        yield return value;
-    }
-
-    public IEnumerable<string> GetStringValues(string variableName) {
-      IList list;
-      if (!variableValues.TryGetValue(variableName, out list))
-        throw new ArgumentException("The variable " + variableName + " does not exist in the dataset.");
-      List<string> values = list as List<string>;
-      if (values == null) throw new ArgumentException("The variable " + variableName + " is not a string variable.");
-
-      //mkommend yield return used to enable lazy evaluation
-      foreach (string value in values)
-        yield return value;
-    }
-
-    public IEnumerable<DateTime> GetDateTimeValues(string variableName) {
-      IList list;
-      if (!variableValues.TryGetValue(variableName, out list))
-        throw new ArgumentException("The variable " + variableName + " does not exist in the dataset.");
-      List<DateTime> values = list as List<DateTime>;
-      if (values == null) throw new ArgumentException("The variable " + variableName + " is not a datetime variable.");
-
-      //mkommend yield return used to enable lazy evaluation
-      foreach (DateTime value in values)
-        yield return value;
-    }
-
-    public ReadOnlyCollection<double> GetReadOnlyDoubleValues(string variableName) {
-      IList list;
-      if (!variableValues.TryGetValue(variableName, out list))
-        throw new ArgumentException("The variable " + variableName + " does not exist in the dataset.");
-      List<double> values = list as List<double>;
-      if (values == null) throw new ArgumentException("The variable " + variableName + " is not a double variable.");
-      return values.AsReadOnly();
-    }
-    public double GetDoubleValue(string variableName, int row) {
-      IList list;
-      if (!variableValues.TryGetValue(variableName, out list))
-        throw new ArgumentException("The variable " + variableName + " does not exist in the dataset.");
-      List<double> values = list as List<double>;
-      if (values == null) throw new ArgumentException("The variable " + variableName + " is not a double variable.");
-      return values[row];
-    }
-    public IEnumerable<double> GetDoubleValues(string variableName, IEnumerable<int> rows) {
-      IList list;
-      if (!variableValues.TryGetValue(variableName, out list))
-        throw new ArgumentException("The variable " + variableName + " does not exist in the dataset.");
-      List<double> values = list as List<double>;
-      if (values == null) throw new ArgumentException("The variable " + variableName + " is not a double variable.");
-
-      return rows.Select(index => values[index]);
-    }
-
+      List<T> values = list as List<T>;
+      if (values == null) throw new ArgumentException("The variable " + variableName + " is not a " + typeof(T) + " variable.");
+      return values;
+    }
     public bool VariableHasType<T>(string variableName) {
       return variableValues[variableName] is IList<T>;
@@ -227,5 +195,5 @@
     #region IStringConvertibleMatrix Members
     [Storable]
-    private int rows;
+    protected int rows;
     public int Rows {
       get { return rows; }
@@ -236,5 +204,4 @@
       set { throw new NotSupportedException(); }
     }
-
     public bool SortableView {
       get { return false; }
@@ -244,5 +211,4 @@
       get { return true; }
     }
-
     IEnumerable<string> IStringConvertibleMatrix.ColumnNames {
       get { return this.VariableNames; }
@@ -253,5 +219,4 @@
       set { throw new NotSupportedException(); }
     }
-
     public string GetValue(int rowIndex, int columnIndex) {
       return variableValues[variableNames[columnIndex]][rowIndex].ToString();
Index: /branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj
===================================================================
--- /branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj	(revision 11588)
+++ /branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj	(revision 11589)
@@ -172,4 +172,5 @@
     <Compile Include="Interfaces\TimeSeriesPrognosis\ITimeSeriesPrognosisProblemData.cs" />
     <Compile Include="Interfaces\TimeSeriesPrognosis\ITimeSeriesPrognosisSolution.cs" />
+    <Compile Include="ModifiableDataset.cs" />
     <Compile Include="OnlineCalculators\AutoCorrelationCalculator.cs" />
     <Compile Include="OnlineCalculators\DependencyCalculator\HoeffdingsDependenceCalculator.cs" />
Index: /branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataset.cs
===================================================================
--- /branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataset.cs	(revision 11588)
+++ /branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataset.cs	(revision 11589)
@@ -20,4 +20,5 @@
 #endregion
 
+using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
@@ -31,5 +32,5 @@
     ReadOnlyCollection<double> GetReadOnlyDoubleValues(string variableName);
     IEnumerable<string> GetStringValues(string variableName);
-
+    IEnumerable<DateTime> GetDateTimeValues(string variableName);
     IEnumerable<string> VariableNames { get; }
     IEnumerable<string> DoubleVariables { get; }
Index: /branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/ModifiableDataset.cs
===================================================================
--- /branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/ModifiableDataset.cs	(revision 11589)
+++ /branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/ModifiableDataset.cs	(revision 11589)
@@ -0,0 +1,91 @@
+﻿#region License Information
+
+/* HeuristicLab
+ * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#endregion
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  [Item("ModifiableDataset", "Represents a dataset containing data that should be analyzed, which can be modified by adding or replacing variables and values.")]
+  [StorableClass]
+  public class ModifiableDataset : Dataset {
+    [StorableConstructor]
+    private ModifiableDataset(bool deserializing) : base(deserializing) { }
+    private ModifiableDataset(ModifiableDataset original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) { return new ModifiableDataset(this, cloner); }
+    public ModifiableDataset() : base() { }
+    public ModifiableDataset(IEnumerable<string> variableNames, IEnumerable<IList> variableValues) : base(variableNames, variableValues) { }
+
+    public void ReplaceRow(int row, IEnumerable<object> values) {
+      var list = values.ToList();
+      if (list.Count != variableNames.Count)
+        throw new ArgumentException("The number of values must be equal to the number of variable names.");
+      // check if all the values are of the correct type
+      for (int i = 0; i < list.Count; ++i) {
+        if (list[i].GetType() != GetVariableType(variableNames[i])) {
+          throw new ArgumentException("The type of the provided value does not match the variable type.");
+        }
+      }
+      // replace values
+      for (int i = 0; i < list.Count; ++i) {
+        variableValues[variableNames[i]][row] = list[i];
+      }
+    }
+
+    public void AddRow(IEnumerable<object> values) {
+      var list = values.ToList();
+      if (list.Count != variableNames.Count)
+        throw new ArgumentException("The number of values must be equal to the number of variable names.");
+      // check if all the values are of the correct type
+      for (int i = 0; i < list.Count; ++i) {
+        if (list[i].GetType() != GetVariableType(variableNames[i])) {
+          throw new ArgumentException("The type of the provided value does not match the variable type.");
+        }
+      }
+      // add values
+      for (int i = 0; i < list.Count; ++i) {
+        variableValues[variableNames[i]].Add(list[i]);
+      }
+      rows++;
+    }
+
+    // slow, avoid to use this
+    public void RemoveRow(int row) {
+      foreach (var list in variableValues.Values)
+        list.RemoveAt(row);
+      rows--;
+    }
+
+    private Type GetVariableType(string variableName) {
+      IList list;
+      variableValues.TryGetValue(variableName, out list);
+      if (list == null)
+        throw new ArgumentException("The variable " + variableName + " does not exist in the dataset.");
+      return list[0].GetType();
+    }
+  }
+}
Index: /branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/SimpleDataset.cs
===================================================================
--- /branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/SimpleDataset.cs	(revision 11588)
+++ /branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/SimpleDataset.cs	(revision 11589)
@@ -96,4 +96,12 @@
     }
 
+    public IEnumerable<T> GetValues<T>(string variableName, IEnumerable<int> rows) {
+      throw new NotImplementedException();
+    }
+
+    public IEnumerable<T> GetValues<T>(string variableName) {
+      throw new NotImplementedException();
+    }
+
     public IEnumerable<double> GetDoubleValues(string variableName, IEnumerable<int> rows) {
       yield return GetDoubleValue(variableName, 0);
@@ -110,4 +118,8 @@
     public IEnumerable<string> GetStringValues(string variableName) {
       yield return GetDoubleValue(variableName, 0).ToString(CultureInfo.InvariantCulture);
+    }
+
+    public IEnumerable<DateTime> GetDateTimeValues(string variableName) {
+      throw new NotImplementedException();
     }
 
