Index: /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveProblem.cs
===================================================================
--- /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveProblem.cs	(revision 7769)
+++ /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveProblem.cs	(revision 7770)
@@ -111,25 +111,18 @@
     }
 
+    #region Import & Export
     public void Load(ClassificationProblemData data) {
-      Name = data.Name;
-      Description = data.Description;
-      ProblemData = new ClassificationProblemData(data.Dataset, data.AllowedInputVariables, data.TargetVariable);
-      ProblemData.TrainingPartition.Start = data.TrainingPartition.Start;
-      ProblemData.TrainingPartition.End = data.TrainingPartition.End;
-      ProblemData.TestPartition.Start = data.TestPartition.Start;
-      ProblemData.TestPartition.End = data.TestPartition.End;
-      OnReset();
+      base.Load(data);
     }
 
     public ClassificationProblemData Export() {
-      ClassificationProblemData claData = new ClassificationProblemData(ProblemData.Dataset, ProblemData.AllowedInputVariables, ProblemData.TargetVariable);
-      claData.Name = Name;
-      claData.Description = Description;
-      claData.TrainingPartition.Start = ProblemData.TrainingPartition.Start;
-      claData.TrainingPartition.End = ProblemData.TrainingPartition.End;
-      claData.TestPartition.Start = ProblemData.TestPartition.Start;
-      claData.TestPartition.End = ProblemData.TestPartition.End;
-      return claData;
+      if (ProblemData is ClassificationProblemData) {
+        return (ClassificationProblemData)ProblemData;
+      } else {
+        ClassificationProblemData claData = new ClassificationProblemData(ProblemData.Dataset, ProblemData.AllowedInputVariables, ProblemData.TargetVariable);
+        return (ClassificationProblemData)base.Export(claData);
+      }
     }
+    #endregion
   }
 }
Index: /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveProblem.cs
===================================================================
--- /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveProblem.cs	(revision 7769)
+++ /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveProblem.cs	(revision 7770)
@@ -114,25 +114,18 @@
     }
 
+    #region Import & Export
     public void Load(RegressionProblemData data) {
-      Name = data.Name;
-      Description = data.Description;
-      ProblemData = new RegressionProblemData(data.Dataset, data.AllowedInputVariables, data.TargetVariable);
-      ProblemData.TrainingPartition.Start = data.TrainingPartition.Start;
-      ProblemData.TrainingPartition.End = data.TrainingPartition.End;
-      ProblemData.TestPartition.Start = data.TestPartition.Start;
-      ProblemData.TestPartition.End = data.TestPartition.End;
-      OnReset();
+      base.Load(data);
     }
 
     public RegressionProblemData Export() {
-      RegressionProblemData regData = new RegressionProblemData(ProblemData.Dataset, ProblemData.AllowedInputVariables, ProblemData.TargetVariable);
-      regData.Name = Name;
-      regData.Description = Description;
-      regData.TrainingPartition.Start = ProblemData.TrainingPartition.Start;
-      regData.TrainingPartition.End = ProblemData.TrainingPartition.End;
-      regData.TestPartition.Start = ProblemData.TestPartition.Start;
-      regData.TestPartition.End = ProblemData.TestPartition.End;
-      return regData;
+      if (ProblemData is RegressionProblemData)
+        return (RegressionProblemData)ProblemData;
+      else {
+        RegressionProblemData regData = new RegressionProblemData(ProblemData.Dataset, ProblemData.AllowedInputVariables, ProblemData.TargetVariable);
+        return (RegressionProblemData)base.Export(regData);
+      }
     }
+    #endregion
   }
 }
Index: /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs
===================================================================
--- /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs	(revision 7769)
+++ /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs	(revision 7770)
@@ -319,4 +319,23 @@
       }
     }
+
+    #region Import & Export
+    protected void Load(T data) {
+      Name = data.Name;
+      Description = data.Description;
+      ProblemData = data;
+      OnReset();
+    }
+
+    protected T Export(T data) {
+      data.Name = Name;
+      data.Description = Description;
+      data.TrainingPartition.Start = ProblemData.TrainingPartition.Start;
+      data.TrainingPartition.End = ProblemData.TrainingPartition.End;
+      data.TestPartition.Start = ProblemData.TestPartition.Start;
+      data.TestPartition.End = ProblemData.TestPartition.End;
+      return data;
+    }
+    #endregion
   }
 }
Index: /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblem.cs
===================================================================
--- /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblem.cs	(revision 7769)
+++ /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblem.cs	(revision 7770)
@@ -43,25 +43,18 @@
     }
 
+    #region Import & Export
     public void Load(ClassificationProblemData data) {
-      Name = data.Name;
-      Description = data.Description;
-      ProblemData = new ClassificationProblemData(data.Dataset, data.AllowedInputVariables, data.TargetVariable);
-      ProblemData.TrainingPartition.Start = data.TrainingPartition.Start;
-      ProblemData.TrainingPartition.End = data.TrainingPartition.End;
-      ProblemData.TestPartition.Start = data.TestPartition.Start;
-      ProblemData.TestPartition.End = data.TestPartition.End;
-      OnReset();
+      base.Load(data);
     }
 
     public ClassificationProblemData Export() {
-      ClassificationProblemData claData = new ClassificationProblemData(ProblemData.Dataset, ProblemData.AllowedInputVariables, ProblemData.TargetVariable);
-      claData.Name = Name;
-      claData.Description = Description;
-      claData.TrainingPartition.Start = ProblemData.TrainingPartition.Start;
-      claData.TrainingPartition.End = ProblemData.TrainingPartition.End;
-      claData.TestPartition.Start = ProblemData.TestPartition.Start;
-      claData.TestPartition.End = ProblemData.TestPartition.End;
-      return claData;
+      if (ProblemData is ClassificationProblemData) {
+        return (ClassificationProblemData)ProblemData;
+      } else {
+        ClassificationProblemData claData = new ClassificationProblemData(ProblemData.Dataset, ProblemData.AllowedInputVariables, ProblemData.TargetVariable);
+        return (ClassificationProblemData)base.Export(claData);
+      }
     }
+    #endregion
   }
 }
Index: /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblem.cs
===================================================================
--- /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblem.cs	(revision 7769)
+++ /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblem.cs	(revision 7770)
@@ -90,4 +90,23 @@
       if (handler != null) handler(this, EventArgs.Empty);
     }
+
+    #region Import & Export
+    protected void Load(T data) {
+      Name = data.Name;
+      Description = data.Description;
+      ProblemData = data;
+      OnReset();
+    }
+
+    protected T Export(T data) {
+      data.Name = Name;
+      data.Description = Description;
+      data.TrainingPartition.Start = ProblemData.TrainingPartition.Start;
+      data.TrainingPartition.End = ProblemData.TrainingPartition.End;
+      data.TestPartition.Start = ProblemData.TestPartition.Start;
+      data.TestPartition.End = ProblemData.TestPartition.End;
+      return data;
+    }
+    #endregion
   }
 }
Index: /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblem.cs
===================================================================
--- /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblem.cs	(revision 7769)
+++ /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblem.cs	(revision 7770)
@@ -43,25 +43,18 @@
     }
 
+    #region Import & Export
     public void Load(RegressionProblemData data) {
-      Name = data.Name;
-      Description = data.Description;
-      ProblemData = new RegressionProblemData(data.Dataset, data.AllowedInputVariables, data.TargetVariable);
-      ProblemData.TrainingPartition.Start = data.TrainingPartition.Start;
-      ProblemData.TrainingPartition.End = data.TrainingPartition.End;
-      ProblemData.TestPartition.Start = data.TestPartition.Start;
-      ProblemData.TestPartition.End = data.TestPartition.End;
-      OnReset();
+      base.Load(data);
     }
 
     public RegressionProblemData Export() {
-      RegressionProblemData regData = new RegressionProblemData(ProblemData.Dataset, ProblemData.AllowedInputVariables, ProblemData.TargetVariable);
-      regData.Name = Name;
-      regData.Description = Description;
-      regData.TrainingPartition.Start = ProblemData.TrainingPartition.Start;
-      regData.TrainingPartition.End = ProblemData.TrainingPartition.End;
-      regData.TestPartition.Start = ProblemData.TestPartition.Start;
-      regData.TestPartition.End = ProblemData.TestPartition.End;
-      return regData;
+      if (ProblemData is RegressionProblemData) {
+        return (RegressionProblemData)ProblemData;
+      } else {
+        RegressionProblemData regData = new RegressionProblemData(ProblemData.Dataset, ProblemData.AllowedInputVariables, ProblemData.TargetVariable);
+        return (RegressionProblemData)base.Export(regData);
+      }
     }
+    #endregion
   }
 }
Index: /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances.Regression/3.4/ValueGenerator.cs
===================================================================
--- /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances.Regression/3.4/ValueGenerator.cs	(revision 7769)
+++ /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances.Regression/3.4/ValueGenerator.cs	(revision 7770)
@@ -20,9 +20,9 @@
 #endregion
 
-
 using System;
 using System.Collections.Generic;
 using System.Linq;
 using HeuristicLab.Random;
+
 namespace HeuristicLab.Problems.Instances.Regression {
   public static class ValueGenerator {
@@ -45,5 +45,83 @@
     }
 
-    public static IEnumerable<IEnumerable<double>> GenerateAllCombinationsOfValuesInLists(List<List<double>> sets) {
+    // iterative approach
+    public static IEnumerable<IEnumerable<double>> GenerateAllCombinationsOfValuesInLists(List<List<double>> lists) {
+      List<List<double>> allCombinations = new List<List<double>>();
+      if (lists.Count < 1) {
+        return allCombinations;
+      }
+
+      List<IEnumerator<double>> enumerators = new List<IEnumerator<double>>();
+      foreach (var list in lists) {
+        enumerators.Add(list.GetEnumerator());
+      }
+
+      bool finished = !enumerators.All(x => x.MoveNext());
+
+      while (!finished) {
+        allCombinations.Add(GetCurrentCombination(enumerators));
+        finished = MoveNext(enumerators, lists);
+      }
+
+      IEnumerable<IEnumerable<double>> res = (from i in Enumerable.Range(0, lists.Count)
+                                              select (from list in allCombinations
+                                                      select list.ElementAt(i)));
+      return res;
+    }
+
+    private static bool MoveNext(List<IEnumerator<double>> enumerators, List<List<double>> lists) {
+      int cur = enumerators.Count - 1;
+      while (cur >= 0 && !enumerators[cur].MoveNext()) {
+        enumerators[cur] = lists[cur].GetEnumerator();
+        enumerators[cur].MoveNext();
+        cur--;
+      }
+      return cur < 0;
+    }
+
+    private static List<double> GetCurrentCombination(List<IEnumerator<double>> enumerators) {
+      List<double> combination = new List<double>();
+      foreach (var enumerator in enumerators) {
+        combination.Add(enumerator.Current);
+      }
+      return combination;
+    }
+
+    //recursive approach
+    /*public static IEnumerable<IEnumerable<double>> GenerateAllCombinationsOfValuesInLists(List<List<double>> lists) {
+      int cur = 0;
+      List<double> curCombination = new List<double>();
+      List<List<double>> allCombinations = new List<List<double>>();
+      if (lists.Count() > cur) {
+        foreach (var item in lists[cur]) {
+          curCombination.Clear();
+          curCombination.Add(item);
+          GetCombination(lists, cur + 1, curCombination, allCombinations);
+        }
+      }
+
+      IEnumerable<IEnumerable<double>> res = (from i in Enumerable.Range(0, lists.Count)
+                                              select (from list in allCombinations
+                                                      select list.ElementAt(i)));
+
+      return res;
+    }
+
+    private static void GetCombination(List<List<double>> lists, int cur, List<double> curCombinations, List<List<double>> allCombinations) {
+      if (lists.Count > cur) {
+        foreach (var item in lists[cur]) {
+          if (curCombinations.Count > cur) {
+            curCombinations.RemoveAt(cur);
+          }
+          curCombinations.Add(item);
+          GetCombination(lists, cur + 1, curCombinations, allCombinations);
+        }
+      } else {
+        allCombinations.Add(new List<double>(curCombinations));
+      }
+    }    */
+
+    //original
+    /*public static IEnumerable<IEnumerable<double>> GenerateAllCombinationsOfValuesInLists(List<List<double>> sets) {
 
       var combinations = new List<List<double>>();
@@ -69,5 +147,5 @@
 
       return newCombinations.ToList();
-    }
+    }    */
   }
 }
Index: /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances.Views/3.4/ProblemInstanceConsumerView.cs
===================================================================
--- /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances.Views/3.4/ProblemInstanceConsumerView.cs	(revision 7769)
+++ /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances.Views/3.4/ProblemInstanceConsumerView.cs	(revision 7770)
@@ -61,4 +61,21 @@
     }
 
+    private IEnumerable<IProblemInstanceProvider> GetProblemInstanceProviders() {
+      var consumerTypes = Content.GetType().GetInterfaces()
+        .Where(x => x.IsGenericType
+          && x.GetGenericTypeDefinition() == typeof(IProblemInstanceConsumer<>));
+
+      if (consumerTypes.Any()) {
+        var instanceTypes = consumerTypes
+          .Select(x => x.GetGenericArguments().First())
+          .Select(x => typeof(IProblemInstanceProvider<>).MakeGenericType(x));
+
+        foreach (var type in instanceTypes) {
+          foreach (var provider in ApplicationManager.Manager.GetInstances(type))
+            yield return (IProblemInstanceProvider)provider;
+        }
+      }
+    }
+
     public bool ContainsProviders() {
       return problemInstanceProviderComboBox.Items.Count > 0;
@@ -102,21 +119,5 @@
     }
 
-    private IEnumerable<IProblemInstanceProvider> GetProblemInstanceProviders() {
-      var consumerTypes = Content.GetType().GetInterfaces()
-        .Where(x => x.IsGenericType
-          && x.GetGenericTypeDefinition() == typeof(IProblemInstanceConsumer<>));
-
-      if (consumerTypes.Any()) {
-        var instanceTypes = consumerTypes
-          .Select(x => x.GetGenericArguments().First())
-          .Select(x => typeof(IProblemInstanceProvider<>).MakeGenericType(x));
-
-        foreach (var type in instanceTypes) {
-          foreach (var provider in ApplicationManager.Manager.GetInstances(type))
-            yield return (IProblemInstanceProvider)provider;
-        }
-      }
-    }
-
+    #region ToolTip
     private void SetTooltip() {
       toolTip.SetToolTip(problemInstanceProviderComboBox, GetProviderToolTip());
@@ -143,4 +144,5 @@
       return toolTip;
     }
+    #endregion
   }
 }
Index: /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances.Views/3.4/ProblemInstanceProviderViewGeneric.cs
===================================================================
--- /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances.Views/3.4/ProblemInstanceProviderViewGeneric.cs	(revision 7769)
+++ /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances.Views/3.4/ProblemInstanceProviderViewGeneric.cs	(revision 7770)
@@ -39,4 +39,5 @@
     }
 
+    #region Importer & Exporter
     protected IProblemInstanceConsumer<T> GenericConsumer { get { return Consumer as IProblemInstanceConsumer<T>; } }
     protected IProblemInstanceConsumer consumer;
@@ -58,4 +59,5 @@
       }
     }
+    #endregion
 
     public ProblemInstanceProviderViewGeneric() {
@@ -93,5 +95,5 @@
     protected virtual void loadButton_Click(object sender, EventArgs e) {
       var descriptor = (IDataDescriptor)instancesComboBox.SelectedItem;
-      var instance = Content.LoadData(descriptor);
+      T instance = Content.LoadData(descriptor);
       try {
         GenericConsumer.Load(instance);
