Index: /branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/DatastreamAnalysisOptimizerView.Designer.cs
===================================================================
--- /branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/DatastreamAnalysisOptimizerView.Designer.cs	(revision 14537)
+++ /branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/DatastreamAnalysisOptimizerView.Designer.cs	(revision 14538)
@@ -43,28 +43,39 @@
       // startButton
       // 
-      this.startButton.Location = new System.Drawing.Point(6, 636);
+      this.startButton.Location = new System.Drawing.Point(9, 978);
+      this.startButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+      this.startButton.Size = new System.Drawing.Size(36, 37);
       this.toolTip.SetToolTip(this.startButton, "Start/Resume Optimizer");
       // 
       // executionTimeTextBox
       // 
-      this.executionTimeTextBox.Location = new System.Drawing.Point(936, 640);
+      this.executionTimeTextBox.Location = new System.Drawing.Point(1404, 985);
+      this.executionTimeTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+      this.executionTimeTextBox.Size = new System.Drawing.Size(204, 26);
       // 
       // executionTimeLabel
       // 
-      this.executionTimeLabel.Location = new System.Drawing.Point(847, 643);
+      this.executionTimeLabel.Location = new System.Drawing.Point(1270, 989);
+      this.executionTimeLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
       // 
       // pauseButton
       // 
-      this.pauseButton.Location = new System.Drawing.Point(36, 636);
+      this.pauseButton.Location = new System.Drawing.Point(54, 978);
+      this.pauseButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+      this.pauseButton.Size = new System.Drawing.Size(36, 37);
       this.toolTip.SetToolTip(this.pauseButton, "Pause Optimizer");
       // 
       // stopButton
       // 
-      this.stopButton.Location = new System.Drawing.Point(66, 636);
+      this.stopButton.Location = new System.Drawing.Point(99, 978);
+      this.stopButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+      this.stopButton.Size = new System.Drawing.Size(36, 37);
       this.toolTip.SetToolTip(this.stopButton, "Stop Optimizer");
       // 
       // resetButton
       // 
-      this.resetButton.Location = new System.Drawing.Point(96, 636);
+      this.resetButton.Location = new System.Drawing.Point(144, 978);
+      this.resetButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+      this.resetButton.Size = new System.Drawing.Size(36, 37);
       this.toolTip.SetToolTip(this.resetButton, "Reset Optimizer");
       // 
@@ -73,15 +84,24 @@
       this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
       this.errorProvider.SetIconPadding(this.nameTextBox, 2);
-      this.nameTextBox.Size = new System.Drawing.Size(1008, 20);
+      this.nameTextBox.Location = new System.Drawing.Point(87, 0);
+      this.nameTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+      this.nameTextBox.Size = new System.Drawing.Size(1510, 26);
+      // 
+      // nameLabel
+      // 
+      this.nameLabel.Location = new System.Drawing.Point(4, 5);
+      this.nameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
       // 
       // infoLabel
       // 
-      this.infoLabel.Location = new System.Drawing.Point(995, 3);
+      this.infoLabel.Location = new System.Drawing.Point(1492, 5);
+      this.infoLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+      this.infoLabel.Size = new System.Drawing.Size(24, 25);
       // 
       // tabControl
       // 
       this.tabControl.AllowDrop = true;
-      this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
-            | System.Windows.Forms.AnchorStyles.Left)
+      this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
       this.tabControl.Controls.Add(this.ensemblesTab);
@@ -89,8 +109,9 @@
       this.tabControl.Controls.Add(this.resultsTab);
       this.tabControl.Controls.Add(this.runsTab);
-      this.tabControl.Location = new System.Drawing.Point(3, 26);
+      this.tabControl.Location = new System.Drawing.Point(4, 40);
+      this.tabControl.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
       this.tabControl.Name = "tabControl";
       this.tabControl.SelectedIndex = 0;
-      this.tabControl.Size = new System.Drawing.Size(1070, 604);
+      this.tabControl.Size = new System.Drawing.Size(1605, 929);
       this.tabControl.TabIndex = 0;
       // 
@@ -99,8 +120,9 @@
       this.ensemblesTab.AllowDrop = true;
       this.ensemblesTab.Controls.Add(this.ensemblesViewHost);
-      this.ensemblesTab.Location = new System.Drawing.Point(4, 22);
+      this.ensemblesTab.Location = new System.Drawing.Point(4, 29);
+      this.ensemblesTab.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
       this.ensemblesTab.Name = "ensemblesTab";
-      this.ensemblesTab.Padding = new System.Windows.Forms.Padding(3);
-      this.ensemblesTab.Size = new System.Drawing.Size(527, 259);
+      this.ensemblesTab.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
+      this.ensemblesTab.Size = new System.Drawing.Size(1597, 896);
       this.ensemblesTab.TabIndex = 0;
       this.ensemblesTab.Text = "Ensembles";
@@ -118,8 +140,9 @@
       this.ensemblesViewHost.Dock = System.Windows.Forms.DockStyle.Fill;
       this.ensemblesViewHost.Enabled = false;
-      this.ensemblesViewHost.Location = new System.Drawing.Point(3, 3);
+      this.ensemblesViewHost.Location = new System.Drawing.Point(4, 5);
+      this.ensemblesViewHost.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
       this.ensemblesViewHost.Name = "ensemblesViewHost";
       this.ensemblesViewHost.ReadOnly = false;
-      this.ensemblesViewHost.Size = new System.Drawing.Size(521, 253);
+      this.ensemblesViewHost.Size = new System.Drawing.Size(1589, 886);
       this.ensemblesViewHost.TabIndex = 0;
       this.ensemblesViewHost.ViewsLabelVisible = true;
@@ -130,8 +153,9 @@
       this.datastreamTab.AllowDrop = true;
       this.datastreamTab.Controls.Add(this.datastreamViewHost);
-      this.datastreamTab.Location = new System.Drawing.Point(4, 22);
+      this.datastreamTab.Location = new System.Drawing.Point(4, 29);
+      this.datastreamTab.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
       this.datastreamTab.Name = "datastreamTab";
-      this.datastreamTab.Padding = new System.Windows.Forms.Padding(3);
-      this.datastreamTab.Size = new System.Drawing.Size(950, 554);
+      this.datastreamTab.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
+      this.datastreamTab.Size = new System.Drawing.Size(1597, 896);
       this.datastreamTab.TabIndex = 1;
       this.datastreamTab.Text = "Datastream";
@@ -147,8 +171,9 @@
       this.datastreamViewHost.Dock = System.Windows.Forms.DockStyle.Fill;
       this.datastreamViewHost.Enabled = false;
-      this.datastreamViewHost.Location = new System.Drawing.Point(3, 3);
+      this.datastreamViewHost.Location = new System.Drawing.Point(4, 5);
+      this.datastreamViewHost.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
       this.datastreamViewHost.Name = "datastreamViewHost";
       this.datastreamViewHost.ReadOnly = false;
-      this.datastreamViewHost.Size = new System.Drawing.Size(944, 548);
+      this.datastreamViewHost.Size = new System.Drawing.Size(1589, 886);
       this.datastreamViewHost.TabIndex = 0;
       this.datastreamViewHost.ViewsLabelVisible = true;
@@ -158,12 +183,14 @@
       // 
       this.resultsTab.Controls.Add(this.resultsView);
-      this.resultsTab.Location = new System.Drawing.Point(4, 22);
+      this.resultsTab.Location = new System.Drawing.Point(4, 29);
+      this.resultsTab.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
+      this.resultsTab.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
       this.resultsTab.Name = "resultsTab";
-      this.resultsTab.Size = new System.Drawing.Size(950, 554);
+      this.resultsTab.Size = new System.Drawing.Size(1597, 896);
       this.resultsTab.TabIndex = 3;
       this.resultsTab.Text = "Results";
       this.resultsTab.UseVisualStyleBackColor = true;
       // 
-      // resultsViewHost
+      // resultsView
       // 
       this.resultsView.Caption = "View";
@@ -171,33 +198,35 @@
       this.resultsView.Dock = System.Windows.Forms.DockStyle.Fill;
       this.resultsView.Enabled = false;
-      this.resultsView.Location = new System.Drawing.Point(0, 0);
-      this.resultsView.Name = "resultsViewHost";
-      this.resultsView.ReadOnly = false;
-      this.resultsView.Size = new System.Drawing.Size(950, 554);
+      this.resultsView.Location = new System.Drawing.Point(4, 5);
+      this.resultsView.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+      this.resultsView.Name = "resultsView";
+      this.resultsView.ReadOnly = true;
+      this.resultsView.ShowDetails = true;
+      this.resultsView.Size = new System.Drawing.Size(1597, 896);
       this.resultsView.TabIndex = 0;
-      //
+      // 
       // runsTab
-      //
-      //this.runsTabPage.Controls.Add(this.storeAlgorithmInEachRunCheckBox);
+      // 
       this.runsTab.Controls.Add(this.runsView);
-      this.runsTab.Location = new System.Drawing.Point(4, 22);
-      this.runsTab.Name = "runsTabPage";
-      this.runsTab.Padding = new System.Windows.Forms.Padding(3);
-      this.runsTab.Size = new System.Drawing.Size(950, 554);
+      this.runsTab.Location = new System.Drawing.Point(4, 29);
+      this.runsTab.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+      this.runsTab.Name = "runsTab";
+      this.runsTab.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
+      this.runsTab.Size = new System.Drawing.Size(1597, 896);
       this.runsTab.TabIndex = 3;
       this.runsTab.Text = "Runs";
       this.runsTab.UseVisualStyleBackColor = true;
-      //
+      // 
       // runsView
-      //
-      this.runsView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
-      | System.Windows.Forms.AnchorStyles.Left)
-      | System.Windows.Forms.AnchorStyles.Right)));
+      // 
       this.runsView.Caption = "RunCollection View";
       this.runsView.Content = null;
-      this.runsView.Location = new System.Drawing.Point(0, 0);
+      this.runsView.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.runsView.Enabled = false;
+      this.runsView.Location = new System.Drawing.Point(4, 5);
+      this.runsView.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
       this.runsView.Name = "runsView";
       this.runsView.ReadOnly = false;
-      this.runsView.Size = new System.Drawing.Size(950, 554);
+      this.runsView.Size = new System.Drawing.Size(1589, 886);
       this.runsView.TabIndex = 0;
       // 
@@ -205,9 +234,10 @@
       // 
       this.AllowDrop = true;
-      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
       this.Controls.Add(this.tabControl);
+      this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
       this.Name = "DatastreamAnalysisOptimizerView";
-      this.Size = new System.Drawing.Size(1076, 663);
+      this.Size = new System.Drawing.Size(1614, 1020);
       this.Controls.SetChildIndex(this.tabControl, 0);
       this.Controls.SetChildIndex(this.nameLabel, 0);
@@ -225,4 +255,5 @@
       this.datastreamTab.ResumeLayout(false);
       this.resultsTab.ResumeLayout(false);
+      this.runsTab.ResumeLayout(false);
       this.ResumeLayout(false);
       this.PerformLayout();
Index: /branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/DatastreamAnalysisOptimizerView.cs
===================================================================
--- /branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/DatastreamAnalysisOptimizerView.cs	(revision 14537)
+++ /branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/DatastreamAnalysisOptimizerView.cs	(revision 14538)
@@ -75,5 +75,7 @@
         runsView.Content = null;
       } else {
+        ensemblesViewHost.ViewType = null;
         ensemblesViewHost.Content = Content.Ensembles;
+        datastreamViewHost.ViewType = null;
         datastreamViewHost.Content = Content.Datastream;
         resultsView.Content = Content.Results.AsReadOnly();
@@ -84,4 +86,5 @@
     protected override void SetEnabledStateOfControls() {
       base.SetEnabledStateOfControls();
+
       resultsView.Enabled = Content != null;
       runsView.Enabled = Content != null;
@@ -118,5 +121,5 @@
     }
 
-    #region
+    #region content events
     protected override void Content_Prepared(object sender, EventArgs e) {
       if (InvokeRequired)
@@ -132,4 +135,5 @@
         Invoke(new EventHandler(Content_EnsemblesChanged), sender, e);
       else {
+        ensemblesViewHost.ViewType = null;
         ensemblesViewHost.Content = Content.Ensembles;
       }
Index: /branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/HeuristicLab.DatastreamAnalysis.Views.csproj
===================================================================
--- /branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/HeuristicLab.DatastreamAnalysis.Views.csproj	(revision 14537)
+++ /branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/HeuristicLab.DatastreamAnalysis.Views.csproj	(revision 14538)
@@ -121,4 +121,7 @@
   </ItemGroup>
   <ItemGroup>
+    <EmbeddedResource Include="DatastreamAnalysisOptimizerView.resx">
+      <DependentUpon>DatastreamAnalysisOptimizerView.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="RegressionEnsembleModelView.resx">
       <DependentUpon>RegressionEnsembleModelView.cs</DependentUpon>
Index: /branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/Plugin.cs
===================================================================
--- /branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/Plugin.cs	(revision 14537)
+++ /branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/Plugin.cs	(revision 14538)
@@ -23,5 +23,5 @@
 
 namespace HeuristicLab.DatastreamAnalysis.Views {
-  [Plugin("HeuristicLab.DatastreamAnalysis.Views", "3.4.14.14491")]
+  [Plugin("HeuristicLab.DatastreamAnalysis.Views", "3.4.14.14536")]
   [PluginFile("HeuristicLab.DatastreamAnalysis.Views-3.4.dll", PluginFileType.Assembly)]
   [PluginDependency("HeuristicLab.Collections", "3.3")]
Index: /branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/Properties/AssemblyInfo.cs
===================================================================
--- /branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/Properties/AssemblyInfo.cs	(revision 14537)
+++ /branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/Properties/AssemblyInfo.cs	(revision 14538)
@@ -54,3 +54,3 @@
 // [assembly: AssemblyVersion("1.0.*")]
 [assembly: AssemblyVersion("3.4.0.0")]
-[assembly: AssemblyFileVersion("3.4.14.14491")]
+[assembly: AssemblyFileVersion("3.4.14.14536")]
Index: /branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/Datastream.cs
===================================================================
--- /branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/Datastream.cs	(revision 14537)
+++ /branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/Datastream.cs	(revision 14538)
@@ -43,4 +43,5 @@
     protected const string SlidingWindowStepWidthParameterName = "SlidingWindowStepWidth";
     protected const string SlidingWindowMovementIntervalParameterName = "SlidingWindowMovementInterval";
+    protected const string FitnessPartitionParameterName = "FitnessPartition";
 
     #region parameter properites
@@ -50,20 +51,23 @@
     }
 
-    public IFixedValueParameter<IntRange> InitialSlidingWindowParameter {
-      get { return (IFixedValueParameter<IntRange>) Parameters[InitialSlidingWindowParameterName]; }
-    }
-
-    public IFixedValueParameter<IntValue> SlidingWindowSizeParameter {
-      get { return (IFixedValueParameter<IntValue>)Parameters[InitialSlidingWindowParameterName]; }
-    }
-
-    public IFixedValueParameter<IntValue> SlidingWindowStepWidthParameter {
-      get { return (IFixedValueParameter<IntValue>)Parameters[SlidingWindowStepWidthParameterName]; }
-    }
-
-    public IFixedValueParameter<IntValue> SlidingWindowMovementIntervalParameter {
-      get { return (IFixedValueParameter<IntValue>)Parameters[SlidingWindowMovementIntervalParameterName]; }
-    }
-
+    public IValueParameter<IntRange> InitialSlidingWindowParameter {
+      get { return (IValueParameter<IntRange>) Parameters[InitialSlidingWindowParameterName]; }
+    }
+
+    public IValueParameter<IntValue> SlidingWindowSizeParameter {
+      get { return (IValueParameter<IntValue>) Parameters[SlidingWindowSizeParameterName]; }
+    }
+
+    public IValueParameter<IntValue> SlidingWindowStepWidthParameter {
+      get { return (IValueParameter<IntValue>) Parameters[SlidingWindowStepWidthParameterName]; }
+    }
+
+    public IValueParameter<IntValue> SlidingWindowMovementIntervalParameter {
+      get { return (IValueParameter<IntValue>) Parameters[SlidingWindowMovementIntervalParameterName]; }
+    }
+
+    //public IValueParameter<IntRange> FitnessPartitionParameter {
+    //  get { return (IValueParameter<IntRange>) Parameters[FitnessPartitionParameterName]; }
+    //}
 
     #endregion
@@ -75,23 +79,28 @@
       set {
         if(value == null) throw new ArgumentNullException("problemData", "The provided value for the problemData is null.");
-        if (value == ProblemData) return;
         ProblemDataParameter.Value = value;
-      }
-    }
+        //OnProblemDataChanged();
+      }
+    }
+    
 
     public IntRange InitialSlidingWindow {
       get { return InitialSlidingWindowParameter.Value; }
+      set { InitialSlidingWindowParameter.Value = value; }
     }
 
     public IntValue SlidingWindowSize {
       get { return SlidingWindowSizeParameter.Value; }
+      set { SlidingWindowSizeParameter.Value = value; }
     }
 
     public IntValue SlidingWindowStepWidth {
       get { return SlidingWindowStepWidthParameter.Value; }
+      set { SlidingWindowStepWidthParameter.Value = value; }
     }
 
     public IntValue SlidingWindowMovementInterval {
       get { return SlidingWindowMovementIntervalParameter.Value; }
+      set { SlidingWindowMovementIntervalParameter.Value = value; }
     }
 
@@ -101,10 +110,16 @@
 
     public IntRange FitnessPartition { get; set; }
+
+    public bool UpdateAvailable {
+      get { return false; }
+    }
 
     public bool SlidingWindowMovementPossible {
       get {
         return ProblemData != null && ProblemData.Dataset != null &&
-               FitnessPartition.End + SlidingWindowStepWidth.Value <= ProblemData.Dataset.Rows;
-        // TODO: add external datastream, hub, etc to condition
+               (
+                (FitnessPartition.End + SlidingWindowStepWidth.Value <= ProblemData.Dataset.Rows) // shift end
+                || (FitnessPartition.Size > SlidingWindowSize.Value && (FitnessPartition.Start + SlidingWindowStepWidth.Value) < FitnessPartition.End) // shift start
+               );
       }
     }
@@ -112,6 +127,6 @@
     public bool SlidingWindowEvaluationPossible {
       get {
-        return ProblemData != null && ProblemData.Dataset != null &&
-               FitnessPartition.Size > 0;
+        //return ProblemData != null && ProblemData.Dataset != null && ProblemData.Dataset.Rows > 0 && FitnessPartition.Size > 0;
+        return FitnessPartition.Size > 0;
       }
     }
@@ -120,13 +135,24 @@
       if (ProblemData?.Dataset == null || ProblemData.Dataset.Rows == 0) return false;
       if (FitnessPartition.End + SlidingWindowStepWidth.Value > ProblemData.Dataset.Rows) return false;
-      
-      if (FitnessPartition.Size > SlidingWindowSize.Value) {
-        FitnessPartition.Start += SlidingWindowStepWidth.Value;
-      } else if (FitnessPartition.Size == SlidingWindowSize.Value) {
+
+      if (FitnessPartition.Size == SlidingWindowSize.Value) {
         FitnessPartition.Start += SlidingWindowStepWidth.Value;
         FitnessPartition.End += SlidingWindowStepWidth.Value;
-      } else {
+      } else { 
         FitnessPartition.End += SlidingWindowStepWidth.Value;
-      }   
+        FitnessPartition.Start += FitnessPartition.End - SlidingWindowSize.Value;
+      } 
+
+      //if (FitnessPartition.Size > SlidingWindowSize.Value) {
+      //  FitnessPartition.Start += SlidingWindowStepWidth.Value;
+      //} else if (FitnessPartition.Size == SlidingWindowSize.Value) {
+      //  FitnessPartition.Start += SlidingWindowStepWidth.Value;
+      //  FitnessPartition.End += SlidingWindowStepWidth.Value;
+      //} else {
+      //  FitnessPartition.End += SlidingWindowStepWidth.Value;
+      //  if (FitnessPartition.Size > SlidingWindowSize.Value) {
+      //    FitnessPartition.Start = FitnessPartition.End - FitnessPartition.Size;
+      //  }
+      //}   
       return true;
     }
@@ -141,8 +167,10 @@
     private void AfterDeserialization() {
       RegisterParameterEvents();
+      RecoverState();
     }
 
     protected Datastream(Datastream original, Cloner cloner) : base(original, cloner) {
       RegisterParameterEvents();
+      RecoverState();
     }
 
@@ -151,16 +179,16 @@
     }
 
-    public Datastream() {
+    public Datastream() : base() {
       Parameters.Add(new ValueParameter<RegressionProblemData>(ProblemDataParameterName, "ProblemData for analysis with selected ensembles.", null));
-      Parameters.Add(new FixedValueParameter<IntRange>(InitialSlidingWindowParameterName, "Initial sliding window boundaries", new IntRange(0, 1)));
-      Parameters.Add(new FixedValueParameter<IntValue>(SlidingWindowSizeParameterName, "Sliding window size", new IntValue(1)));
+      Parameters.Add(new FixedValueParameter<IntRange>(InitialSlidingWindowParameterName, "Initial sliding window boundaries", new IntRange(0, 5)));
+      Parameters.Add(new FixedValueParameter<IntValue>(SlidingWindowSizeParameterName, "Sliding window size", new IntValue(5)));
       Parameters.Add(new FixedValueParameter<IntValue>(SlidingWindowStepWidthParameterName, "Sliding window step width", new IntValue(1)));
-      Parameters.Add(new FixedValueParameter<IntValue>(SlidingWindowMovementIntervalParameterName, "Sliding window movement interval (milliseconds)", new IntValue(1000)));
+      Parameters.Add(new FixedValueParameter<IntValue>(SlidingWindowMovementIntervalParameterName, "Sliding window movement interval (milliseconds)", new IntValue(2000)));
+      RegisterParameterEvents();
       InitializeState();
     }
     #endregion
 
-
-    public void InitializeState() {
+    public void InitializeState(){
       if (ProblemData == null || ProblemData.Dataset == null || ProblemData.Dataset.Rows == 0) {
         FitnessPartition = new IntRange(0, 0);
@@ -173,9 +201,34 @@
     }
 
+    public void RecoverState() {
+      if (ProblemData == null || ProblemData.Dataset == null || ProblemData.Dataset.Rows == 0) {
+        FitnessPartition = new IntRange(0, 0);
+      } else {
+        if(FitnessPartition == null) FitnessPartition = (IntRange)InitialSlidingWindow.Clone();
+        if (FitnessPartition.End > ProblemData.Dataset.Rows) {
+          FitnessPartition.End = ProblemData.Dataset.Rows;
+        }
+      }
+    }
+
     public event EventHandler ProblemDataChanged;
-
+    public event EventHandler Reset;
+    public event EventHandler SlidingWindowChanged;
+
+
+    //protected virtual void OnProblemDataChanged() {
+    //  EventHandler handler = ProblemDataChanged;
+    //  if(handler != null) handler(this, EventArgs.Empty);
+    //}
+
+    //protected virtual void OnReset() {
+    //  EventHandler handler = Reset;
+    //  if (handler != null) handler(this, EventArgs.Empty);
+    //}
 
     private void RegisterParameterEvents() {
       ProblemDataParameter.ValueChanged += new EventHandler(ProblemData_ValueChanged);
+      //SlidingWindowSizeParameter.ValueChanged += new EventHandler(SlidingWindow_Changed);
+      InitialSlidingWindowParameter.ValueChanged += new EventHandler(SlidingWindow_Changed);
     }
 
@@ -183,9 +236,16 @@
       if (e == null) return;
 
+      InitializeState();
       DatastreamAnalysisUtil.RaiseEvent(this, ProblemDataChanged);
     }
 
+    private void SlidingWindow_Changed(object sender, EventArgs e) {
+      InitializeState();
+    }
+
+
+    // TODO
+    public IEnumerable<IParameterizedItem> ExecutionContextItems { get; }
     
-
   }
 }
Index: /branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/DatastreamAnalysisOptimizer.cs
===================================================================
--- /branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/DatastreamAnalysisOptimizer.cs	(revision 14537)
+++ /branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/DatastreamAnalysisOptimizer.cs	(revision 14538)
@@ -24,4 +24,5 @@
 using System;
 using System.Collections.Generic;
+using System.ComponentModel;
 using System.Diagnostics;
 using System.Drawing;
@@ -76,4 +77,6 @@
     private bool stopPending;
     private DateTime lastUpdateTime;
+    private bool prepared;
+    private bool finished;
 
     [Storable]
@@ -106,6 +109,10 @@
         if (value == null || value == ensembles)
           return;
-
+        if(!(value is IRegressionEnsembleModel)) throw new ArgumentException("Invaid ensemble model type");
+        DeregisterEnsembleEvents();
         ensembles = value;
+        RegisterEnsembleEvents();
+        OnEnsemblesChanged();
+        Prepare();
       }
     }
@@ -121,6 +128,10 @@
         if (value == null || value == datastream)
           return;
-
+        if(!(value is IDatastream)) throw new ArgumentException("Invalid datastream type");
+        DeregisterDatastreamEvents();
         datastream = value;
+        RegisterDatastreamEvents();
+        OnDatastreamChanged();
+        Prepare();
       }
     }
@@ -128,19 +139,47 @@
     #endregion properties
 
-    #region ResultsProperties
-    private double ResultsBestQuality
-    {
+    #region results properties
+    private int ResultsSlidingWindowMovements {
+      get { return ((IntValue)Results["Sliding Window Movements"].Value).Value; }
+      set { ((IntValue)Results["Sliding Window Movements"].Value).Value = value; }
+    }
+    private double ResultsBestQuality {
       get { return ((DoubleValue)Results["Best Quality"].Value).Value; }
       set { ((DoubleValue)Results["Best Quality"].Value).Value = value; }
     }
-    private DataTable ResultsQualities
-    {
+    private DataTable ResultsQualities {
       get { return ((DataTable)Results["Qualities"].Value); }
     }
+
+    private const string ResultsQualitiesR2 = "R²";
+    private const string ResultsQualitiesPearson = "Pearson";
+
+    private DataTable ResultsTargets {
+      get { return ((DataTable) Results["Targets"].Value); }
+    }
+
+    private const string ResultsTargetsReal = "Real";
+
+    protected void SetupResults() {
+      Results.Clear();
+
+      Results.Add(new Result("Sliding Window Movements", new IntValue(0)));
+      Results.Add(new Result("Best Quality", new DoubleValue(0)));
+      Results.Add(new Result("Qualities", new DataTable("Qualities")));
+      Results.Add(new Result("Targets", new DataTable("Targets")));
+
+      ResultsQualities.Rows.Add(new DataRow(ResultsQualitiesR2));
+      ResultsQualities.Rows.Add(new DataRow(ResultsQualitiesPearson));
+      ResultsTargets.Rows.Add(new DataRow(ResultsTargetsReal));
+      foreach (var ensemble in Ensembles) {
+        ResultsTargets.Rows.Add(new DataRow(ensemble.Name));
+      }
+    }
+
     #endregion
 
     #region constructors, cloner,...
 
-    public DatastreamAnalysisOptimizer() {
+    public DatastreamAnalysisOptimizer() : base() {
       name = "Datastream Analysis";
       log = new Log();
@@ -159,5 +198,5 @@
     [StorableHook(HookType.AfterDeserialization)]
     private void AfterDeserialization() {
-      // nothing to do in here
+      Initialize();
     }
 
@@ -179,4 +218,6 @@
     private void Initialize() {
       if (runs != null) RegisterRunsEvents();
+      if (datastream != null) RegisterDatastreamEvents();
+      if (ensembles != null) RegisterEnsembleEvents();
     }
     #endregion
@@ -185,12 +226,15 @@
 
     public override void Prepare() {
-      if (ensembles == null || datastream == null) return;
-      Prepare(true);
+      if (ensembles == null || ensembles.Count == 0 || datastream == null || !datastream.SlidingWindowEvaluationPossible) return;
+      //if (ensembles.SelectMany(x => x.Models).Count() == 0) return;
+      base.Prepare();
+      OnPrepared();
     }
 
     public void Prepare(bool clearRuns) {
-      if (ensembles == null || datastream == null) return;
+      if (ensembles == null || ensembles.Count == 0 || datastream == null || !datastream.SlidingWindowEvaluationPossible) return;
+
       base.Prepare();
-      if (clearRuns) results.Clear();
+      if (clearRuns) runs.Clear();
       OnPrepared();
     }
@@ -201,4 +245,9 @@
       cancellationTokenSource = new CancellationTokenSource();
       stopPending = false;
+
+      if (prepared) {
+        SetupResults();
+        //prepared = false;
+      }
 
       Task task = Task.Factory.StartNew(Run, cancellationTokenSource.Token, cancellationTokenSource.Token);
@@ -219,7 +268,11 @@
 
         // handle stop/pause
-        if(stopPending) { }
-        if(!Datastream.SlidingWindowMovementPossible) OnStopped();
-        else OnPaused();
+        if (stopPending || finished) {
+          OnStopped();
+        } else {
+          OnPaused();
+        }
+        //if(!Datastream.SlidingWindowMovementPossible) OnStopped();
+        //else OnPaused();
       });
 
@@ -244,4 +297,11 @@
 
     protected override void OnPrepared() {
+      ExecutionTime = TimeSpan.Zero;
+      foreach (IStatefulItem statefulItem in this.GetObjectGraphObjects(new HashSet<object>() {Runs}).OfType<IStatefulItem>()) {
+        statefulItem.InitializeState();
+      }
+      results.Clear();
+      prepared = true;
+      finished = false;
       Log.LogMessage("Datastream analysis prepared");
       base.OnPrepared();
@@ -259,11 +319,22 @@
 
     protected override void OnStopped() {
-      Log.LogMessage("Datastream analysis stopped");
-      base.OnStopped();
+      try {
+        runsCounter++;
+        var run = new Run();
+        run.Filename = Filename;
+        run.Name = string.Format("{0} Run {1}", Name, runsCounter);
+        CollectParameterValues(run.Parameters);
+        CollectResultValues(run.Results);
+        runs.Add(run);
+      }
+      finally {
+        Log.LogMessage("Datastream analysis stopped");
+        base.OnStopped();
+      }
     }
 
     #endregion
 
-
+    #region run
     private void Run(object state) {
       CancellationToken cancellationToken = (CancellationToken) state;
@@ -287,46 +358,64 @@
     }
 
+    private int replayedIndex;
+
     protected void Run(CancellationToken cancellationToken) {
-
-      // setup results
-      var slidingWindowMovements = new IntValue(0);
-      Results.Add(new Result("Sliding Window Movements", slidingWindowMovements));
-
-      var qtable = new DataTable("Qualities");
-      qtable.Rows.Add(new DataRow("R²"));
-      qtable.Rows.Add(new DataRow("Pearson"));
-      Results.Add(new Result("Qualities", qtable));
-
-      var curLoss = new DoubleValue();
-      Results.Add(new Result("R²", curLoss));
-      Results.Add(new Result("Best Quality", curLoss));
-
-
       // init algorithm
       var problemData = Datastream.ProblemData;
       var targetVarName = problemData.TargetVariable;
       var activeVariables = problemData.AllowedInputVariables;
+
+      if (prepared) {
+        // replay datastream until FitnessPartition.End
+        //for (int i = 0; i < Datastream.FitnessPartition.End; i++) {
+        //  var val = problemData.Dataset.GetDoubleValue(targetVarName, i);
+        //  ResultsTargets.Rows[ResultsTargetsReal].Values.Add(val);
+        //}
+        //replayedIndex = Datastream.FitnessPartition.End;
+        replayedIndex = 0;
+        prepared = false;
+      }
+
+
       Random rnd = new Random();
 
       try {
-        while (Datastream.SlidingWindowMovementPossible) {
-          cancellationToken.ThrowIfCancellationRequested();
-
-          Task.Delay(Datastream.SlidingWindowMovementInterval.Value);
-
-          Datastream.MoveSlidingWindow();
-
-          // TODO do the window evaluation
-
-          // TODO: collect results and display them
-
-          curLoss.Value = rnd.Next(100);
-          qtable.Rows["R²"].Values.Add(curLoss.Value);
-          qtable.Rows["Pearson"].Values.Add(curLoss.Value % 10);
-
-          slidingWindowMovements.Value++;
-        }
-
-        // TODO: collect runs (c.f. goal seeking)
+        do {
+          do {
+            cancellationToken.ThrowIfCancellationRequested();
+
+            Thread.Sleep(Datastream.SlidingWindowMovementInterval.Value);
+            Datastream.MoveSlidingWindow();
+
+            if (Datastream.SlidingWindowEvaluationPossible) {
+              foreach (var ensemble in Ensembles) {
+                // TODO do the window evaluation
+                double estimatedVal = problemData.Dataset.GetDoubleValue(targetVarName, replayedIndex)
+                                      * (1.0 + (((double)rnd.Next(0, 30)) / 100));
+                for (int i = replayedIndex; i < Datastream.FitnessPartition.End; i++) {
+                  ResultsTargets.Rows[ensemble.Name].Values.Add(estimatedVal);
+                }
+              }
+            }
+
+            // replay datastream until FitnessPartition.End
+            for (int i = replayedIndex; i < Datastream.FitnessPartition.End; i++) {
+              var val = problemData.Dataset.GetDoubleValue(targetVarName, i);
+              ResultsTargets.Rows[ResultsTargetsReal].Values.Add(val);
+            }
+            replayedIndex = Datastream.FitnessPartition.End;
+
+
+            // TODO: collect results and display them
+
+            int exp = rnd.Next(100);
+            ResultsQualities.Rows[ResultsQualitiesR2].Values.Add(exp);
+            ResultsQualities.Rows[ResultsQualitiesPearson].Values.Add((double)exp / 10);
+            ResultsSlidingWindowMovements++;
+            ResultsBestQuality = (double)exp / 42;
+
+          } while (Datastream.SlidingWindowMovementPossible);
+        } while (Datastream.UpdateAvailable);
+        finished = true;
       }
       catch (Exception ex) {
@@ -349,10 +438,21 @@
     }
 
+    public void CollectParameterValues(IDictionary<string, IItem> values) {
+      values.Add("Datastream Analysis Name", new StringValue(Name));
+      if (Datastream != null) {
+        Datastream.CollectParameterValues(values);
+        values.Add("Datastream Name", new StringValue(Datastream.Name));
+      }
+    }
+
     public void CollectResultValues(IDictionary<string, IItem> values) {
       values.Add("Execution Time", new TimeSpanValue(ExecutionTime));
       Results.CollectResultValues(values);
     }
+    #endregion
 
     #region events
+
+    #region events registration
 
     public EventHandler EnsemblesChanged;
@@ -367,9 +467,52 @@
     }
 
+    protected virtual void RegisterDatastreamEvents() {
+      datastream.Reset += new EventHandler(Datastream_Reset);
+      datastream.ProblemDataChanged += new EventHandler(Datastream_ProblemDataChanged);
+    }
+
+    protected virtual void DeregisterDatastreamEvents() {
+      datastream.Reset -= new EventHandler(Datastream_Reset);
+      datastream.ProblemDataChanged -= new EventHandler(Datastream_ProblemDataChanged);
+    }
+
+    protected virtual void RegisterEnsembleEvents() {
+      ensembles.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<RegressionEnsembleModel>>(Ensembles_ItemsChanged);
+      ensembles.ItemsMoved += new CollectionItemsChangedEventHandler<IndexedItem<RegressionEnsembleModel>>(Ensembles_ItemsChanged);
+      ensembles.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedItem<RegressionEnsembleModel>>(Ensembles_ItemsChanged);
+      ensembles.ItemsReplaced += new CollectionItemsChangedEventHandler<IndexedItem<RegressionEnsembleModel>>(Ensembles_ItemsChanged);
+      ensembles.CollectionReset += new CollectionItemsChangedEventHandler<IndexedItem<RegressionEnsembleModel>>(Ensembles_Reset);
+    }
+
+    protected virtual void DeregisterEnsembleEvents() {
+      ensembles.ItemsAdded -= new CollectionItemsChangedEventHandler<IndexedItem<RegressionEnsembleModel>>(Ensembles_ItemsChanged);
+      ensembles.ItemsMoved -= new CollectionItemsChangedEventHandler<IndexedItem<RegressionEnsembleModel>>(Ensembles_ItemsChanged);
+      ensembles.ItemsRemoved -= new CollectionItemsChangedEventHandler<IndexedItem<RegressionEnsembleModel>>(Ensembles_ItemsChanged);
+      ensembles.ItemsReplaced -= new CollectionItemsChangedEventHandler<IndexedItem<RegressionEnsembleModel>>(Ensembles_ItemsChanged);
+      ensembles.CollectionReset -= new CollectionItemsChangedEventHandler<IndexedItem<RegressionEnsembleModel>>(Ensembles_Reset);
+    }
+    #endregion
+
+    #region event handling
+
     protected virtual void Runs_CollectionReset(object sender, CollectionItemsChangedEventArgs<IRun> e) {
       runsCounter = runs.Count;
     }
 
-    #region event handling
+    protected virtual void Datastream_Reset(object sender, EventArgs e) {
+      Prepare();
+    }
+
+    protected virtual void Datastream_ProblemDataChanged(object sender, EventArgs e) {
+      Prepare();
+    }
+
+    protected virtual void Ensembles_Reset(object sender, EventArgs e) {
+      Prepare();
+    }
+
+    protected virtual void Ensembles_ItemsChanged(object sender, EventArgs e) {
+      Prepare();
+    }
 
     private void OnEnsemblesChanged() {
@@ -389,7 +532,8 @@
     #endregion
 
-    #region nameditem
-
-    [Storable] protected string name;
+    #region NamedItem
+
+    [Storable]
+    protected string name;
 
     /// <inheritdoc/>
Index: /branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/IDatastream.cs
===================================================================
--- /branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/IDatastream.cs	(revision 14537)
+++ /branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/IDatastream.cs	(revision 14538)
@@ -21,9 +21,16 @@
 
 using System;
+using System.Collections.Generic;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
 
 namespace HeuristicLab.DatastreamAnalysis {
-  public interface IDatastream : IParameterizedNamedItem, INamedItem, IItem, IContent, IDeepCloneable, ICloneable, IParameterizedItem {
+  /// <summary>
+  /// Interface to represent a datastream.
+  /// </summary>
+  public interface IDatastream : IParameterizedNamedItem {
+    IEnumerable<IParameterizedItem> ExecutionContextItems { get; }
+    event EventHandler Reset;
+    event EventHandler ProblemDataChanged;
   }
 }
Index: /branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/Plugin.cs
===================================================================
--- /branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/Plugin.cs	(revision 14537)
+++ /branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/Plugin.cs	(revision 14538)
@@ -23,5 +23,5 @@
 
 namespace HeuristicLab.DatastreamAnalysis {
-  [Plugin("HeuristicLab.DatastreamAnalysis", "3.4.14.14491")]
+  [Plugin("HeuristicLab.DatastreamAnalysis", "3.4.14.14536")]
   [PluginFile("HeuristicLab.DatastreamAnalysis-3.4.dll", PluginFileType.Assembly)]
   [PluginDependency("HeuristicLab.Collections", "3.3")]
Index: /branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/Properties/AssemblyInfo.cs
===================================================================
--- /branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/Properties/AssemblyInfo.cs	(revision 14537)
+++ /branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/Properties/AssemblyInfo.cs	(revision 14538)
@@ -54,3 +54,3 @@
 // [assembly: AssemblyVersion("1.0.*")]
 [assembly: AssemblyVersion("3.4.0.0")]
-[assembly: AssemblyFileVersion("3.4.14.14491")]
+[assembly: AssemblyFileVersion("3.4.14.14536")]
Index: /branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleModel.cs
===================================================================
--- /branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleModel.cs	(revision 14537)
+++ /branches/HeuristicLab.DatastreamAnalysis/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleModel.cs	(revision 14538)
@@ -82,9 +82,4 @@
     [StorableHook(HookType.AfterDeserialization)]
     private void AfterDeserialization() {
-
-      foreach (var model in Models) {
-        this.models.Add(model);
-      }
-
       // BackwardsCompatibility 3.3.14
       #region Backwards compatible code, remove with 3.4
