Index: trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/TimeSeries/CSV/TimeSeriesPrognosisCSVInstanceProvider.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/TimeSeries/CSV/TimeSeriesPrognosisCSVInstanceProvider.cs	(revision 8798)
+++ trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/TimeSeries/CSV/TimeSeriesPrognosisCSVInstanceProvider.cs	(revision 8885)
@@ -20,8 +20,12 @@
 #endregion
 
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Problems.DataAnalysis;
 
-using System;
-using System.Collections.Generic;
-using HeuristicLab.Problems.DataAnalysis;
 namespace HeuristicLab.Problems.Instances.DataAnalysis {
   public class TimeSeriesPrognosisCSVInstanceProvider : TimeSeriesPrognosisInstanceProvider {
@@ -48,4 +52,63 @@
       throw new NotImplementedException();
     }
+
+    public override bool CanImportData { get { return true; } }
+
+    public override ITimeSeriesPrognosisProblemData ImportData(string path) {
+      TableFileParser csvFileParser = new TableFileParser();
+      csvFileParser.Parse(path);
+
+      Dataset dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values);
+      string targetVar = csvFileParser.VariableNames.Last();
+
+      IEnumerable<string> allowedInputVars = dataset.DoubleVariables.Where(x => !x.Equals(targetVar));
+
+      ITimeSeriesPrognosisProblemData timeSeriesPrognosisData = new TimeSeriesPrognosisProblemData(dataset, allowedInputVars, targetVar);
+
+      int trainingPartEnd = csvFileParser.Rows * 2 / 3;
+      timeSeriesPrognosisData.TrainingPartition.Start = 0;
+      timeSeriesPrognosisData.TrainingPartition.End = trainingPartEnd;
+      timeSeriesPrognosisData.TestPartition.Start = trainingPartEnd;
+      timeSeriesPrognosisData.TestPartition.End = csvFileParser.Rows;
+
+      int pos = path.LastIndexOf('\\');
+      if (pos < 0)
+        timeSeriesPrognosisData.Name = path;
+      else {
+        pos++;
+        timeSeriesPrognosisData.Name = path.Substring(pos, path.Length - pos);
+      }
+      return timeSeriesPrognosisData;
+    }
+
+    protected override ITimeSeriesPrognosisProblemData ImportData(string path, TimeSeriesPrognosisImportType type, TableFileParser csvFileParser) {
+      Dataset dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values);
+
+      // turn of input variables that are constant in the training partition
+      var allowedInputVars = new List<string>();
+      int trainingPartEnd = (csvFileParser.Rows * type.Training) / 100;
+      trainingPartEnd = trainingPartEnd > 0 ? trainingPartEnd : 1;
+      var trainingIndizes = Enumerable.Range(0, trainingPartEnd);
+      if (trainingIndizes.Count() >= 2) {
+        foreach (var variableName in dataset.DoubleVariables) {
+          if (dataset.GetDoubleValues(variableName, trainingIndizes).Range() > 0 &&
+            variableName != type.TargetVariable)
+            allowedInputVars.Add(variableName);
+        }
+      } else {
+        allowedInputVars.AddRange(dataset.DoubleVariables.Where(x => !x.Equals(type.TargetVariable)));
+      }
+
+      TimeSeriesPrognosisProblemData timeSeriesPrognosisData = new TimeSeriesPrognosisProblemData(dataset, allowedInputVars, type.TargetVariable);
+
+      timeSeriesPrognosisData.TrainingPartition.Start = 0;
+      timeSeriesPrognosisData.TrainingPartition.End = trainingPartEnd;
+      timeSeriesPrognosisData.TestPartition.Start = trainingPartEnd;
+      timeSeriesPrognosisData.TestPartition.End = csvFileParser.Rows;
+
+      timeSeriesPrognosisData.Name = Path.GetFileName(path);
+
+      return timeSeriesPrognosisData;
+    }
   }
 }
Index: trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/TimeSeries/TimeSeriesPrognosisImportType.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/TimeSeries/TimeSeriesPrognosisImportType.cs	(revision 8885)
+++ trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/TimeSeries/TimeSeriesPrognosisImportType.cs	(revision 8885)
@@ -0,0 +1,26 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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;
+
+namespace HeuristicLab.Problems.Instances.DataAnalysis {
+  public class TimeSeriesPrognosisImportType : DataAnalysisImportType {
+    public string TargetVariable { get; set; }
+  }
+}
Index: trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/TimeSeries/TimeSeriesPrognosisInstanceProvider.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/TimeSeries/TimeSeriesPrognosisInstanceProvider.cs	(revision 8798)
+++ trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/TimeSeries/TimeSeriesPrognosisInstanceProvider.cs	(revision 8885)
@@ -20,75 +20,8 @@
 #endregion
 
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Text;
 using HeuristicLab.Problems.DataAnalysis;
 
 namespace HeuristicLab.Problems.Instances.DataAnalysis {
-  public abstract class TimeSeriesPrognosisInstanceProvider : IProblemInstanceProvider<ITimeSeriesPrognosisProblemData> {
-    public bool CanImportData { get { return true; } }
-    public bool CanExportData { get { return true; } }
-
-
-    public ITimeSeriesPrognosisProblemData ImportData(string path) {
-      TableFileParser csvFileParser = new TableFileParser();
-      csvFileParser.Parse(path);
-
-      Dataset dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values);
-      string targetVar = csvFileParser.VariableNames.Last();
-
-      IEnumerable<string> allowedInputVars = dataset.DoubleVariables.Where(x => !x.Equals(targetVar));
-
-      ITimeSeriesPrognosisProblemData regData = new TimeSeriesPrognosisProblemData(dataset, allowedInputVars, targetVar);
-
-      int trainingPartEnd = csvFileParser.Rows * 2 / 3;
-      regData.TrainingPartition.Start = 0;
-      regData.TrainingPartition.End = trainingPartEnd;
-      regData.TestPartition.Start = trainingPartEnd;
-      regData.TestPartition.End = csvFileParser.Rows;
-
-      int pos = path.LastIndexOf('\\');
-      if (pos < 0)
-        regData.Name = path;
-      else {
-        pos++;
-        regData.Name = path.Substring(pos, path.Length - pos);
-      }
-      return regData;
-    }
-
-    public void ExportData(ITimeSeriesPrognosisProblemData instance, string path) {
-      StringBuilder strBuilder = new StringBuilder();
-
-      foreach (var variable in instance.InputVariables) {
-        strBuilder.Append(variable + ";");
-      }
-      strBuilder.Remove(strBuilder.Length - 1, 1);
-      strBuilder.AppendLine();
-
-      Dataset dataset = instance.Dataset;
-
-      for (int i = 0; i < dataset.Rows; i++) {
-        for (int j = 0; j < dataset.Columns; j++) {
-          strBuilder.Append(dataset.GetValue(i, j) + ";");
-        }
-        strBuilder.Remove(strBuilder.Length - 1, 1);
-        strBuilder.AppendLine();
-      }
-
-      using (StreamWriter writer = new StreamWriter(path)) {
-        writer.Write(strBuilder);
-      }
-    }
-
-    public abstract IEnumerable<IDataDescriptor> GetDataDescriptors();
-    public abstract ITimeSeriesPrognosisProblemData LoadData(IDataDescriptor descriptor);
-
-    public abstract string Name { get; }
-    public abstract string Description { get; }
-    public abstract Uri WebLink { get; }
-    public abstract string ReferencePublication { get; }
+  public abstract class TimeSeriesPrognosisInstanceProvider : DataAnalysisInstanceProvider<ITimeSeriesPrognosisProblemData, TimeSeriesPrognosisImportType> {
   }
 }
