Index: trunk/sources/HeuristicLab.CEDMA.Server/3.3/DispatcherView.Designer.cs
===================================================================
--- trunk/sources/HeuristicLab.CEDMA.Server/3.3/DispatcherView.Designer.cs	(revision 2825)
+++ trunk/sources/HeuristicLab.CEDMA.Server/3.3/DispatcherView.Designer.cs	(revision 2843)
@@ -24,4 +24,5 @@
     /// </summary>
     private void InitializeComponent() {
+      this.components = new System.ComponentModel.Container();
       this.targetVariableList = new System.Windows.Forms.CheckedListBox();
       this.inputVariableList = new System.Windows.Forms.CheckedListBox();
@@ -30,13 +31,10 @@
       this.splitContainer = new System.Windows.Forms.SplitContainer();
       this.learningTaskGroupBox = new System.Windows.Forms.GroupBox();
+      this.editEngineButton = new System.Windows.Forms.Button();
       this.setAlgorithmDefault = new System.Windows.Forms.Button();
       this.autoregressiveLabel = new System.Windows.Forms.Label();
       this.classificationRadioButton = new System.Windows.Forms.RadioButton();
       this.algorithmsListBox = new System.Windows.Forms.CheckedListBox();
-      this.minTimeOffsetLabel = new System.Windows.Forms.Label();
-      this.minTimeOffsetTextBox = new System.Windows.Forms.TextBox();
-      this.maxTimeOffsetLabel = new System.Windows.Forms.Label();
       this.regressionRadioButton = new System.Windows.Forms.RadioButton();
-      this.maxTimeOffsetTextBox = new System.Windows.Forms.TextBox();
       this.timeSeriesRadioButton = new System.Windows.Forms.RadioButton();
       this.autoregressiveCheckBox = new System.Windows.Forms.CheckBox();
@@ -52,5 +50,5 @@
       this.testLabel = new System.Windows.Forms.Label();
       this.setAllButton = new System.Windows.Forms.Button();
-      this.editEngineButton = new System.Windows.Forms.Button();
+      this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components);
       this.splitContainer.Panel1.SuspendLayout();
       this.splitContainer.Panel2.SuspendLayout();
@@ -58,4 +56,5 @@
       this.learningTaskGroupBox.SuspendLayout();
       this.partitioningGroupBox.SuspendLayout();
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
       this.SuspendLayout();
       // 
@@ -136,9 +135,5 @@
       this.learningTaskGroupBox.Controls.Add(this.classificationRadioButton);
       this.learningTaskGroupBox.Controls.Add(this.algorithmsListBox);
-      this.learningTaskGroupBox.Controls.Add(this.minTimeOffsetLabel);
-      this.learningTaskGroupBox.Controls.Add(this.minTimeOffsetTextBox);
-      this.learningTaskGroupBox.Controls.Add(this.maxTimeOffsetLabel);
       this.learningTaskGroupBox.Controls.Add(this.regressionRadioButton);
-      this.learningTaskGroupBox.Controls.Add(this.maxTimeOffsetTextBox);
       this.learningTaskGroupBox.Controls.Add(this.timeSeriesRadioButton);
       this.learningTaskGroupBox.Controls.Add(this.autoregressiveCheckBox);
@@ -146,13 +141,24 @@
       this.learningTaskGroupBox.Location = new System.Drawing.Point(6, 236);
       this.learningTaskGroupBox.Name = "learningTaskGroupBox";
-      this.learningTaskGroupBox.Size = new System.Drawing.Size(343, 321);
+      this.learningTaskGroupBox.Size = new System.Drawing.Size(343, 341);
       this.learningTaskGroupBox.TabIndex = 36;
       this.learningTaskGroupBox.TabStop = false;
       this.learningTaskGroupBox.Text = "Learning task";
       // 
+      // editEngineButton
+      // 
+      this.editEngineButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+      this.editEngineButton.Location = new System.Drawing.Point(108, 312);
+      this.editEngineButton.Name = "editEngineButton";
+      this.editEngineButton.Size = new System.Drawing.Size(75, 23);
+      this.editEngineButton.TabIndex = 37;
+      this.editEngineButton.Text = "Edit engine";
+      this.editEngineButton.UseVisualStyleBackColor = true;
+      this.editEngineButton.Click += new System.EventHandler(this.editEngineButton_Click);
+      // 
       // setAlgorithmDefault
       // 
       this.setAlgorithmDefault.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
-      this.setAlgorithmDefault.Location = new System.Drawing.Point(6, 292);
+      this.setAlgorithmDefault.Location = new System.Drawing.Point(6, 312);
       this.setAlgorithmDefault.Name = "setAlgorithmDefault";
       this.setAlgorithmDefault.Size = new System.Drawing.Size(96, 23);
@@ -191,40 +197,10 @@
       this.algorithmsListBox.FormattingEnabled = true;
       this.algorithmsListBox.HorizontalScrollbar = true;
-      this.algorithmsListBox.Location = new System.Drawing.Point(6, 155);
+      this.algorithmsListBox.Location = new System.Drawing.Point(6, 110);
       this.algorithmsListBox.Name = "algorithmsListBox";
-      this.algorithmsListBox.Size = new System.Drawing.Size(331, 124);
+      this.algorithmsListBox.Size = new System.Drawing.Size(331, 184);
       this.algorithmsListBox.TabIndex = 4;
       this.algorithmsListBox.SelectedIndexChanged += new System.EventHandler(this.algorithmsListBox_SelectedIndexChanged);
       this.algorithmsListBox.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.algorithmsListBox_ItemCheck);
-      // 
-      // minTimeOffsetLabel
-      // 
-      this.minTimeOffsetLabel.AutoSize = true;
-      this.minTimeOffsetLabel.Enabled = false;
-      this.minTimeOffsetLabel.Location = new System.Drawing.Point(38, 106);
-      this.minTimeOffsetLabel.Name = "minTimeOffsetLabel";
-      this.minTimeOffsetLabel.Size = new System.Drawing.Size(87, 13);
-      this.minTimeOffsetLabel.TabIndex = 31;
-      this.minTimeOffsetLabel.Text = "Min. Time Offset:";
-      // 
-      // minTimeOffsetTextBox
-      // 
-      this.minTimeOffsetTextBox.Enabled = false;
-      this.minTimeOffsetTextBox.Location = new System.Drawing.Point(131, 103);
-      this.minTimeOffsetTextBox.Name = "minTimeOffsetTextBox";
-      this.minTimeOffsetTextBox.Size = new System.Drawing.Size(96, 20);
-      this.minTimeOffsetTextBox.TabIndex = 32;
-      this.minTimeOffsetTextBox.Validated += new System.EventHandler(this.timeOffsetTextBox_Validated);
-      this.minTimeOffsetTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.timeOffsetTextBox_Validating);
-      // 
-      // maxTimeOffsetLabel
-      // 
-      this.maxTimeOffsetLabel.AutoSize = true;
-      this.maxTimeOffsetLabel.Enabled = false;
-      this.maxTimeOffsetLabel.Location = new System.Drawing.Point(35, 132);
-      this.maxTimeOffsetLabel.Name = "maxTimeOffsetLabel";
-      this.maxTimeOffsetLabel.Size = new System.Drawing.Size(90, 13);
-      this.maxTimeOffsetLabel.TabIndex = 33;
-      this.maxTimeOffsetLabel.Text = "Max. Time Offset:";
       // 
       // regressionRadioButton
@@ -238,14 +214,4 @@
       this.regressionRadioButton.UseVisualStyleBackColor = true;
       this.regressionRadioButton.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChanged);
-      // 
-      // maxTimeOffsetTextBox
-      // 
-      this.maxTimeOffsetTextBox.Enabled = false;
-      this.maxTimeOffsetTextBox.Location = new System.Drawing.Point(131, 129);
-      this.maxTimeOffsetTextBox.Name = "maxTimeOffsetTextBox";
-      this.maxTimeOffsetTextBox.Size = new System.Drawing.Size(96, 20);
-      this.maxTimeOffsetTextBox.TabIndex = 34;
-      this.maxTimeOffsetTextBox.Validated += new System.EventHandler(this.timeOffsetTextBox_Validated);
-      this.maxTimeOffsetTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.timeOffsetTextBox_Validating);
       // 
       // timeSeriesRadioButton
@@ -285,7 +251,7 @@
       this.partitioningGroupBox.Controls.Add(this.testLabel);
       this.partitioningGroupBox.Enabled = false;
-      this.partitioningGroupBox.Location = new System.Drawing.Point(6, 563);
+      this.partitioningGroupBox.Location = new System.Drawing.Point(6, 583);
       this.partitioningGroupBox.Name = "partitioningGroupBox";
-      this.partitioningGroupBox.Size = new System.Drawing.Size(343, 122);
+      this.partitioningGroupBox.Size = new System.Drawing.Size(343, 102);
       this.partitioningGroupBox.TabIndex = 26;
       this.partitioningGroupBox.TabStop = false;
@@ -294,5 +260,5 @@
       // validationSamplesEndTextBox
       // 
-      this.validationSamplesEndTextBox.Location = new System.Drawing.Point(221, 43);
+      this.validationSamplesEndTextBox.Location = new System.Drawing.Point(222, 45);
       this.validationSamplesEndTextBox.Name = "validationSamplesEndTextBox";
       this.validationSamplesEndTextBox.Size = new System.Drawing.Size(96, 20);
@@ -304,5 +270,5 @@
       // 
       this.trainingLabel.AutoSize = true;
-      this.trainingLabel.Location = new System.Drawing.Point(13, 20);
+      this.trainingLabel.Location = new System.Drawing.Point(14, 22);
       this.trainingLabel.Name = "trainingLabel";
       this.trainingLabel.Size = new System.Drawing.Size(89, 13);
@@ -312,5 +278,5 @@
       // trainingSamplesStartTextBox
       // 
-      this.trainingSamplesStartTextBox.Location = new System.Drawing.Point(119, 17);
+      this.trainingSamplesStartTextBox.Location = new System.Drawing.Point(120, 19);
       this.trainingSamplesStartTextBox.Name = "trainingSamplesStartTextBox";
       this.trainingSamplesStartTextBox.Size = new System.Drawing.Size(96, 20);
@@ -321,5 +287,5 @@
       // trainingSamplesEndTextBox
       // 
-      this.trainingSamplesEndTextBox.Location = new System.Drawing.Point(221, 17);
+      this.trainingSamplesEndTextBox.Location = new System.Drawing.Point(222, 19);
       this.trainingSamplesEndTextBox.Name = "trainingSamplesEndTextBox";
       this.trainingSamplesEndTextBox.Size = new System.Drawing.Size(96, 20);
@@ -331,5 +297,5 @@
       // 
       this.validationLabel.AutoSize = true;
-      this.validationLabel.Location = new System.Drawing.Point(5, 46);
+      this.validationLabel.Location = new System.Drawing.Point(6, 48);
       this.validationLabel.Name = "validationLabel";
       this.validationLabel.Size = new System.Drawing.Size(97, 13);
@@ -339,5 +305,5 @@
       // testSamplesEndTextBox
       // 
-      this.testSamplesEndTextBox.Location = new System.Drawing.Point(221, 68);
+      this.testSamplesEndTextBox.Location = new System.Drawing.Point(222, 70);
       this.testSamplesEndTextBox.Name = "testSamplesEndTextBox";
       this.testSamplesEndTextBox.Size = new System.Drawing.Size(96, 20);
@@ -348,5 +314,5 @@
       // validationSamplesStartTextBox
       // 
-      this.validationSamplesStartTextBox.Location = new System.Drawing.Point(119, 43);
+      this.validationSamplesStartTextBox.Location = new System.Drawing.Point(120, 45);
       this.validationSamplesStartTextBox.Name = "validationSamplesStartTextBox";
       this.validationSamplesStartTextBox.Size = new System.Drawing.Size(96, 20);
@@ -357,5 +323,5 @@
       // testSamplesStartTextBox
       // 
-      this.testSamplesStartTextBox.Location = new System.Drawing.Point(119, 68);
+      this.testSamplesStartTextBox.Location = new System.Drawing.Point(120, 70);
       this.testSamplesStartTextBox.Name = "testSamplesStartTextBox";
       this.testSamplesStartTextBox.Size = new System.Drawing.Size(96, 20);
@@ -367,5 +333,5 @@
       // 
       this.testLabel.AutoSize = true;
-      this.testLabel.Location = new System.Drawing.Point(30, 71);
+      this.testLabel.Location = new System.Drawing.Point(31, 73);
       this.testLabel.Name = "testLabel";
       this.testLabel.Size = new System.Drawing.Size(72, 13);
@@ -384,13 +350,7 @@
       this.setAllButton.Click += new System.EventHandler(this.setAllButton_Click);
       // 
-      // editEngineButton
-      // 
-      this.editEngineButton.Location = new System.Drawing.Point(108, 292);
-      this.editEngineButton.Name = "editEngineButton";
-      this.editEngineButton.Size = new System.Drawing.Size(75, 23);
-      this.editEngineButton.TabIndex = 37;
-      this.editEngineButton.Text = "Edit engine";
-      this.editEngineButton.UseVisualStyleBackColor = true;
-      this.editEngineButton.Click += new System.EventHandler(this.editEngineButton_Click);
+      // errorProvider
+      // 
+      this.errorProvider.ContainerControl = this;
       // 
       // DispatcherView
@@ -410,4 +370,5 @@
       this.partitioningGroupBox.ResumeLayout(false);
       this.partitioningGroupBox.PerformLayout();
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
       this.ResumeLayout(false);
 
@@ -436,13 +397,10 @@
     private System.Windows.Forms.Label autoregressiveLabel;
     private System.Windows.Forms.RadioButton classificationRadioButton;
-    private System.Windows.Forms.Label minTimeOffsetLabel;
-    private System.Windows.Forms.TextBox minTimeOffsetTextBox;
-    private System.Windows.Forms.Label maxTimeOffsetLabel;
     private System.Windows.Forms.RadioButton regressionRadioButton;
-    private System.Windows.Forms.TextBox maxTimeOffsetTextBox;
     private System.Windows.Forms.RadioButton timeSeriesRadioButton;
     private System.Windows.Forms.CheckBox autoregressiveCheckBox;
     private System.Windows.Forms.Button setAlgorithmDefault;
     private System.Windows.Forms.Button editEngineButton;
+    private System.Windows.Forms.ErrorProvider errorProvider;
   }
 }
Index: trunk/sources/HeuristicLab.CEDMA.Server/3.3/DispatcherView.cs
===================================================================
--- trunk/sources/HeuristicLab.CEDMA.Server/3.3/DispatcherView.cs	(revision 2825)
+++ trunk/sources/HeuristicLab.CEDMA.Server/3.3/DispatcherView.cs	(revision 2843)
@@ -102,6 +102,4 @@
       testSamplesStartTextBox.Text = selectedSpec.TestSamplesStart.ToString();
       testSamplesEndTextBox.Text = selectedSpec.TestSamplesEnd.ToString();
-      minTimeOffsetTextBox.Text = selectedSpec.MinTimeOffset.ToString();
-      maxTimeOffsetTextBox.Text = selectedSpec.MaxTimeOffset.ToString();
       autoregressiveCheckBox.Checked = selectedSpec.AutoRegressive;
     }
@@ -136,6 +134,4 @@
           ProblemSpecification spec = dispatcher.GetProblemSpecification(targetVar);
           spec.LearningTask = selectedSpec.LearningTask;
-          spec.MinTimeOffset = selectedSpec.MinTimeOffset;
-          spec.MaxTimeOffset = selectedSpec.MaxTimeOffset;
           spec.AutoRegressive = selectedSpec.AutoRegressive;
           var curAllowedAlgos = dispatcher.GetAllowedAlgorithms(targetVar).ToList();
@@ -157,8 +153,4 @@
 
     private void radioButton_CheckedChanged(object sender, EventArgs e) {
-      minTimeOffsetLabel.Enabled = timeSeriesRadioButton.Checked;
-      minTimeOffsetTextBox.Enabled = timeSeriesRadioButton.Checked;
-      maxTimeOffsetLabel.Enabled = timeSeriesRadioButton.Checked;
-      maxTimeOffsetTextBox.Enabled = timeSeriesRadioButton.Checked;
       autoregressiveCheckBox.Enabled = timeSeriesRadioButton.Checked;
       autoregressiveLabel.Enabled = timeSeriesRadioButton.Checked;
@@ -171,16 +163,4 @@
       }
       UpdateAlgorithms();
-    }
-
-    private void timeOffsetTextBox_Validating(object sender, CancelEventArgs e) {
-      int min, max;
-      e.Cancel = !int.TryParse(minTimeOffsetTextBox.Text, out min);
-      e.Cancel = !int.TryParse(maxTimeOffsetTextBox.Text, out max);
-      e.Cancel = min > max;
-    }
-
-    private void timeOffsetTextBox_Validated(object sender, EventArgs e) {
-      selectedSpec.MinTimeOffset = int.Parse(minTimeOffsetTextBox.Text);
-      selectedSpec.MaxTimeOffset = int.Parse(maxTimeOffsetTextBox.Text);
     }
 
@@ -255,5 +235,4 @@
       editEngineButton.Enabled = algorithmsListBox.SelectedItems.Count > 0;
     }
-
   }
 }
Index: trunk/sources/HeuristicLab.CEDMA.Server/3.3/DispatcherView.resx
===================================================================
--- trunk/sources/HeuristicLab.CEDMA.Server/3.3/DispatcherView.resx	(revision 2825)
+++ trunk/sources/HeuristicLab.CEDMA.Server/3.3/DispatcherView.resx	(revision 2843)
@@ -118,3 +118,6 @@
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
+  <metadata name="errorProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
 </root>
Index: trunk/sources/HeuristicLab.CEDMA.Server/3.3/ProblemSpecification.cs
===================================================================
--- trunk/sources/HeuristicLab.CEDMA.Server/3.3/ProblemSpecification.cs	(revision 2825)
+++ trunk/sources/HeuristicLab.CEDMA.Server/3.3/ProblemSpecification.cs	(revision 2843)
@@ -83,7 +83,4 @@
     }
 
-    public int MaxTimeOffset { get; set; }
-    public int MinTimeOffset { get; set; }
-
     public bool AutoRegressive { get; set; }
 
@@ -108,6 +105,4 @@
       LearningTask = original.LearningTask;
       TargetVariable = original.TargetVariable;
-      MinTimeOffset = original.MinTimeOffset;
-      MaxTimeOffset = original.MaxTimeOffset;
       AutoRegressive = original.AutoRegressive;
       TrainingSamplesStart = original.TrainingSamplesStart;
@@ -134,6 +129,4 @@
       return
         other.LearningTask == LearningTask &&
-        other.MinTimeOffset == MinTimeOffset &&
-        other.MaxTimeOffset == MaxTimeOffset &&
         other.AutoRegressive == AutoRegressive &&
         other.TargetVariable == TargetVariable &&
@@ -156,6 +149,4 @@
         LearningTask.GetHashCode() |
         TargetVariable.GetHashCode() |
-        MinTimeOffset.GetHashCode() |
-        MaxTimeOffset.GetHashCode() |
         AutoRegressive.GetHashCode() |
         TrainingSamplesStart.GetHashCode() |
Index: trunk/sources/HeuristicLab.CEDMA.Server/3.3/SimpleDispatcher.cs
===================================================================
--- trunk/sources/HeuristicLab.CEDMA.Server/3.3/SimpleDispatcher.cs	(revision 2825)
+++ trunk/sources/HeuristicLab.CEDMA.Server/3.3/SimpleDispatcher.cs	(revision 2843)
@@ -106,4 +106,20 @@
     private object locker = new object();
 
+
+    public double TrainingSetPercentageSize {
+      get;
+      set;
+    }
+
+    public int SkippedRowsBeginning {
+      get;
+      set;
+    }
+
+    public int SkippedRowsEnd {
+      get;
+      set;
+    }
+
     public SimpleDispatcher(IModelingDatabase database, Dataset dataset) {
       this.dataset = dataset;
@@ -117,6 +133,9 @@
       finishedAndDispatchedRuns = new Dictionary<string, List<AlgorithmConfiguration>>();
 
-      
+
       defaultAlgorithms = ApplicationManager.Manager.GetInstances<HeuristicLab.Modeling.IAlgorithm>().ToArray();
+
+      TrainingSetPercentageSize = 0.5;
+      SkippedRowsBeginning = 2;
 
       // PopulateFinishedRuns();
@@ -190,8 +209,5 @@
 
       if (spec.LearningTask == LearningTask.TimeSeries) {
-        ITimeSeriesAlgorithm timeSeriesAlgo = (ITimeSeriesAlgorithm)algo;
-        timeSeriesAlgo.MinTimeOffset = spec.MinTimeOffset;
-        timeSeriesAlgo.MaxTimeOffset = spec.MaxTimeOffset;
-        timeSeriesAlgo.TrainingSamplesStart = spec.TrainingSamplesStart - spec.MinTimeOffset + 1; // first possible index is 1 because of differential symbol
+        algo.TrainingSamplesStart = spec.TrainingSamplesStart + 1; // first possible index is 1 because of differential symbol
         if (spec.AutoRegressive) {
           allowedFeatures.Add(spec.TargetVariable);
@@ -255,4 +271,5 @@
         if (!(double.IsNaN(x) || double.IsInfinity(x))) break;
       }
+      firstValueIndex += SkippedRowsBeginning;
       // find index of last correct target value
       int lastValueIndex;
@@ -261,10 +278,11 @@
         if (!(double.IsNaN(x) || double.IsInfinity(x))) break;
       }
+      lastValueIndex -= SkippedRowsEnd;
 
       int validTargetRange = lastValueIndex - firstValueIndex;
       spec.TrainingSamplesStart = firstValueIndex;
-      spec.TrainingSamplesEnd = firstValueIndex + (int)Math.Floor(validTargetRange * 0.5);
+      spec.TrainingSamplesEnd = firstValueIndex + (int)Math.Floor(validTargetRange * TrainingSetPercentageSize);
       spec.ValidationSamplesStart = spec.TrainingSamplesEnd;
-      spec.ValidationSamplesEnd = firstValueIndex + (int)Math.Floor(validTargetRange * 0.75);
+      spec.ValidationSamplesEnd = spec.TrainingSamplesEnd + (int)Math.Floor(validTargetRange * (1 - TrainingSetPercentageSize) / 2.0);
       spec.TestSamplesStart = spec.ValidationSamplesEnd;
       spec.TestSamplesEnd = lastValueIndex;
