Index: /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/DatastreamAnalysisOptimizerView.cs
===================================================================
--- /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/DatastreamAnalysisOptimizerView.cs	(revision 15866)
+++ /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/DatastreamAnalysisOptimizerView.cs	(revision 15867)
@@ -107,7 +107,10 @@
     }
 
+    //protected override void startButton_Click(object sender, EventArgs e) {
+    //  base.startButton_Click(sender, e);
+    //}
+
     protected override void RegisterContentEvents() {
       base.RegisterContentEvents();
-
       Content.EnsemblesChanged += new EventHandler(Content_EnsemblesChanged);
       Content.DatastreamChanged += new EventHandler(Content_DatastreamChanged);
@@ -157,7 +160,7 @@
         try {
           var data = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
-          if (data is IRatedEnsembleModel) {
-            data = (IRatedEnsembleModel) data;
-            Content.Ensembles.Add((RatedEnsembleModel) data);
+          if (data is IProxyEnsembleModel) {
+            data = (IProxyEnsembleModel) data;
+            Content.Ensembles.Add((ProxyEnsembleModel) data);
           }
         }
@@ -175,5 +178,5 @@
       var data = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
 
-      if (data is IRatedEnsembleModel) {
+      if (data is IProxyEnsembleModel) {
         if ((e.KeyState & 32) == 32) e.Effect = DragDropEffects.Link; // ALT key
         else if ((e.KeyState & 4) == 4) e.Effect = DragDropEffects.Move; // SHIFT key
Index: /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/DatastreamAnalysisOptimizerView.resx
===================================================================
--- /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/DatastreamAnalysisOptimizerView.resx	(revision 15866)
+++ /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/DatastreamAnalysisOptimizerView.resx	(revision 15867)
@@ -119,5 +119,5 @@
   </resheader>
   <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>186, 17</value>
+    <value>140, 17</value>
   </metadata>
   <metadata name="errorProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
Index: /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/HeuristicLab.DatastreamAnalysis.Views.csproj
===================================================================
--- /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/HeuristicLab.DatastreamAnalysis.Views.csproj	(revision 15866)
+++ /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/HeuristicLab.DatastreamAnalysis.Views.csproj	(revision 15867)
@@ -20,5 +20,5 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
-    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
     <DefineConstants>DEBUG;TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
@@ -111,10 +111,4 @@
       <DependentUpon>DatastreamAnalysisOptimizerView.cs</DependentUpon>
     </Compile>
-    <Compile Include="Form1.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="Form1.Designer.cs">
-      <DependentUpon>Form1.cs</DependentUpon>
-    </Compile>
     <Compile Include="Plugin.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
@@ -148,7 +142,4 @@
       <DependentUpon>DatastreamAnalysisOptimizerView.cs</DependentUpon>
     </EmbeddedResource>
-    <EmbeddedResource Include="Form1.resx">
-      <DependentUpon>Form1.cs</DependentUpon>
-    </EmbeddedResource>
     <EmbeddedResource Include="RegressionEnsembleModelView.resx">
       <DependentUpon>RegressionEnsembleModelView.cs</DependentUpon>
Index: /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/HeuristicLab.DatastreamAnalysis.Views.csproj.user
===================================================================
--- /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/HeuristicLab.DatastreamAnalysis.Views.csproj.user	(revision 15866)
+++ /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/HeuristicLab.DatastreamAnalysis.Views.csproj.user	(revision 15867)
@@ -3,5 +3,6 @@
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
     <StartAction>Program</StartAction>
-    <StartProgram>C:\dev\workspaces\hl-core\trunk\sources\bin\HeuristicLab 3.3.exe</StartProgram>
+    <StartProgram>C:\dev\workspaces\hl-core\trunk\bin\HeuristicLab 3.3.exe</StartProgram>
+    <StartArguments>/start:Optimizer /hideStarter</StartArguments>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
Index: /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/Plugin.cs
===================================================================
--- /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/Plugin.cs	(revision 15866)
+++ /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/Plugin.cs	(revision 15867)
@@ -23,5 +23,5 @@
 
 namespace HeuristicLab.DatastreamAnalysis.Views {
-  [Plugin("HeuristicLab.DatastreamAnalysis.Views", "3.4.14.14710")]
+  [Plugin("HeuristicLab.DatastreamAnalysis.Views", "3.4.14.15025")]
   [PluginFile("HeuristicLab.DatastreamAnalysis.Views-3.4.dll", PluginFileType.Assembly)]
   [PluginDependency("HeuristicLab.Collections", "3.3")]
Index: /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/Properties/AssemblyInfo.cs
===================================================================
--- /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/Properties/AssemblyInfo.cs	(revision 15866)
+++ /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis.Views/3.4/Properties/AssemblyInfo.cs	(revision 15867)
@@ -54,3 +54,3 @@
 // [assembly: AssemblyVersion("1.0.*")]
 [assembly: AssemblyVersion("3.4.0.0")]
-[assembly: AssemblyFileVersion("3.4.14.14710")]
+[assembly: AssemblyFileVersion("3.4.14.15025")]
Index: /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/Datastream.cs
===================================================================
--- /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/Datastream.cs	(revision 15866)
+++ /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/Datastream.cs	(revision 15867)
@@ -39,4 +39,5 @@
 
     protected const string ProblemDataParameterName = "ProblemData";
+    protected const string DataSourceAddressParameterName = "DataSourceAdress";
     protected const string InitialSlidingWindowParameterName = "InitialSlidingWindowParameter";
     protected const string SlidingWindowSizeParameterName = "SlidingWindowSize";
@@ -45,29 +46,51 @@
     protected const string FitnessPartitionParameterName = "FitnessPartition";
     protected const string SlidingWindowSonarRatioParameterName = "SlidingWindowSonarRatio";
+    protected const string SlidingWindowEvaluationSchemeParameterName = "SlidingWindowEvaluationScheme";
 
     #region parameter properites
 
-    public IValueParameter<RegressionProblemData> ProblemDataParameter {
-      get { return (IValueParameter<RegressionProblemData>) Parameters[ProblemDataParameterName]; }  
-    }
-
-    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> SlidingWindowMovementDelayParameter {
-      get { return (IValueParameter<IntValue>) Parameters[SlidingWindowMovementDelayParameterName]; }
-    }
-
-    public IValueParameter<DoubleValue> SlidingWindowSonarRatioParameter {
-      get { return (IValueParameter<DoubleValue>) Parameters[SlidingWindowSonarRatioParameterName]; }
+    public enum EvaluationScheme { none, equal, linear, quadratic, cubic, exponential }
+
+    public IValueParameter<RegressionProblemData> ProblemDataParameter
+    {
+      get { return (IValueParameter<RegressionProblemData>)Parameters[ProblemDataParameterName]; }
+    }
+
+    public IValueParameter<StringValue> DataSourceAddressParameter
+    {
+      get { return (IValueParameter<StringValue>)Parameters[DataSourceAddressParameterName]; }
+    }
+
+    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> SlidingWindowMovementDelayParameter
+    {
+      get { return (IValueParameter<IntValue>)Parameters[SlidingWindowMovementDelayParameterName]; }
+    }
+
+    public IValueParameter<DoubleValue> SlidingWindowSonarRatioParameter
+    {
+      get { return (IValueParameter<DoubleValue>)Parameters[SlidingWindowSonarRatioParameterName]; }
+    }
+
+    public IValueParameter<EnumValue<EvaluationScheme>> SlidingWindowEvaluationSchemeParameter
+    {
+      get
+      {
+        return (IValueParameter<EnumValue<EvaluationScheme>>)Parameters[SlidingWindowEvaluationSchemeParameterName];
+      }
     }
 
@@ -80,39 +103,58 @@
     #region properties
 
-    public RegressionProblemData ProblemData {
+    public RegressionProblemData ProblemData
+    {
       get { return ProblemDataParameter.Value; }
-      set {
-        if(value == null) throw new ArgumentNullException("ProblemData", "The provided value for problemData is null.");
+      set
+      {
+        if (value == null) throw new ArgumentNullException("ProblemData", "The provided value for problemData is null.");
         ProblemDataParameter.Value = value;
         //OnProblemDataChanged();
       }
     }
-    
-
-    public IntRange InitialSlidingWindow {
+
+    public StringValue DataSourceAddress
+    {
+      get { return DataSourceAddressParameter.Value; }
+      set { DataSourceAddressParameter.Value = value; }
+    }
+
+    public IntRange InitialSlidingWindow
+    {
       get { return InitialSlidingWindowParameter.Value; }
       set { InitialSlidingWindowParameter.Value = value; }
     }
 
-    public IntValue SlidingWindowSize {
+    public IntValue SlidingWindowSize
+    {
       get { return SlidingWindowSizeParameter.Value; }
       set { SlidingWindowSizeParameter.Value = value; }
     }
 
-    public IntValue SlidingWindowStepWidth {
+    public IntValue SlidingWindowStepWidth
+    {
       get { return SlidingWindowStepWidthParameter.Value; }
       set { SlidingWindowStepWidthParameter.Value = value; }
     }
 
-    public IntValue SlidingWindowMovementDelay {
+    public IntValue SlidingWindowMovementDelay
+    {
       get { return SlidingWindowMovementDelayParameter.Value; }
       set { SlidingWindowMovementDelayParameter.Value = value; }
     }
 
-    public DoubleValue SlidingWindowSonarRatio {
+    public DoubleValue SlidingWindowSonarRatio
+    {
       get { return SlidingWindowSonarRatioParameter.Value; }
       set { SlidingWindowSonarRatioParameter.Value = value; }
     }
 
+    public EnumValue<EvaluationScheme> SlidingWindowEvaluationScheme
+    {
+      get { return SlidingWindowEvaluationSchemeParameter.Value; }
+      set { SlidingWindowEvaluationSchemeParameter.Value = value; }
+    }
+
+
     #endregion
 
@@ -121,10 +163,13 @@
     public IntRange FitnessPartition { get; set; }
 
-    public bool UpdateAvailable {
-      get { return false; }
-    }
-
-    public bool SlidingWindowMovementPossible {
-      get {
+    public bool UpdateAvailable
+    {
+      get { return !String.IsNullOrWhiteSpace(DataSourceAddress.Value); }
+    }
+
+    public bool SlidingWindowMovementPossible
+    {
+      get
+      {
         return ProblemData != null && ProblemData.Dataset != null &&
                (
@@ -135,6 +180,8 @@
     }
 
-    public bool SlidingWindowEvaluationPossible {
-      get {
+    public bool SlidingWindowEvaluationPossible
+    {
+      get
+      {
         //return ProblemData != null && ProblemData.Dataset != null && ProblemData.Dataset.Rows > 0 && FitnessPartition.Size > 0;
         return FitnessPartition.Size > 0;
@@ -149,8 +196,8 @@
         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) {
@@ -191,4 +238,5 @@
     public Datastream() : base() {
       Parameters.Add(new ValueParameter<RegressionProblemData>(ProblemDataParameterName, "ProblemData for analysis with selected ensembles.", null));
+      Parameters.Add(new FixedValueParameter<StringValue>(DataSourceAddressParameterName, "Source address of data stream", new StringValue("")));
       Parameters.Add(new FixedValueParameter<IntRange>(InitialSlidingWindowParameterName, "Initial sliding window boundaries", new IntRange(0, 100)));
       Parameters.Add(new FixedValueParameter<IntValue>(SlidingWindowSizeParameterName, "Sliding window size", new IntValue(100)));
@@ -196,4 +244,5 @@
       Parameters.Add(new FixedValueParameter<IntValue>(SlidingWindowMovementDelayParameterName, "Sliding window movement delay interval (milliseconds)", new IntValue(0)));
       Parameters.Add(new FixedValueParameter<DoubleValue>(SlidingWindowSonarRatioParameterName, "Sliding window sonar ratio", new DoubleValue(0.25)));
+      Parameters.Add(new FixedValueParameter<EnumValue<EvaluationScheme>>(SlidingWindowEvaluationSchemeParameterName, "Sliding window evaluation scheme", new EnumValue<EvaluationScheme>(EvaluationScheme.none)));
       RegisterParameterEvents();
       InitializeState();
@@ -201,5 +250,5 @@
     #endregion
 
-    public void InitializeState(){
+    public void InitializeState() {
       if (ProblemData == null || ProblemData.Dataset == null || ProblemData.Dataset.Rows == 0) {
         FitnessPartition = new IntRange(0, 0);
@@ -216,5 +265,5 @@
         FitnessPartition = new IntRange(0, 0);
       } else {
-        if(FitnessPartition == null) FitnessPartition = (IntRange)InitialSlidingWindow.Clone();
+        if (FitnessPartition == null) FitnessPartition = (IntRange)InitialSlidingWindow.Clone();
         if (FitnessPartition.End > ProblemData.Dataset.Rows) {
           FitnessPartition.End = ProblemData.Dataset.Rows;
@@ -258,5 +307,5 @@
     // TODO
     public IEnumerable<IParameterizedItem> ExecutionContextItems { get; }
-    
+
   }
 }
Index: /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/DatastreamAnalysisOptimizer.cs
===================================================================
--- /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/DatastreamAnalysisOptimizer.cs	(revision 15866)
+++ /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/DatastreamAnalysisOptimizer.cs	(revision 15867)
@@ -74,5 +74,5 @@
     }
 
-    private double lastStateValue;
+    //private double lastStateValue;
     private double pR2Sum;
     private int detectionCount;
@@ -108,12 +108,12 @@
 
     [Storable]
-    private IItemList<RatedEnsembleModel> ensembles;
-
-    public IItemList<RatedEnsembleModel> Ensembles {
+    private IItemList<ProxyEnsembleModel> ensembles;
+
+    public IItemList<ProxyEnsembleModel> Ensembles {
       get { return ensembles; }
       set {
         if (value == null || value == ensembles)
           return;
-        if (!(value is IRatedEnsembleModel)) throw new ArgumentException("Invaid ensemble model type");
+        if (!(value is IProxyEnsembleModel)) throw new ArgumentException("Invaid ensemble model type");
         DeregisterEnsembleEvents();
         ensembles = value;
@@ -214,5 +214,5 @@
     protected void SetupResults() {
       evaluationCount = 0;
-      lastStateValue = 0.0;
+      //lastStateValue = 0.0;
       pR2Sum = 0.0;
       exclusivitySum = 0.0;
@@ -267,5 +267,5 @@
       log = new Log();
       results = new ResultCollection();
-      ensembles = new ItemList<RatedEnsembleModel>();
+      ensembles = new ItemList<ProxyEnsembleModel>();
       datastream = new Datastream();
       runsCounter = 0;
@@ -287,5 +287,5 @@
       log = cloner.Clone(original.log);
       results = cloner.Clone(original.results);
-      ensembles = (ItemList<RatedEnsembleModel>) original.Ensembles.Clone(cloner);
+      ensembles = (ItemList<ProxyEnsembleModel>) original.Ensembles.Clone(cloner);
       datastream = (Datastream) original.Datastream.Clone(cloner);
       runsCounter = original.runsCounter;
@@ -322,8 +322,9 @@
     }
 
-    public override void Start() {
+    public override void Start(CancellationToken cancellationToken) {
+      base.Start(cancellationToken);
       if (ensembles == null || datastream == null) return;
-      base.Start();
-      cancellationTokenSource = new CancellationTokenSource();
+
+      cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
       stopPending = false;
 
@@ -450,5 +451,5 @@
         // play and evaluate initial window
         PlayDatastream();
-        lastStateValue = Datastream.ProblemData.Dataset.GetDoubleValue("h", replayedIndex);
+        //lastStateValue = Datastream.ProblemData.Dataset.GetDoubleValue("h", replayedIndex);
         if (Datastream.SlidingWindowEvaluationPossible) Evaluate();
         replayedIndex = Datastream.FitnessPartition.End;
@@ -490,5 +491,14 @@
       }
     }
-    
+
+    private void Smoothen(double[] estimatedValuesPerRow) {
+      if (Datastream.SlidingWindowEvaluationScheme.Value == Datastream.EvaluationScheme.equal) {
+        var avg = estimatedValuesPerRow.Average();
+        for (int i = 0; i < estimatedValuesPerRow.Length; i++) {
+          estimatedValuesPerRow[i] = avg;
+        }
+      }
+    }
+
     private void Evaluate() {
       evaluationCount++;
@@ -512,10 +522,11 @@
       var curDetectionCount = 0;
       var changeDetectionCount = 0;
-      double curStateValue = 0.0;
+      //double curStateValue = 0.0;
+
       foreach (var ensemble in Ensembles) {
 
         var sonarEstimatedValuesPerModelPerRow = ensemble.Model.Models.Select(x => x.GetEstimatedValues(datastream.ProblemData.Dataset, sonarRows).ToArray());
         var sonarEstimatedValuesPerRow = Enumerable.Range(0, sonarSize).Select(r => sonarEstimatedValuesPerModelPerRow.Select(m => m[r]).Average()).ToArray();
-
+        
         var estimatedValuesPerModelPerRow = ensemble.Model.Models.Select(x => x.GetEstimatedValues(datastream.ProblemData.Dataset, rows).ToArray());
         var estimatedValuesPerRow = Enumerable.Range(0, Datastream.FitnessPartition.Size).Select(r => estimatedValuesPerModelPerRow.Select(e => e[r]).Average()).ToArray(); // per row
@@ -550,4 +561,6 @@
         int replayCount = estimatedValuesPerRow.Length - replayAmount;
 
+        Smoothen(estimatedValuesPerRow);
+
         for (int i = replayedIndex; i < Datastream.FitnessPartition.End; i++) {
           //ResultsTargets.Rows[ensemble.Name].Values.Add(averageEstimatedValue);
@@ -594,17 +607,20 @@
       }
 
-      double replCount = 0.0;
-      double accCount = 0.0;
-      for (int i = replayedIndex; i < Datastream.FitnessPartition.End; i++) {
-        replCount++;
-        curStateValue = problemData.Dataset.GetDoubleValue("h", i);
-        if (curStateValue <= 0.5 && winningEnsembleIdx == 0 && winningEnsemblePR2 > ensembles[winningEnsembleIdx].QualityThreshold.Start) {
-          accCount++;
-        } else if (curStateValue > 0.5 && winningEnsembleIdx == 1 && winningEnsemblePR2 > ensembles[winningEnsembleIdx].QualityThreshold.Start) {
-          accCount++;
-        }
-      }
-      accuracySum += accCount / replCount;
-      ResultsDetectionAccuracy = accuracySum / evaluationCount;
+      //double replCount = 0.0;
+      //double accCount = 0.0;
+      //for (int i = replayedIndex; i < Datastream.FitnessPartition.End; i++) {
+      //  replCount++;
+      //  //curStateValue = problemData.Dataset.GetDoubleValue("h", i);
+      //  if (curStateValue <= 0.5 && winningEnsembleIdx == 0 && winningEnsemblePR2 > ensembles[winningEnsembleIdx].QualityThreshold.Start) {
+      //    accCount++;
+      //  } else if (curStateValue > 0.5 && winningEnsembleIdx == 1 && winningEnsemblePR2 > ensembles[winningEnsembleIdx].QualityThreshold.Start) {
+      //    accCount++;
+      //  }
+      //}
+      //accuracySum += accCount / replCount;
+      //ResultsDetectionAccuracy = accuracySum / evaluationCount;
+
+
+
 
       //if (accCount / replCount > 1.0) {
@@ -621,5 +637,5 @@
       //}
 
-      lastStateValue = curStateValue;
+      //lastStateValue = curStateValue;
 
       // detection of state change
@@ -650,5 +666,5 @@
     private bool accDiscount = false;
 
-    private double CalulateEnsembleConfidenceCM1(RatedEnsembleModel ensemble, IEnumerable<double[]> estimatedValuesPerModelPerRow, IEnumerable<double> realValues) {
+    private double CalulateEnsembleConfidenceCM1(ProxyEnsembleModel ensemble, IEnumerable<double[]> estimatedValuesPerModelPerRow, IEnumerable<double> realValues) {
       int noModels = estimatedValuesPerModelPerRow.Count();
       int votes = 0;
@@ -717,17 +733,17 @@
 
     protected virtual void RegisterEnsembleEvents() {
-      ensembles.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<RatedEnsembleModel>>(Ensembles_ItemsChanged);
-      ensembles.ItemsMoved += new CollectionItemsChangedEventHandler<IndexedItem<RatedEnsembleModel>>(Ensembles_ItemsChanged);
-      ensembles.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedItem<RatedEnsembleModel>>(Ensembles_ItemsChanged);
-      ensembles.ItemsReplaced += new CollectionItemsChangedEventHandler<IndexedItem<RatedEnsembleModel>>(Ensembles_ItemsChanged);
-      ensembles.CollectionReset += new CollectionItemsChangedEventHandler<IndexedItem<RatedEnsembleModel>>(Ensembles_Reset);
+      ensembles.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<ProxyEnsembleModel>>(Ensembles_ItemsChanged);
+      ensembles.ItemsMoved += new CollectionItemsChangedEventHandler<IndexedItem<ProxyEnsembleModel>>(Ensembles_ItemsChanged);
+      ensembles.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedItem<ProxyEnsembleModel>>(Ensembles_ItemsChanged);
+      ensembles.ItemsReplaced += new CollectionItemsChangedEventHandler<IndexedItem<ProxyEnsembleModel>>(Ensembles_ItemsChanged);
+      ensembles.CollectionReset += new CollectionItemsChangedEventHandler<IndexedItem<ProxyEnsembleModel>>(Ensembles_Reset);
     }
 
     protected virtual void DeregisterEnsembleEvents() {
-      ensembles.ItemsAdded -= new CollectionItemsChangedEventHandler<IndexedItem<RatedEnsembleModel>>(Ensembles_ItemsChanged);
-      ensembles.ItemsMoved -= new CollectionItemsChangedEventHandler<IndexedItem<RatedEnsembleModel>>(Ensembles_ItemsChanged);
-      ensembles.ItemsRemoved -= new CollectionItemsChangedEventHandler<IndexedItem<RatedEnsembleModel>>(Ensembles_ItemsChanged);
-      ensembles.ItemsReplaced -= new CollectionItemsChangedEventHandler<IndexedItem<RatedEnsembleModel>>(Ensembles_ItemsChanged);
-      ensembles.CollectionReset -= new CollectionItemsChangedEventHandler<IndexedItem<RatedEnsembleModel>>(Ensembles_Reset);
+      ensembles.ItemsAdded -= new CollectionItemsChangedEventHandler<IndexedItem<ProxyEnsembleModel>>(Ensembles_ItemsChanged);
+      ensembles.ItemsMoved -= new CollectionItemsChangedEventHandler<IndexedItem<ProxyEnsembleModel>>(Ensembles_ItemsChanged);
+      ensembles.ItemsRemoved -= new CollectionItemsChangedEventHandler<IndexedItem<ProxyEnsembleModel>>(Ensembles_ItemsChanged);
+      ensembles.ItemsReplaced -= new CollectionItemsChangedEventHandler<IndexedItem<ProxyEnsembleModel>>(Ensembles_ItemsChanged);
+      ensembles.CollectionReset -= new CollectionItemsChangedEventHandler<IndexedItem<ProxyEnsembleModel>>(Ensembles_Reset);
     }
     #endregion
Index: /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/HeuristicLab.DatastreamAnalysis.csproj
===================================================================
--- /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/HeuristicLab.DatastreamAnalysis.csproj	(revision 15866)
+++ /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/HeuristicLab.DatastreamAnalysis.csproj	(revision 15867)
@@ -18,5 +18,5 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
-    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
     <DefineConstants>DEBUG;TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
@@ -110,8 +110,8 @@
     <Compile Include="IAnalysisBase.cs" />
     <Compile Include="IDatastream.cs" />
-    <Compile Include="IRatedEnsembleModel.cs" />
+    <Compile Include="IProxyEnsembleModel.cs" />
     <Compile Include="Plugin.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="RatedEnsembleModel.cs" />
+    <Compile Include="ProxyEnsembleModel.cs" />
   </ItemGroup>
   <ItemGroup>
Index: /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/HeuristicLab.DatastreamAnalysis.csproj.user
===================================================================
--- /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/HeuristicLab.DatastreamAnalysis.csproj.user	(revision 15866)
+++ /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/HeuristicLab.DatastreamAnalysis.csproj.user	(revision 15867)
@@ -3,6 +3,6 @@
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
     <StartAction>Program</StartAction>
-    <StartProgram>C:\dev\workspaces\hl-core\trunk\sources\bin\HeuristicLab 3.3.exe</StartProgram>
-    <StartArguments>/hidestarter /start:Optimizer</StartArguments>
+    <StartProgram>C:\dev\workspaces\hl-core\trunk\bin\HeuristicLab 3.3.exe</StartProgram>
+    <StartArguments>/start:Optimizer /hideStarter</StartArguments>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
Index: /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/IProxyEnsembleModel.cs
===================================================================
--- /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/IProxyEnsembleModel.cs	(revision 15867)
+++ /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/IProxyEnsembleModel.cs	(revision 15867)
@@ -0,0 +1,14 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using HeuristicLab.Core;
+
+namespace HeuristicLab.DatastreamAnalysis {
+  public interface IProxyEnsembleModel : IParameterizedItem {
+    IEnumerable<IParameterizedItem> ExecutionContextItems { get; }
+    event EventHandler Reset;
+    event EventHandler ModelChanged;
+  }
+}
Index: /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/Plugin.cs
===================================================================
--- /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/Plugin.cs	(revision 15866)
+++ /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/Plugin.cs	(revision 15867)
@@ -23,5 +23,5 @@
 
 namespace HeuristicLab.DatastreamAnalysis {
-  [Plugin("HeuristicLab.DatastreamAnalysis", "3.4.14.14710")]
+  [Plugin("HeuristicLab.DatastreamAnalysis", "3.4.14.15025")]
   [PluginFile("HeuristicLab.DatastreamAnalysis-3.4.dll", PluginFileType.Assembly)]
   [PluginDependency("HeuristicLab.Collections", "3.3")]
Index: /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/Properties/AssemblyInfo.cs
===================================================================
--- /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/Properties/AssemblyInfo.cs	(revision 15866)
+++ /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/Properties/AssemblyInfo.cs	(revision 15867)
@@ -54,3 +54,3 @@
 // [assembly: AssemblyVersion("1.0.*")]
 [assembly: AssemblyVersion("3.4.0.0")]
-[assembly: AssemblyFileVersion("3.4.14.14710")]
+[assembly: AssemblyFileVersion("3.4.14.15025")]
Index: /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/ProxyEnsembleModel.cs
===================================================================
--- /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/ProxyEnsembleModel.cs	(revision 15867)
+++ /branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.DatastreamAnalysis/3.4/ProxyEnsembleModel.cs	(revision 15867)
@@ -0,0 +1,126 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 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.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Collections;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis;
+namespace HeuristicLab.DatastreamAnalysis {
+  [StorableClass]
+  [Item("Proxy Ensemble Model", "Represents a named and rated collection of models which acts as a model yet again.")]
+  [Creatable(CreatableAttribute.Categories.DataAnalysis)]
+  public class ProxyEnsembleModel : ParameterizedNamedItem, IProxyEnsembleModel {
+    protected const string ModelParameterName = "Model";
+    protected const string QualityThresholdParameterName = "QualityThreshold";
+    protected const string ConfidenceThresholdParameterName = "ConfidenceThreshold";
+
+    #region parameter properties
+
+    public IValueParameter<RegressionEnsembleModel> ModelParameter {
+      get { return (IValueParameter<RegressionEnsembleModel>) Parameters[ModelParameterName]; }
+    }
+
+    public IValueParameter<DoubleRange> QualityThresholdParameter {
+      get { return (IValueParameter<DoubleRange>) Parameters[QualityThresholdParameterName]; }
+    }
+
+    public IValueParameter<DoubleRange> ConfidenceThresholdParameter {
+      get { return (IValueParameter<DoubleRange>)Parameters[ConfidenceThresholdParameterName]; }
+    }
+
+    public RegressionEnsembleModel Model {
+      get { return ModelParameter.Value; }
+      set {
+        if(value == null) throw new ArgumentNullException("Model", "The provided value for model is null.");
+        ModelParameter.Value = value;
+      }
+    }
+
+    public DoubleRange QualityThreshold {
+      get { return QualityThresholdParameter.Value; }
+      set { QualityThresholdParameter.Value = value; }
+    }
+
+    public DoubleRange ConfidenceThreshold {
+      get { return ConfidenceThresholdParameter.Value; }
+      set { ConfidenceThresholdParameter.Value = value; }
+    }
+
+    #endregion
+
+    #region constructors, clone ...
+    [StorableConstructor]
+    protected ProxyEnsembleModel(bool deserializing) : base(deserializing) { }
+    protected ProxyEnsembleModel(ProxyEnsembleModel original, Cloner cloner) : base(original, cloner) {
+      RegisterParameterEvents();
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ProxyEnsembleModel(this, cloner);
+    }
+    public ProxyEnsembleModel() : base() {
+      Parameters.Add(new ValueParameter<RegressionEnsembleModel>(ModelParameterName, "Collection of models.", null));
+      Parameters.Add(new FixedValueParameter<DoubleRange>(QualityThresholdParameterName, "Quality threshold for the ensemble evaluation [0.0,1.0]", new DoubleRange(0.8,0.9)));
+      Parameters.Add(new FixedValueParameter<DoubleRange>(ConfidenceThresholdParameterName, "Confidence threshold for the ensemble evaluation [0.0,1.0]", new DoubleRange(0.8, 0.9)));
+      RegisterParameterEvents();
+    }
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      RegisterParameterEvents();
+    }
+    #endregion
+
+    public event EventHandler Reset;
+    public event EventHandler ModelChanged;
+    public event EventHandler QualityThresholdChanged;
+    public event EventHandler ConfidenceThresholdChanged;
+
+    private void RegisterParameterEvents() {
+      ModelParameter.ValueChanged += new EventHandler(Model_ValueChanged);
+      QualityThresholdParameter.ValueChanged += new EventHandler(QualityTreshold_ValueChanged);
+      ConfidenceThresholdParameter.ValueChanged += new EventHandler(ConfidenceTreshold_ValueChanged);
+    }
+
+    private void Model_ValueChanged(object sender, EventArgs e) {
+      if (e == null) return;
+      DatastreamAnalysisUtil.RaiseEvent(this, ModelChanged);
+    }
+
+    private void QualityTreshold_ValueChanged(object sender, EventArgs e) {
+      if (e == null) return;
+      DatastreamAnalysisUtil.RaiseEvent(this, QualityThresholdChanged);
+    }
+
+    private void ConfidenceTreshold_ValueChanged(object sender, EventArgs e) {
+      if (e == null) return;
+      DatastreamAnalysisUtil.RaiseEvent(this, ConfidenceThresholdChanged);
+    }
+
+    // TODO
+    public IEnumerable<IParameterizedItem> ExecutionContextItems { get; }
+  }
+}
