Index: /branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/SlidingWindowBestSolutionsCollectionView.cs
===================================================================
--- /branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/SlidingWindowBestSolutionsCollectionView.cs	(revision 10412)
+++ /branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/SlidingWindowBestSolutionsCollectionView.cs	(revision 10413)
@@ -64,5 +64,5 @@
       var dataGridView = (DataGridView)sender;
       var cell = dataGridView.SelectedCells[0];
-      var bestSolutions = Content.BestSolutions.ToList();
+      var bestSolutions = Content.BestSolutions.Values.ToList();
       var tree = bestSolutions[cell.RowIndex];
       var model = Content.CreateModel(tree, Content.Interpreter);
@@ -115,8 +115,8 @@
 
     private void UpdateQualitiesMap() {
-      var bestSolutions = Content.BestSolutions.ToList();
-      var swPositions = Content.SlidingWindowPositions.ToList();
+      var bestSolutions = Content.BestSolutions.Values.ToList();
+      var swPositions = Content.BestSolutions.Keys.ToList();
       var qualitiesMap = new DoubleMatrix(bestSolutions.Count, swPositions.Count + 1);
-      qualitiesMap.ColumnNames = Content.SlidingWindowPositions.Select(x => x.Start + "-" + x.End).Concat(new List<string> { "Training" });
+      qualitiesMap.ColumnNames = swPositions.Select(x => x.Item1 + "-" + x.Item2).Concat(new List<string> { "Training" });
       qualitiesMap.RowNames = Enumerable.Range(1, bestSolutions.Count).Select(x => "M" + x);
       double min = 0, max = 0;
@@ -124,5 +124,5 @@
       for (int i = 0; i < qualitiesMap.Columns - 1; ++i) {
         var pos = swPositions[i];
-        var rows = Enumerable.Range(pos.Start, pos.End - pos.Start).ToList();
+        var rows = Enumerable.Range(pos.Item1, pos.Item2 - pos.Item1).ToList();
 
         for (int j = 0; j < qualitiesMap.Rows; ++j) {
Index: /branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SlidingWindow/SlidingWindowAnalyzer.cs
===================================================================
--- /branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SlidingWindow/SlidingWindowAnalyzer.cs	(revision 10412)
+++ /branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SlidingWindow/SlidingWindowAnalyzer.cs	(revision 10413)
@@ -138,7 +138,7 @@
       }
 
+      SaveBestSolution();
+
       if (!CheckForUpdate()) return base.Apply();
-
-      SaveBestSolution();
 
       //update necessary - move sliding window
@@ -189,7 +189,7 @@
       var fitnessPartition = FitnessCalculationPartitionParameter.ActualValue;
       var best = FindBestIndividual();
-      var range = new IntRange(fitnessPartition.Start, fitnessPartition.End);
+      var range = new Tuple<int, int>(fitnessPartition.Start, fitnessPartition.End);
 
-      bestSolutionsCollection.Add(best, range);
+      bestSolutionsCollection[range] = best;
     }
 
Index: /branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SlidingWindow/SlidingWindowBestSolutionsCollection.cs
===================================================================
--- /branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SlidingWindow/SlidingWindowBestSolutionsCollection.cs	(revision 10412)
+++ /branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SlidingWindow/SlidingWindowBestSolutionsCollection.cs	(revision 10413)
@@ -23,7 +23,8 @@
 using HeuristicLab.Common;
 using HeuristicLab.Core;
-using HeuristicLab.Data;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+using SlidingWindowRange = System.Tuple<int, int>;
 
 namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
@@ -31,17 +32,9 @@
   [Item("SlidingWindowBestSolutionsCollection", "An object holding a collection of the best sliding window solutions.")]
   public abstract class SlidingWindowBestSolutionsCollection : Item {
-
-    private List<ISymbolicExpressionTree> bestSolutions;
     [Storable]
-    public IEnumerable<ISymbolicExpressionTree> BestSolutions {
+    private Dictionary<SlidingWindowRange, ISymbolicExpressionTree> bestSolutions;
+    public Dictionary<SlidingWindowRange, ISymbolicExpressionTree> BestSolutions {
       get { return bestSolutions; }
-      set { bestSolutions = new List<ISymbolicExpressionTree>(value); }
-    }
-
-    private List<IntRange> slidingWindowPositions;
-    [Storable]
-    public IEnumerable<IntRange> SlidingWindowPositions {
-      get { return slidingWindowPositions; }
-      set { slidingWindowPositions = new List<IntRange>(value); }
+      set { bestSolutions = value; }
     }
 
@@ -68,23 +61,33 @@
       : base(original, cloner) {
       this.bestSolutions = original.bestSolutions;
-      this.slidingWindowPositions = original.slidingWindowPositions;
       this.problemData = original.problemData;
       this.interpreter = original.interpreter;
     }
     protected SlidingWindowBestSolutionsCollection() {
-      bestSolutions = new List<ISymbolicExpressionTree>();
-      slidingWindowPositions = new List<IntRange>();
+      bestSolutions = new Dictionary<SlidingWindowRange, ISymbolicExpressionTree>();
     }
 
-    public void Add(ISymbolicExpressionTree solution, IntRange range) {
-      if (bestSolutions == null) bestSolutions = new List<ISymbolicExpressionTree>();
-      bestSolutions.Add(solution);
-      if (slidingWindowPositions == null) slidingWindowPositions = new List<IntRange>();
-      slidingWindowPositions.Add(range);
+    public bool ContainsKey(SlidingWindowRange key) {
+      return bestSolutions.ContainsKey(key);
+    }
+
+    public ISymbolicExpressionTree this[SlidingWindowRange key] {
+      get {
+        return bestSolutions[key];
+      }
+      set {
+        if (bestSolutions.ContainsKey(key))
+          bestSolutions[key] = value;
+        else
+          bestSolutions.Add(key, value);
+      }
+    }
+
+    public void Add(SlidingWindowRange range, ISymbolicExpressionTree solution) {
+      bestSolutions.Add(range, solution);
     }
 
     public void Clear() {
       if (bestSolutions != null) bestSolutions.Clear();
-      if (slidingWindowPositions != null) slidingWindowPositions.Clear();
     }
 
@@ -92,6 +95,5 @@
      double lowerEstimationLimit = double.MinValue, double upperEstimationLimit = double.MaxValue);
 
-    public abstract ISymbolicDataAnalysisSolution CreateSolution(ISymbolicDataAnalysisModel model,
-      IDataAnalysisProblemData problemData);
+    public abstract ISymbolicDataAnalysisSolution CreateSolution(ISymbolicDataAnalysisModel model, IDataAnalysisProblemData problemData);
   }
 }
