Free cookie consent management tool by TermsFeed Policy Generator

Changeset 2375 for trunk


Ignore:
Timestamp:
09/21/09 20:23:47 (15 years ago)
Author:
gkronber
Message:

Refactored CEDMA dispatcher and CEDMA server view to allow different modeling scenarios for each variable. #754

Location:
trunk/sources
Files:
1 added
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.CEDMA.Core/3.3/ConsoleEditor.cs

    r2289 r2375  
    3737    private Button openButton;
    3838    private Console console;
    39     private VisualMatrix matrix;
    4039
    4140    public ConsoleEditor(Console console) {
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/DispatcherView.Designer.cs

    r2290 r2375  
    2929      this.inputVariablesLabel = new System.Windows.Forms.Label();
    3030      this.splitContainer = new System.Windows.Forms.SplitContainer();
     31      this.learningTaskGroupBox = new System.Windows.Forms.GroupBox();
     32      this.autoregressiveLabel = new System.Windows.Forms.Label();
     33      this.classificationRadioButton = new System.Windows.Forms.RadioButton();
    3134      this.algorithmsListBox = new System.Windows.Forms.CheckedListBox();
    32       this.algorithmsLabel = new System.Windows.Forms.Label();
     35      this.minTimeOffsetLabel = new System.Windows.Forms.Label();
     36      this.minTimeOffsetTextBox = new System.Windows.Forms.TextBox();
     37      this.maxTimeOffsetLabel = new System.Windows.Forms.Label();
     38      this.regressionRadioButton = new System.Windows.Forms.RadioButton();
     39      this.maxTimeOffsetTextBox = new System.Windows.Forms.TextBox();
     40      this.timeSeriesRadioButton = new System.Windows.Forms.RadioButton();
     41      this.autoregressiveCheckBox = new System.Windows.Forms.CheckBox();
     42      this.partitioningGroupBox = new System.Windows.Forms.GroupBox();
     43      this.validationSamplesEndTextBox = new System.Windows.Forms.TextBox();
     44      this.trainingLabel = new System.Windows.Forms.Label();
     45      this.trainingSamplesStartTextBox = new System.Windows.Forms.TextBox();
     46      this.trainingSamplesEndTextBox = new System.Windows.Forms.TextBox();
     47      this.validationLabel = new System.Windows.Forms.Label();
     48      this.testSamplesEndTextBox = new System.Windows.Forms.TextBox();
     49      this.validationSamplesStartTextBox = new System.Windows.Forms.TextBox();
     50      this.testSamplesStartTextBox = new System.Windows.Forms.TextBox();
     51      this.testLabel = new System.Windows.Forms.Label();
    3352      this.setAllButton = new System.Windows.Forms.Button();
    3453      this.splitContainer.Panel1.SuspendLayout();
    3554      this.splitContainer.Panel2.SuspendLayout();
    3655      this.splitContainer.SuspendLayout();
     56      this.learningTaskGroupBox.SuspendLayout();
     57      this.partitioningGroupBox.SuspendLayout();
    3758      this.SuspendLayout();
    3859      //
     
    4465      this.targetVariableList.FormattingEnabled = true;
    4566      this.targetVariableList.HorizontalScrollbar = true;
    46       this.targetVariableList.Location = new System.Drawing.Point(6, 181);
     67      this.targetVariableList.Location = new System.Drawing.Point(3, 16);
    4768      this.targetVariableList.Name = "targetVariableList";
    48       this.targetVariableList.Size = new System.Drawing.Size(193, 289);
     69      this.targetVariableList.Size = new System.Drawing.Size(346, 214);
    4970      this.targetVariableList.TabIndex = 0;
    5071      this.targetVariableList.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.targetVariableList_ItemCheck);
     
    6081      this.inputVariableList.Location = new System.Drawing.Point(2, 16);
    6182      this.inputVariableList.Name = "inputVariableList";
    62       this.inputVariableList.Size = new System.Drawing.Size(221, 439);
     83      this.inputVariableList.Size = new System.Drawing.Size(393, 634);
    6384      this.inputVariableList.TabIndex = 1;
    6485      this.inputVariableList.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.inputVariableList_ItemCheck);
     
    6788      //
    6889      this.targetVariablesLabel.AutoSize = true;
    69       this.targetVariablesLabel.Location = new System.Drawing.Point(3, 165);
     90      this.targetVariablesLabel.Location = new System.Drawing.Point(0, 0);
    7091      this.targetVariablesLabel.Name = "targetVariablesLabel";
    7192      this.targetVariablesLabel.Size = new System.Drawing.Size(86, 13);
     
    90111      // splitContainer.Panel1
    91112      //
    92       this.splitContainer.Panel1.Controls.Add(this.algorithmsListBox);
    93       this.splitContainer.Panel1.Controls.Add(this.algorithmsLabel);
     113      this.splitContainer.Panel1.Controls.Add(this.learningTaskGroupBox);
     114      this.splitContainer.Panel1.Controls.Add(this.partitioningGroupBox);
    94115      this.splitContainer.Panel1.Controls.Add(this.targetVariablesLabel);
    95116      this.splitContainer.Panel1.Controls.Add(this.targetVariableList);
     
    100121      this.splitContainer.Panel2.Controls.Add(this.inputVariablesLabel);
    101122      this.splitContainer.Panel2.Controls.Add(this.inputVariableList);
    102       this.splitContainer.Size = new System.Drawing.Size(429, 482);
    103       this.splitContainer.SplitterDistance = 202;
     123      this.splitContainer.Size = new System.Drawing.Size(754, 688);
     124      this.splitContainer.SplitterDistance = 355;
    104125      this.splitContainer.SplitterWidth = 1;
    105126      this.splitContainer.TabIndex = 4;
    106127      //
     128      // learningTaskGroupBox
     129      //
     130      this.learningTaskGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     131      this.learningTaskGroupBox.Controls.Add(this.autoregressiveLabel);
     132      this.learningTaskGroupBox.Controls.Add(this.classificationRadioButton);
     133      this.learningTaskGroupBox.Controls.Add(this.algorithmsListBox);
     134      this.learningTaskGroupBox.Controls.Add(this.minTimeOffsetLabel);
     135      this.learningTaskGroupBox.Controls.Add(this.minTimeOffsetTextBox);
     136      this.learningTaskGroupBox.Controls.Add(this.maxTimeOffsetLabel);
     137      this.learningTaskGroupBox.Controls.Add(this.regressionRadioButton);
     138      this.learningTaskGroupBox.Controls.Add(this.maxTimeOffsetTextBox);
     139      this.learningTaskGroupBox.Controls.Add(this.timeSeriesRadioButton);
     140      this.learningTaskGroupBox.Controls.Add(this.autoregressiveCheckBox);
     141      this.learningTaskGroupBox.Enabled = false;
     142      this.learningTaskGroupBox.Location = new System.Drawing.Point(6, 236);
     143      this.learningTaskGroupBox.Name = "learningTaskGroupBox";
     144      this.learningTaskGroupBox.Size = new System.Drawing.Size(343, 321);
     145      this.learningTaskGroupBox.TabIndex = 36;
     146      this.learningTaskGroupBox.TabStop = false;
     147      this.learningTaskGroupBox.Text = "Learning task";
     148      //
     149      // autoregressiveLabel
     150      //
     151      this.autoregressiveLabel.AutoSize = true;
     152      this.autoregressiveLabel.Enabled = false;
     153      this.autoregressiveLabel.Location = new System.Drawing.Point(45, 83);
     154      this.autoregressiveLabel.Name = "autoregressiveLabel";
     155      this.autoregressiveLabel.Size = new System.Drawing.Size(80, 13);
     156      this.autoregressiveLabel.TabIndex = 35;
     157      this.autoregressiveLabel.Text = "Autoregressive:";
     158      //
     159      // classificationRadioButton
     160      //
     161      this.classificationRadioButton.AutoSize = true;
     162      this.classificationRadioButton.Location = new System.Drawing.Point(6, 16);
     163      this.classificationRadioButton.Name = "classificationRadioButton";
     164      this.classificationRadioButton.Size = new System.Drawing.Size(86, 17);
     165      this.classificationRadioButton.TabIndex = 28;
     166      this.classificationRadioButton.Text = "Classification";
     167      this.classificationRadioButton.UseVisualStyleBackColor = true;
     168      this.classificationRadioButton.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChanged);
     169      //
    107170      // algorithmsListBox
    108171      //
    109       this.algorithmsListBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     172      this.algorithmsListBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     173                  | System.Windows.Forms.AnchorStyles.Left)
    110174                  | System.Windows.Forms.AnchorStyles.Right)));
     175      this.algorithmsListBox.Enabled = false;
    111176      this.algorithmsListBox.FormattingEnabled = true;
    112177      this.algorithmsListBox.HorizontalScrollbar = true;
    113       this.algorithmsListBox.Location = new System.Drawing.Point(6, 16);
     178      this.algorithmsListBox.Location = new System.Drawing.Point(6, 155);
    114179      this.algorithmsListBox.Name = "algorithmsListBox";
    115       this.algorithmsListBox.Size = new System.Drawing.Size(193, 139);
     180      this.algorithmsListBox.Size = new System.Drawing.Size(331, 154);
    116181      this.algorithmsListBox.TabIndex = 4;
    117182      this.algorithmsListBox.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.algorithmsListBox_ItemCheck);
    118183      //
    119       // algorithmsLabel
    120       //
    121       this.algorithmsLabel.AutoSize = true;
    122       this.algorithmsLabel.Location = new System.Drawing.Point(3, 0);
    123       this.algorithmsLabel.Name = "algorithmsLabel";
    124       this.algorithmsLabel.Size = new System.Drawing.Size(58, 13);
    125       this.algorithmsLabel.TabIndex = 3;
    126       this.algorithmsLabel.Text = "Algorithms:";
     184      // minTimeOffsetLabel
     185      //
     186      this.minTimeOffsetLabel.AutoSize = true;
     187      this.minTimeOffsetLabel.Enabled = false;
     188      this.minTimeOffsetLabel.Location = new System.Drawing.Point(38, 106);
     189      this.minTimeOffsetLabel.Name = "minTimeOffsetLabel";
     190      this.minTimeOffsetLabel.Size = new System.Drawing.Size(87, 13);
     191      this.minTimeOffsetLabel.TabIndex = 31;
     192      this.minTimeOffsetLabel.Text = "Min. Time Offset:";
     193      //
     194      // minTimeOffsetTextBox
     195      //
     196      this.minTimeOffsetTextBox.Enabled = false;
     197      this.minTimeOffsetTextBox.Location = new System.Drawing.Point(131, 103);
     198      this.minTimeOffsetTextBox.Name = "minTimeOffsetTextBox";
     199      this.minTimeOffsetTextBox.Size = new System.Drawing.Size(96, 20);
     200      this.minTimeOffsetTextBox.TabIndex = 32;
     201      this.minTimeOffsetTextBox.Validated += new System.EventHandler(this.timeOffsetTextBox_Validated);
     202      this.minTimeOffsetTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.timeOffsetTextBox_Validating);
     203      //
     204      // maxTimeOffsetLabel
     205      //
     206      this.maxTimeOffsetLabel.AutoSize = true;
     207      this.maxTimeOffsetLabel.Enabled = false;
     208      this.maxTimeOffsetLabel.Location = new System.Drawing.Point(35, 132);
     209      this.maxTimeOffsetLabel.Name = "maxTimeOffsetLabel";
     210      this.maxTimeOffsetLabel.Size = new System.Drawing.Size(90, 13);
     211      this.maxTimeOffsetLabel.TabIndex = 33;
     212      this.maxTimeOffsetLabel.Text = "Max. Time Offset:";
     213      //
     214      // regressionRadioButton
     215      //
     216      this.regressionRadioButton.AutoSize = true;
     217      this.regressionRadioButton.Location = new System.Drawing.Point(6, 39);
     218      this.regressionRadioButton.Name = "regressionRadioButton";
     219      this.regressionRadioButton.Size = new System.Drawing.Size(78, 17);
     220      this.regressionRadioButton.TabIndex = 29;
     221      this.regressionRadioButton.Text = "Regression";
     222      this.regressionRadioButton.UseVisualStyleBackColor = true;
     223      this.regressionRadioButton.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChanged);
     224      //
     225      // maxTimeOffsetTextBox
     226      //
     227      this.maxTimeOffsetTextBox.Enabled = false;
     228      this.maxTimeOffsetTextBox.Location = new System.Drawing.Point(131, 129);
     229      this.maxTimeOffsetTextBox.Name = "maxTimeOffsetTextBox";
     230      this.maxTimeOffsetTextBox.Size = new System.Drawing.Size(96, 20);
     231      this.maxTimeOffsetTextBox.TabIndex = 34;
     232      this.maxTimeOffsetTextBox.Validated += new System.EventHandler(this.timeOffsetTextBox_Validated);
     233      this.maxTimeOffsetTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.timeOffsetTextBox_Validating);
     234      //
     235      // timeSeriesRadioButton
     236      //
     237      this.timeSeriesRadioButton.AutoSize = true;
     238      this.timeSeriesRadioButton.Location = new System.Drawing.Point(6, 62);
     239      this.timeSeriesRadioButton.Name = "timeSeriesRadioButton";
     240      this.timeSeriesRadioButton.Size = new System.Drawing.Size(119, 17);
     241      this.timeSeriesRadioButton.TabIndex = 30;
     242      this.timeSeriesRadioButton.Text = "Time series forecast";
     243      this.timeSeriesRadioButton.UseVisualStyleBackColor = true;
     244      this.timeSeriesRadioButton.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChanged);
     245      //
     246      // autoregressiveCheckBox
     247      //
     248      this.autoregressiveCheckBox.Anchor = System.Windows.Forms.AnchorStyles.Top;
     249      this.autoregressiveCheckBox.AutoSize = true;
     250      this.autoregressiveCheckBox.Enabled = false;
     251      this.autoregressiveCheckBox.Location = new System.Drawing.Point(139, 83);
     252      this.autoregressiveCheckBox.Name = "autoregressiveCheckBox";
     253      this.autoregressiveCheckBox.Size = new System.Drawing.Size(15, 14);
     254      this.autoregressiveCheckBox.TabIndex = 22;
     255      this.autoregressiveCheckBox.UseVisualStyleBackColor = true;
     256      this.autoregressiveCheckBox.CheckedChanged += new System.EventHandler(this.autoregressiveCheckBox_CheckedChanged);
     257      //
     258      // partitioningGroupBox
     259      //
     260      this.partitioningGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     261      this.partitioningGroupBox.Controls.Add(this.validationSamplesEndTextBox);
     262      this.partitioningGroupBox.Controls.Add(this.trainingLabel);
     263      this.partitioningGroupBox.Controls.Add(this.trainingSamplesStartTextBox);
     264      this.partitioningGroupBox.Controls.Add(this.trainingSamplesEndTextBox);
     265      this.partitioningGroupBox.Controls.Add(this.validationLabel);
     266      this.partitioningGroupBox.Controls.Add(this.testSamplesEndTextBox);
     267      this.partitioningGroupBox.Controls.Add(this.validationSamplesStartTextBox);
     268      this.partitioningGroupBox.Controls.Add(this.testSamplesStartTextBox);
     269      this.partitioningGroupBox.Controls.Add(this.testLabel);
     270      this.partitioningGroupBox.Enabled = false;
     271      this.partitioningGroupBox.Location = new System.Drawing.Point(6, 563);
     272      this.partitioningGroupBox.Name = "partitioningGroupBox";
     273      this.partitioningGroupBox.Size = new System.Drawing.Size(343, 122);
     274      this.partitioningGroupBox.TabIndex = 26;
     275      this.partitioningGroupBox.TabStop = false;
     276      this.partitioningGroupBox.Text = "Data set partitions:";
     277      //
     278      // validationSamplesEndTextBox
     279      //
     280      this.validationSamplesEndTextBox.Location = new System.Drawing.Point(221, 43);
     281      this.validationSamplesEndTextBox.Name = "validationSamplesEndTextBox";
     282      this.validationSamplesEndTextBox.Size = new System.Drawing.Size(96, 20);
     283      this.validationSamplesEndTextBox.TabIndex = 13;
     284      this.validationSamplesEndTextBox.Validated += new System.EventHandler(this.samplesTextBox_Validated);
     285      this.validationSamplesEndTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.samplesTextBox_Validating);
     286      //
     287      // trainingLabel
     288      //
     289      this.trainingLabel.AutoSize = true;
     290      this.trainingLabel.Location = new System.Drawing.Point(13, 20);
     291      this.trainingLabel.Name = "trainingLabel";
     292      this.trainingLabel.Size = new System.Drawing.Size(89, 13);
     293      this.trainingLabel.TabIndex = 3;
     294      this.trainingLabel.Text = "Training samples:";
     295      //
     296      // trainingSamplesStartTextBox
     297      //
     298      this.trainingSamplesStartTextBox.Location = new System.Drawing.Point(119, 17);
     299      this.trainingSamplesStartTextBox.Name = "trainingSamplesStartTextBox";
     300      this.trainingSamplesStartTextBox.Size = new System.Drawing.Size(96, 20);
     301      this.trainingSamplesStartTextBox.TabIndex = 4;
     302      this.trainingSamplesStartTextBox.Validated += new System.EventHandler(this.samplesTextBox_Validated);
     303      this.trainingSamplesStartTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.samplesTextBox_Validating);
     304      //
     305      // trainingSamplesEndTextBox
     306      //
     307      this.trainingSamplesEndTextBox.Location = new System.Drawing.Point(221, 17);
     308      this.trainingSamplesEndTextBox.Name = "trainingSamplesEndTextBox";
     309      this.trainingSamplesEndTextBox.Size = new System.Drawing.Size(96, 20);
     310      this.trainingSamplesEndTextBox.TabIndex = 10;
     311      this.trainingSamplesEndTextBox.Validated += new System.EventHandler(this.samplesTextBox_Validated);
     312      this.trainingSamplesEndTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.samplesTextBox_Validating);
     313      //
     314      // validationLabel
     315      //
     316      this.validationLabel.AutoSize = true;
     317      this.validationLabel.Location = new System.Drawing.Point(5, 46);
     318      this.validationLabel.Name = "validationLabel";
     319      this.validationLabel.Size = new System.Drawing.Size(97, 13);
     320      this.validationLabel.TabIndex = 11;
     321      this.validationLabel.Text = "Validation samples:";
     322      //
     323      // testSamplesEndTextBox
     324      //
     325      this.testSamplesEndTextBox.Location = new System.Drawing.Point(221, 68);
     326      this.testSamplesEndTextBox.Name = "testSamplesEndTextBox";
     327      this.testSamplesEndTextBox.Size = new System.Drawing.Size(96, 20);
     328      this.testSamplesEndTextBox.TabIndex = 16;
     329      this.testSamplesEndTextBox.Validated += new System.EventHandler(this.samplesTextBox_Validated);
     330      this.testSamplesEndTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.samplesTextBox_Validating);
     331      //
     332      // validationSamplesStartTextBox
     333      //
     334      this.validationSamplesStartTextBox.Location = new System.Drawing.Point(119, 43);
     335      this.validationSamplesStartTextBox.Name = "validationSamplesStartTextBox";
     336      this.validationSamplesStartTextBox.Size = new System.Drawing.Size(96, 20);
     337      this.validationSamplesStartTextBox.TabIndex = 12;
     338      this.validationSamplesStartTextBox.Validated += new System.EventHandler(this.samplesTextBox_Validated);
     339      this.validationSamplesStartTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.samplesTextBox_Validating);
     340      //
     341      // testSamplesStartTextBox
     342      //
     343      this.testSamplesStartTextBox.Location = new System.Drawing.Point(119, 68);
     344      this.testSamplesStartTextBox.Name = "testSamplesStartTextBox";
     345      this.testSamplesStartTextBox.Size = new System.Drawing.Size(96, 20);
     346      this.testSamplesStartTextBox.TabIndex = 15;
     347      this.testSamplesStartTextBox.Validated += new System.EventHandler(this.samplesTextBox_Validated);
     348      this.testSamplesStartTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.samplesTextBox_Validating);
     349      //
     350      // testLabel
     351      //
     352      this.testLabel.AutoSize = true;
     353      this.testLabel.Location = new System.Drawing.Point(30, 71);
     354      this.testLabel.Name = "testLabel";
     355      this.testLabel.Size = new System.Drawing.Size(72, 13);
     356      this.testLabel.TabIndex = 14;
     357      this.testLabel.Text = "Test samples:";
    127358      //
    128359      // setAllButton
    129360      //
    130361      this.setAllButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
    131       this.setAllButton.Location = new System.Drawing.Point(3, 456);
     362      this.setAllButton.Location = new System.Drawing.Point(3, 662);
    132363      this.setAllButton.Name = "setAllButton";
    133364      this.setAllButton.Size = new System.Drawing.Size(91, 23);
     
    143374      this.Controls.Add(this.splitContainer);
    144375      this.Name = "DispatcherView";
    145       this.Size = new System.Drawing.Size(429, 482);
     376      this.Size = new System.Drawing.Size(754, 688);
    146377      this.splitContainer.Panel1.ResumeLayout(false);
    147378      this.splitContainer.Panel1.PerformLayout();
     
    149380      this.splitContainer.Panel2.PerformLayout();
    150381      this.splitContainer.ResumeLayout(false);
     382      this.learningTaskGroupBox.ResumeLayout(false);
     383      this.learningTaskGroupBox.PerformLayout();
     384      this.partitioningGroupBox.ResumeLayout(false);
     385      this.partitioningGroupBox.PerformLayout();
    151386      this.ResumeLayout(false);
    152387
     
    162397    private System.Windows.Forms.Button setAllButton;
    163398    private System.Windows.Forms.CheckedListBox algorithmsListBox;
    164     private System.Windows.Forms.Label algorithmsLabel;
     399    private System.Windows.Forms.GroupBox partitioningGroupBox;
     400    private System.Windows.Forms.TextBox validationSamplesEndTextBox;
     401    private System.Windows.Forms.Label trainingLabel;
     402    private System.Windows.Forms.TextBox trainingSamplesStartTextBox;
     403    private System.Windows.Forms.TextBox trainingSamplesEndTextBox;
     404    private System.Windows.Forms.Label validationLabel;
     405    private System.Windows.Forms.TextBox testSamplesEndTextBox;
     406    private System.Windows.Forms.TextBox validationSamplesStartTextBox;
     407    private System.Windows.Forms.TextBox testSamplesStartTextBox;
     408    private System.Windows.Forms.Label testLabel;
     409    private System.Windows.Forms.GroupBox learningTaskGroupBox;
     410    private System.Windows.Forms.Label autoregressiveLabel;
     411    private System.Windows.Forms.RadioButton classificationRadioButton;
     412    private System.Windows.Forms.Label minTimeOffsetLabel;
     413    private System.Windows.Forms.TextBox minTimeOffsetTextBox;
     414    private System.Windows.Forms.Label maxTimeOffsetLabel;
     415    private System.Windows.Forms.RadioButton regressionRadioButton;
     416    private System.Windows.Forms.TextBox maxTimeOffsetTextBox;
     417    private System.Windows.Forms.RadioButton timeSeriesRadioButton;
     418    private System.Windows.Forms.CheckBox autoregressiveCheckBox;
    165419  }
    166420}
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/DispatcherView.cs

    r2290 r2375  
    88using System.Windows.Forms;
    99using HeuristicLab.Core;
     10using System.Diagnostics;
    1011
    1112namespace HeuristicLab.CEDMA.Server {
    1213  public partial class DispatcherView : ViewBase {
    1314    private SimpleDispatcher dispatcher;
     15    private ProblemSpecification selectedSpec;
    1416    public DispatcherView(SimpleDispatcher dispatcher)
    1517      : base() {
    1618      this.dispatcher = dispatcher;
    1719      InitializeComponent();
     20      dispatcher.Changed += (sender, args) => UpdateControls();
    1821      UpdateControls();
    19       dispatcher.Changed += (sender, args) => UpdateControls();
    2022      this.inputVariableList.CheckOnClick = true;
    2123    }
     
    3436        }
    3537
    36         foreach (string inputVar in dispatcher.InputVariables) {
     38        foreach (string inputVar in dispatcher.Variables) {
    3739          inputVariableList.Items.Add(inputVar, false);
    3840        }
    3941
    40         foreach (HeuristicLab.Modeling.IAlgorithm algo in dispatcher.Algorithms) {
    41           algorithmsListBox.Items.Add(algo, false);
    42         }
    4342        targetVariableList.ClearSelected();
    4443        inputVariableList.Enabled = false;
     
    5554
    5655    private void inputVariableList_ItemCheck(object sender, ItemCheckEventArgs e) {
    57       string selectedTarget = (string)targetVariableList.SelectedItem;
    5856      if (e.NewValue == CheckState.Checked) {
    59         dispatcher.EnableInputVariable(selectedTarget, (string)inputVariableList.Items[e.Index]);
     57        selectedSpec.AddInputVariable((string)inputVariableList.Items[e.Index]);
    6058      } else if (e.NewValue == CheckState.Unchecked) {
    61         dispatcher.DisableInputVariable(selectedTarget, (string)inputVariableList.Items[e.Index]);
     59        selectedSpec.RemoveInputVariable((string)inputVariableList.Items[e.Index]);
    6260      }
    6361    }
     
    6563    private void targetVariableList_SelectedValueChanged(object sender, EventArgs e) {
    6664      string selectedTarget = (string)targetVariableList.SelectedItem;
    67       UpdateInputVariableList(selectedTarget);
    68     }
    69 
    70     private void UpdateInputVariableList(string target) {
     65      selectedSpec = dispatcher.GetProblemSpecification(selectedTarget);
     66      UpdateInputVariableList();
     67      UpdateAlgorithms();
     68    }
     69
     70    private void UpdateAlgorithms() {
     71      learningTaskGroupBox.Enabled = true;
     72      algorithmsListBox.Enabled = true;
     73      switch (selectedSpec.LearningTask) {
     74        case LearningTask.Classification: {
     75            classificationRadioButton.Checked = true;
     76            break;
     77          }
     78        case LearningTask.Regression: {
     79            regressionRadioButton.Checked = true;
     80            break;
     81          }
     82        case LearningTask.TimeSeries: {
     83            regressionRadioButton.Checked = true;
     84            break;
     85          }
     86        default: { break; }
     87      }
     88      algorithmsListBox.Items.Clear();
     89      foreach (HeuristicLab.Modeling.IAlgorithm algo in dispatcher.GetAlgorithms(selectedSpec.LearningTask)) {
     90        algorithmsListBox.Items.Add(algo, dispatcher.GetAllowedAlgorithms(selectedSpec.TargetVariable).Contains(algo));
     91      }
     92      UpdateAlgorithmConfiguration();
     93    }
     94
     95    private void UpdateAlgorithmConfiguration() {
     96      partitioningGroupBox.Enabled = true;
     97      trainingSamplesStartTextBox.Text = selectedSpec.TrainingSamplesStart.ToString();
     98      trainingSamplesEndTextBox.Text = selectedSpec.TrainingSamplesEnd.ToString();
     99      validationSamplesStartTextBox.Text = selectedSpec.ValidationSamplesStart.ToString();
     100      validationSamplesEndTextBox.Text = selectedSpec.ValidationSamplesEnd.ToString();
     101      testSamplesStartTextBox.Text = selectedSpec.TestSamplesStart.ToString();
     102      testSamplesEndTextBox.Text = selectedSpec.TestSamplesEnd.ToString();
     103    }
     104
     105    private void UpdateInputVariableList() {
    71106      inputVariableList.Items.Clear();
    72       var activatedInputVariables = dispatcher.GetInputVariables(target);
    73       foreach (string inputVar in dispatcher.InputVariables) {
     107      var activatedInputVariables = selectedSpec.InputVariables;
     108      foreach (string inputVar in dispatcher.Variables) {
    74109        inputVariableList.Items.Add(inputVar, activatedInputVariables.Contains(inputVar));
    75110      }
     
    77112    }
    78113
    79     private void setAllButton_Click(object sender, EventArgs e) {     
     114    private void setAllButton_Click(object sender, EventArgs e) {
    80115      foreach (string targetVar in dispatcher.TargetVariables) {
     116        ProblemSpecification spec = dispatcher.GetProblemSpecification(targetVar);
    81117        for (int i = 0; i < inputVariableList.Items.Count; i++) {
    82118          if (inputVariableList.GetItemChecked(i)) {
    83             dispatcher.EnableInputVariable(targetVar, (string)inputVariableList.Items[i]);
     119            spec.AddInputVariable((string)inputVariableList.Items[i]);
    84120          } else {
    85             dispatcher.DisableInputVariable(targetVar, (string)inputVariableList.Items[i]);
     121            spec.RemoveInputVariable((string)inputVariableList.Items[i]);
    86122          }
    87123        }
     
    90126
    91127    private void algorithmsListBox_ItemCheck(object sender, ItemCheckEventArgs e) {
    92       if(e.NewValue == CheckState.Checked) {
    93         dispatcher.EnableAlgorithm((HeuristicLab.Modeling.IAlgorithm)algorithmsListBox.Items[e.Index]);
    94       } else if(e.NewValue == CheckState.Unchecked) {
    95         dispatcher.DisableAlgorithm((HeuristicLab.Modeling.IAlgorithm)algorithmsListBox.Items[e.Index]);
    96       }
     128      if (e.NewValue == CheckState.Checked) {
     129        dispatcher.EnableAlgorithm(selectedSpec.TargetVariable, (HeuristicLab.Modeling.IAlgorithm)algorithmsListBox.Items[e.Index]);
     130      } else if (e.NewValue == CheckState.Unchecked) {
     131        dispatcher.DisableAlgorithm(selectedSpec.TargetVariable, (HeuristicLab.Modeling.IAlgorithm)algorithmsListBox.Items[e.Index]);
     132      }
     133    }
     134
     135    private void radioButton_CheckedChanged(object sender, EventArgs e) {
     136      string selectedTarget = (string)targetVariableList.SelectedItem;
     137      minTimeOffsetLabel.Enabled = timeSeriesRadioButton.Checked;
     138      minTimeOffsetTextBox.Enabled = timeSeriesRadioButton.Checked;
     139      maxTimeOffsetLabel.Enabled = timeSeriesRadioButton.Checked;
     140      maxTimeOffsetTextBox.Enabled = timeSeriesRadioButton.Checked;
     141      autoregressiveCheckBox.Enabled = timeSeriesRadioButton.Checked;
     142      autoregressiveLabel.Enabled = timeSeriesRadioButton.Checked;
     143      if (timeSeriesRadioButton.Checked) selectedSpec.LearningTask = LearningTask.TimeSeries;
     144      else if (classificationRadioButton.Checked) selectedSpec.LearningTask = LearningTask.Classification;
     145      else if (regressionRadioButton.Checked) selectedSpec.LearningTask = LearningTask.Regression;
     146      UpdateAlgorithms();
     147    }
     148
     149    private void timeOffsetTextBox_Validating(object sender, CancelEventArgs e) {
     150      int min, max;
     151      e.Cancel = !int.TryParse(minTimeOffsetTextBox.Text, out min);
     152      e.Cancel = !int.TryParse(maxTimeOffsetTextBox.Text, out max);
     153      e.Cancel = min > max;
     154    }
     155
     156    private void timeOffsetTextBox_Validated(object sender, EventArgs e) {
     157      selectedSpec.MinTimeOffset = int.Parse(minTimeOffsetTextBox.Text);
     158      selectedSpec.MaxTimeOffset = int.Parse(maxTimeOffsetTextBox.Text);
     159    }
     160
     161    private void samplesTextBox_Validated(object sender, EventArgs e) {
     162      selectedSpec.TrainingSamplesStart = int.Parse(trainingSamplesStartTextBox.Text);
     163      selectedSpec.TrainingSamplesEnd = int.Parse(trainingSamplesEndTextBox.Text);
     164      selectedSpec.ValidationSamplesStart = int.Parse(validationSamplesStartTextBox.Text);
     165      selectedSpec.ValidationSamplesEnd = int.Parse(validationSamplesEndTextBox.Text);
     166      selectedSpec.TestSamplesStart = int.Parse(testSamplesStartTextBox.Text);
     167      selectedSpec.TestSamplesEnd = int.Parse(testSamplesEndTextBox.Text);
     168    }
     169
     170    private void ColorSamplesTextBoxes(Color color) {
     171      trainingSamplesStartTextBox.BackColor = color;
     172      trainingSamplesEndTextBox.BackColor = color;
     173      validationSamplesStartTextBox.BackColor = color;
     174      validationSamplesEndTextBox.BackColor = color;
     175      testSamplesStartTextBox.BackColor = color;
     176      testSamplesEndTextBox.BackColor = color;
     177    }
     178
     179    private void samplesTextBox_Validating(object sender, CancelEventArgs e) {
     180      try {
     181        int trainingStart = int.Parse(trainingSamplesStartTextBox.Text);
     182        int trainingEnd = int.Parse(trainingSamplesEndTextBox.Text);
     183        int validationStart = int.Parse(validationSamplesStartTextBox.Text);
     184        int validationEnd = int.Parse(validationSamplesEndTextBox.Text);
     185        int testStart = int.Parse(testSamplesStartTextBox.Text);
     186        int testEnd = int.Parse(testSamplesEndTextBox.Text);
     187        if (trainingStart < 0 || validationStart < 0 || testStart < 0 ||
     188          trainingEnd >= selectedSpec.Dataset.Rows || validationEnd >= selectedSpec.Dataset.Rows || testEnd >= selectedSpec.Dataset.Rows ||
     189          trainingStart >= trainingEnd ||
     190          validationStart >= validationEnd ||
     191          testStart >= testEnd ||
     192          IsOverlapping(trainingStart, trainingEnd, validationStart, validationEnd) ||
     193          IsOverlapping(trainingStart, trainingEnd, testStart, testEnd) ||
     194          IsOverlapping(validationStart, validationEnd, testStart, testEnd))
     195          ColorSamplesTextBoxes(Color.Red);
     196        else
     197          ColorSamplesTextBoxes(Color.White);
     198      }
     199      catch (FormatException) {
     200        ColorSamplesTextBoxes(Color.Red);
     201      }
     202    }
     203
     204    private void autoregressiveCheckBox_CheckedChanged(object sender, EventArgs e) {
     205      selectedSpec.AutoRegressive = autoregressiveCheckBox.Checked;
     206    }
     207
     208    private bool IsOverlapping(int x0, int y0, int x1, int y1) {
     209      Trace.Assert(x0 <= y0 && x1 <= y1);
     210      int tmp;
     211      // make sure that x0,y0 is the left interval
     212      if (x1 < x0) {
     213        tmp = x1;
     214        x1 = x0;
     215        x0 = tmp;
     216        tmp = y1;
     217        y1 = y0;
     218        y0 = tmp;
     219      }
     220      return y0 > x1;
    97221    }
    98222  }
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/HeuristicLab.CEDMA.Server-3.3.csproj

    r2290 r2375  
    9191  </ItemGroup>
    9292  <ItemGroup>
     93    <Compile Include="ProblemSpecification.cs" />
    9394    <Compile Include="LearningTask.cs" />
    94     <Compile Include="Problem.cs" />
    9595    <Compile Include="ProblemView.cs">
    9696      <SubType>UserControl</SubType>
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/IDispatcher.cs

    r2222 r2375  
    2424
    2525namespace HeuristicLab.CEDMA.Server {
    26   public interface IDispatcher : IViewable {
     26  public interface IDispatcher {
    2727    IAlgorithm GetNextJob();
    2828  }
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/ProblemView.Designer.cs

    r2223 r2375  
    4747    private void InitializeComponent() {
    4848      this.importButton = new System.Windows.Forms.Button();
    49       this.trainingSamplesStartTextBox = new System.Windows.Forms.TextBox();
    50       this.trainingLabel = new System.Windows.Forms.Label();
    51       this.trainingSamplesEndTextBox = new System.Windows.Forms.TextBox();
    52       this.validationSamplesEndTextBox = new System.Windows.Forms.TextBox();
    53       this.validationSamplesStartTextBox = new System.Windows.Forms.TextBox();
    54       this.validationLabel = new System.Windows.Forms.Label();
    55       this.testSamplesEndTextBox = new System.Windows.Forms.TextBox();
    56       this.testSamplesStartTextBox = new System.Windows.Forms.TextBox();
    57       this.testLabel = new System.Windows.Forms.Label();
    58       this.autoregressiveCheckBox = new System.Windows.Forms.CheckBox();
    59       this.partitioningGroupBox = new System.Windows.Forms.GroupBox();
    6049      this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
    61       this.classificationRadioButton = new System.Windows.Forms.RadioButton();
    62       this.regressionRadioButton = new System.Windows.Forms.RadioButton();
    63       this.timeSeriesRadioButton = new System.Windows.Forms.RadioButton();
    64       this.minTimeOffsetLabel = new System.Windows.Forms.Label();
    65       this.minTimeOffsetTextBox = new System.Windows.Forms.TextBox();
    66       this.learningTaskGroupBox = new System.Windows.Forms.GroupBox();
    67       this.autoregressiveLabel = new System.Windows.Forms.Label();
    68       this.maxTimeOffsetLabel = new System.Windows.Forms.Label();
    69       this.maxTimeOffsetTextBox = new System.Windows.Forms.TextBox();
    70       this.datasetView1 = new HeuristicLab.DataAnalysis.DatasetView();
    71       this.partitioningGroupBox.SuspendLayout();
    72       this.learningTaskGroupBox.SuspendLayout();
     50      this.datasetView = new HeuristicLab.DataAnalysis.DatasetView();
    7351      this.SuspendLayout();
    7452      //
     
    8361      this.importButton.Click += new System.EventHandler(this.importButton_Click);
    8462      //
    85       // trainingSamplesStartTextBox
    86       //
    87       this.trainingSamplesStartTextBox.Location = new System.Drawing.Point(119, 17);
    88       this.trainingSamplesStartTextBox.Name = "trainingSamplesStartTextBox";
    89       this.trainingSamplesStartTextBox.Size = new System.Drawing.Size(96, 20);
    90       this.trainingSamplesStartTextBox.TabIndex = 4;
    91       this.trainingSamplesStartTextBox.Validated += new System.EventHandler(this.samplesTextBox_Validated);
    92       this.trainingSamplesStartTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.samplesTextBox_Validating);
    93       //
    94       // trainingLabel
    95       //
    96       this.trainingLabel.AutoSize = true;
    97       this.trainingLabel.Location = new System.Drawing.Point(13, 20);
    98       this.trainingLabel.Name = "trainingLabel";
    99       this.trainingLabel.Size = new System.Drawing.Size(89, 13);
    100       this.trainingLabel.TabIndex = 3;
    101       this.trainingLabel.Text = "Training samples:";
    102       //
    103       // trainingSamplesEndTextBox
    104       //
    105       this.trainingSamplesEndTextBox.Location = new System.Drawing.Point(221, 17);
    106       this.trainingSamplesEndTextBox.Name = "trainingSamplesEndTextBox";
    107       this.trainingSamplesEndTextBox.Size = new System.Drawing.Size(96, 20);
    108       this.trainingSamplesEndTextBox.TabIndex = 10;
    109       this.trainingSamplesEndTextBox.Validated += new System.EventHandler(this.samplesTextBox_Validated);
    110       this.trainingSamplesEndTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.samplesTextBox_Validating);
    111       //
    112       // validationSamplesEndTextBox
    113       //
    114       this.validationSamplesEndTextBox.Location = new System.Drawing.Point(221, 43);
    115       this.validationSamplesEndTextBox.Name = "validationSamplesEndTextBox";
    116       this.validationSamplesEndTextBox.Size = new System.Drawing.Size(96, 20);
    117       this.validationSamplesEndTextBox.TabIndex = 13;
    118       this.validationSamplesEndTextBox.Validated += new System.EventHandler(this.samplesTextBox_Validated);
    119       this.validationSamplesEndTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.samplesTextBox_Validating);
    120       //
    121       // validationSamplesStartTextBox
    122       //
    123       this.validationSamplesStartTextBox.Location = new System.Drawing.Point(119, 43);
    124       this.validationSamplesStartTextBox.Name = "validationSamplesStartTextBox";
    125       this.validationSamplesStartTextBox.Size = new System.Drawing.Size(96, 20);
    126       this.validationSamplesStartTextBox.TabIndex = 12;
    127       this.validationSamplesStartTextBox.Validated += new System.EventHandler(this.samplesTextBox_Validated);
    128       this.validationSamplesStartTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.samplesTextBox_Validating);
    129       //
    130       // validationLabel
    131       //
    132       this.validationLabel.AutoSize = true;
    133       this.validationLabel.Location = new System.Drawing.Point(5, 46);
    134       this.validationLabel.Name = "validationLabel";
    135       this.validationLabel.Size = new System.Drawing.Size(97, 13);
    136       this.validationLabel.TabIndex = 11;
    137       this.validationLabel.Text = "Validation samples:";
    138       //
    139       // testSamplesEndTextBox
    140       //
    141       this.testSamplesEndTextBox.Location = new System.Drawing.Point(221, 68);
    142       this.testSamplesEndTextBox.Name = "testSamplesEndTextBox";
    143       this.testSamplesEndTextBox.Size = new System.Drawing.Size(96, 20);
    144       this.testSamplesEndTextBox.TabIndex = 16;
    145       this.testSamplesEndTextBox.Validated += new System.EventHandler(this.samplesTextBox_Validated);
    146       this.testSamplesEndTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.samplesTextBox_Validating);
    147       //
    148       // testSamplesStartTextBox
    149       //
    150       this.testSamplesStartTextBox.Location = new System.Drawing.Point(119, 68);
    151       this.testSamplesStartTextBox.Name = "testSamplesStartTextBox";
    152       this.testSamplesStartTextBox.Size = new System.Drawing.Size(96, 20);
    153       this.testSamplesStartTextBox.TabIndex = 15;
    154       this.testSamplesStartTextBox.Validated += new System.EventHandler(this.samplesTextBox_Validated);
    155       this.testSamplesStartTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.samplesTextBox_Validating);
    156       //
    157       // testLabel
    158       //
    159       this.testLabel.AutoSize = true;
    160       this.testLabel.Location = new System.Drawing.Point(30, 71);
    161       this.testLabel.Name = "testLabel";
    162       this.testLabel.Size = new System.Drawing.Size(72, 13);
    163       this.testLabel.TabIndex = 14;
    164       this.testLabel.Text = "Test samples:";
    165       //
    166       // autoregressiveCheckBox
    167       //
    168       this.autoregressiveCheckBox.Anchor = System.Windows.Forms.AnchorStyles.Top;
    169       this.autoregressiveCheckBox.AutoSize = true;
    170       this.autoregressiveCheckBox.Enabled = false;
    171       this.autoregressiveCheckBox.Location = new System.Drawing.Point(131, 83);
    172       this.autoregressiveCheckBox.Name = "autoregressiveCheckBox";
    173       this.autoregressiveCheckBox.Size = new System.Drawing.Size(15, 14);
    174       this.autoregressiveCheckBox.TabIndex = 22;
    175       this.autoregressiveCheckBox.UseVisualStyleBackColor = true;
    176       this.autoregressiveCheckBox.CheckedChanged += new System.EventHandler(this.autoregressiveCheckBox_CheckedChanged);
    177       //
    178       // partitioningGroupBox
    179       //
    180       this.partitioningGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
    181       this.partitioningGroupBox.Controls.Add(this.validationSamplesEndTextBox);
    182       this.partitioningGroupBox.Controls.Add(this.trainingLabel);
    183       this.partitioningGroupBox.Controls.Add(this.trainingSamplesStartTextBox);
    184       this.partitioningGroupBox.Controls.Add(this.trainingSamplesEndTextBox);
    185       this.partitioningGroupBox.Controls.Add(this.validationLabel);
    186       this.partitioningGroupBox.Controls.Add(this.testSamplesEndTextBox);
    187       this.partitioningGroupBox.Controls.Add(this.validationSamplesStartTextBox);
    188       this.partitioningGroupBox.Controls.Add(this.testSamplesStartTextBox);
    189       this.partitioningGroupBox.Controls.Add(this.testLabel);
    190       this.partitioningGroupBox.Location = new System.Drawing.Point(3, 452);
    191       this.partitioningGroupBox.Name = "partitioningGroupBox";
    192       this.partitioningGroupBox.Size = new System.Drawing.Size(326, 100);
    193       this.partitioningGroupBox.TabIndex = 25;
    194       this.partitioningGroupBox.TabStop = false;
    195       this.partitioningGroupBox.Text = "Data set partitions:";
    196       //
    19763      // openFileDialog
    19864      //
     
    20268      this.openFileDialog.Title = "Import data set from file";
    20369      //
    204       // classificationRadioButton
     70      // datasetView
    20571      //
    206       this.classificationRadioButton.AutoSize = true;
    207       this.classificationRadioButton.Checked = true;
    208       this.classificationRadioButton.Location = new System.Drawing.Point(6, 16);
    209       this.classificationRadioButton.Name = "classificationRadioButton";
    210       this.classificationRadioButton.Size = new System.Drawing.Size(86, 17);
    211       this.classificationRadioButton.TabIndex = 28;
    212       this.classificationRadioButton.TabStop = true;
    213       this.classificationRadioButton.Text = "Classification";
    214       this.classificationRadioButton.UseVisualStyleBackColor = true;
    215       this.classificationRadioButton.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChanged);
    216       //
    217       // regressionRadioButton
    218       //
    219       this.regressionRadioButton.AutoSize = true;
    220       this.regressionRadioButton.Location = new System.Drawing.Point(6, 39);
    221       this.regressionRadioButton.Name = "regressionRadioButton";
    222       this.regressionRadioButton.Size = new System.Drawing.Size(78, 17);
    223       this.regressionRadioButton.TabIndex = 29;
    224       this.regressionRadioButton.Text = "Regression";
    225       this.regressionRadioButton.UseVisualStyleBackColor = true;
    226       this.regressionRadioButton.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChanged);
    227       //
    228       // timeSeriesRadioButton
    229       //
    230       this.timeSeriesRadioButton.AutoSize = true;
    231       this.timeSeriesRadioButton.Location = new System.Drawing.Point(6, 62);
    232       this.timeSeriesRadioButton.Name = "timeSeriesRadioButton";
    233       this.timeSeriesRadioButton.Size = new System.Drawing.Size(119, 17);
    234       this.timeSeriesRadioButton.TabIndex = 30;
    235       this.timeSeriesRadioButton.Text = "Time series forecast";
    236       this.timeSeriesRadioButton.UseVisualStyleBackColor = true;
    237       this.timeSeriesRadioButton.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChanged);
    238       //
    239       // minTimeOffsetLabel
    240       //
    241       this.minTimeOffsetLabel.AutoSize = true;
    242       this.minTimeOffsetLabel.Enabled = false;
    243       this.minTimeOffsetLabel.Location = new System.Drawing.Point(38, 106);
    244       this.minTimeOffsetLabel.Name = "minTimeOffsetLabel";
    245       this.minTimeOffsetLabel.Size = new System.Drawing.Size(87, 13);
    246       this.minTimeOffsetLabel.TabIndex = 31;
    247       this.minTimeOffsetLabel.Text = "Min. Time Offset:";
    248       //
    249       // minTimeOffsetTextBox
    250       //
    251       this.minTimeOffsetTextBox.Enabled = false;
    252       this.minTimeOffsetTextBox.Location = new System.Drawing.Point(131, 103);
    253       this.minTimeOffsetTextBox.Name = "minTimeOffsetTextBox";
    254       this.minTimeOffsetTextBox.Size = new System.Drawing.Size(96, 20);
    255       this.minTimeOffsetTextBox.TabIndex = 32;
    256       this.minTimeOffsetTextBox.Validated += new System.EventHandler(this.timeOffsetTextBox_Validated);
    257       this.minTimeOffsetTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.timeOffsetTextBox_Validating);
    258       //
    259       // learningTaskGroupBox
    260       //
    261       this.learningTaskGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
    262       this.learningTaskGroupBox.Controls.Add(this.autoregressiveLabel);
    263       this.learningTaskGroupBox.Controls.Add(this.classificationRadioButton);
    264       this.learningTaskGroupBox.Controls.Add(this.minTimeOffsetLabel);
    265       this.learningTaskGroupBox.Controls.Add(this.minTimeOffsetTextBox);
    266       this.learningTaskGroupBox.Controls.Add(this.maxTimeOffsetLabel);
    267       this.learningTaskGroupBox.Controls.Add(this.regressionRadioButton);
    268       this.learningTaskGroupBox.Controls.Add(this.maxTimeOffsetTextBox);
    269       this.learningTaskGroupBox.Controls.Add(this.timeSeriesRadioButton);
    270       this.learningTaskGroupBox.Controls.Add(this.autoregressiveCheckBox);
    271       this.learningTaskGroupBox.Location = new System.Drawing.Point(335, 452);
    272       this.learningTaskGroupBox.Name = "learningTaskGroupBox";
    273       this.learningTaskGroupBox.Size = new System.Drawing.Size(326, 163);
    274       this.learningTaskGroupBox.TabIndex = 35;
    275       this.learningTaskGroupBox.TabStop = false;
    276       this.learningTaskGroupBox.Text = "Learning task";
    277       //
    278       // autoregressiveLabel
    279       //
    280       this.autoregressiveLabel.AutoSize = true;
    281       this.autoregressiveLabel.Enabled = false;
    282       this.autoregressiveLabel.Location = new System.Drawing.Point(45, 83);
    283       this.autoregressiveLabel.Name = "autoregressiveLabel";
    284       this.autoregressiveLabel.Size = new System.Drawing.Size(80, 13);
    285       this.autoregressiveLabel.TabIndex = 35;
    286       this.autoregressiveLabel.Text = "Autoregressive:";
    287       //
    288       // maxTimeOffsetLabel
    289       //
    290       this.maxTimeOffsetLabel.AutoSize = true;
    291       this.maxTimeOffsetLabel.Enabled = false;
    292       this.maxTimeOffsetLabel.Location = new System.Drawing.Point(35, 132);
    293       this.maxTimeOffsetLabel.Name = "maxTimeOffsetLabel";
    294       this.maxTimeOffsetLabel.Size = new System.Drawing.Size(90, 13);
    295       this.maxTimeOffsetLabel.TabIndex = 33;
    296       this.maxTimeOffsetLabel.Text = "Max. Time Offset:";
    297       //
    298       // maxTimeOffsetTextBox
    299       //
    300       this.maxTimeOffsetTextBox.Enabled = false;
    301       this.maxTimeOffsetTextBox.Location = new System.Drawing.Point(131, 129);
    302       this.maxTimeOffsetTextBox.Name = "maxTimeOffsetTextBox";
    303       this.maxTimeOffsetTextBox.Size = new System.Drawing.Size(96, 20);
    304       this.maxTimeOffsetTextBox.TabIndex = 34;
    305       this.maxTimeOffsetTextBox.Validated += new System.EventHandler(this.timeOffsetTextBox_Validated);
    306       this.maxTimeOffsetTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.timeOffsetTextBox_Validating);
    307       //
    308       // datasetView1
    309       //
    310       this.datasetView1.Location = new System.Drawing.Point(3, 32);
    311       this.datasetView1.Name = "datasetView1";
    312       this.datasetView1.Size = new System.Drawing.Size(770, 414);
    313       this.datasetView1.TabIndex = 36;
     72      this.datasetView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     73                  | System.Windows.Forms.AnchorStyles.Left)
     74                  | System.Windows.Forms.AnchorStyles.Right)));
     75      this.datasetView.Caption = "Editor";
     76      this.datasetView.Dataset = null;
     77      this.datasetView.Filename = null;
     78      this.datasetView.Location = new System.Drawing.Point(3, 32);
     79      this.datasetView.Name = "datasetView";
     80      this.datasetView.Size = new System.Drawing.Size(770, 580);
     81      this.datasetView.TabIndex = 36;
    31482      //
    31583      // ProblemView
     
    31785      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    31886      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    319       this.Controls.Add(this.datasetView1);
    320       this.Controls.Add(this.learningTaskGroupBox);
    321       this.Controls.Add(this.partitioningGroupBox);
     87      this.Controls.Add(this.datasetView);
    32288      this.Controls.Add(this.importButton);
    32389      this.Name = "ProblemView";
    32490      this.Size = new System.Drawing.Size(776, 615);
    325       this.partitioningGroupBox.ResumeLayout(false);
    326       this.partitioningGroupBox.PerformLayout();
    327       this.learningTaskGroupBox.ResumeLayout(false);
    328       this.learningTaskGroupBox.PerformLayout();
    32991      this.ResumeLayout(false);
    33092
     
    33496
    33597    private System.Windows.Forms.Button importButton;
    336     private System.Windows.Forms.TextBox trainingSamplesStartTextBox;
    337     private System.Windows.Forms.Label trainingLabel;
    338     private System.Windows.Forms.TextBox trainingSamplesEndTextBox;
    339     private System.Windows.Forms.TextBox validationSamplesEndTextBox;
    340     private System.Windows.Forms.TextBox validationSamplesStartTextBox;
    341     private System.Windows.Forms.Label validationLabel;
    342     private System.Windows.Forms.TextBox testSamplesEndTextBox;
    343     private System.Windows.Forms.TextBox testSamplesStartTextBox;
    344     private System.Windows.Forms.Label testLabel;
    345     private System.Windows.Forms.CheckBox autoregressiveCheckBox;
    346     private System.Windows.Forms.GroupBox partitioningGroupBox;
    34798    private System.Windows.Forms.OpenFileDialog openFileDialog;
    348     private System.Windows.Forms.RadioButton classificationRadioButton;
    349     private System.Windows.Forms.RadioButton regressionRadioButton;
    350     private System.Windows.Forms.RadioButton timeSeriesRadioButton;
    351     private System.Windows.Forms.Label minTimeOffsetLabel;
    352     private System.Windows.Forms.TextBox minTimeOffsetTextBox;
    353     private System.Windows.Forms.GroupBox learningTaskGroupBox;
    354     private System.Windows.Forms.Label maxTimeOffsetLabel;
    355     private System.Windows.Forms.TextBox maxTimeOffsetTextBox;
    356     private System.Windows.Forms.Label autoregressiveLabel;
    357     private HeuristicLab.DataAnalysis.DatasetView datasetView1;
     99    private HeuristicLab.DataAnalysis.DatasetView datasetView;
    358100  }
    359101}
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/ProblemView.cs

    r2290 r2375  
    3535namespace HeuristicLab.CEDMA.Server {
    3636  public partial class ProblemView : ViewBase {
    37     private Problem problem;
     37    private Dataset dataset;
    3838
    39     public ProblemView(Problem problem) {
    40       this.problem = problem;
    41       problem.Changed += (sender, args) => UpdateControls();
     39    public ProblemView(Dataset dataset) {
     40      this.dataset = dataset;
    4241      InitializeComponent();
     42      datasetView.Dataset = dataset;
     43      dataset.Changed += (sender, args) => UpdateControls();
    4344      UpdateControls();
    44     }
    45 
    46     protected override void UpdateControls() {
    47       base.UpdateControls();
    48       trainingSamplesStartTextBox.Text = problem.TrainingSamplesStart.ToString();
    49       trainingSamplesEndTextBox.Text = problem.TrainingSamplesEnd.ToString();
    50       validationSamplesStartTextBox.Text = problem.ValidationSamplesStart.ToString();
    51       validationSamplesEndTextBox.Text = problem.ValidationSamplesEnd.ToString();
    52       testSamplesStartTextBox.Text = problem.TestSamplesStart.ToString();
    53       testSamplesEndTextBox.Text = problem.TestSamplesEnd.ToString();
    54       minTimeOffsetTextBox.Text = problem.MinTimeOffset.ToString();
    55       maxTimeOffsetTextBox.Text = problem.MaxTimeOffset.ToString();
    56       autoregressiveCheckBox.Checked = problem.AutoRegressive;
    57       switch (problem.LearningTask) {
    58         case LearningTask.Classification: classificationRadioButton.Checked = true; break;
    59         case LearningTask.Regression: regressionRadioButton.Checked = true; break;
    60         case LearningTask.TimeSeries: timeSeriesRadioButton.Checked = true; break;
    61       }
    6245    }
    6346
     
    8467        }
    8568        if (success) {
    86           Dataset dataset = (Dataset)problem.Dataset;
    8769          dataset.Rows = parser.Rows;
    8870          dataset.Columns = parser.Columns;
     
    9072          dataset.Samples = new double[dataset.Rows * dataset.Columns];
    9173          Array.Copy(parser.Samples, dataset.Samples, dataset.Columns * dataset.Rows);
    92           datasetView1.Dataset = problem.Dataset;
     74          datasetView.Dataset = dataset;
    9375
    94           problem.TrainingSamplesStart = parser.TrainingSamplesStart;
    95           problem.ValidationSamplesEnd = parser.TrainingSamplesStart;
    96           problem.TrainingSamplesEnd = parser.TrainingSamplesEnd;
    97           problem.ValidationSamplesStart = parser.ValidationSamplesStart;
    98           problem.ValidationSamplesEnd = parser.ValidationSamplesEnd;
    99           problem.TestSamplesStart = parser.TestSamplesStart;
    100           problem.TestSamplesEnd = parser.TestSamplesEnd;
    10176          for (int i = 0; i < parser.VariableNames.Length; i++) {
    10277            dataset.SetVariableName(i, parser.VariableNames[i]);
    10378          }
    10479
    105           problem.FireChanged();
     80
    10681          Refresh();
    10782        }
     
    10984    }
    11085
    111     private void autoregressiveCheckBox_CheckedChanged(object sender, EventArgs e) {
    112       problem.AutoRegressive = autoregressiveCheckBox.Checked;
    113       problem.FireChanged();
    114     }
    115 
    116     private void samplesTextBox_Validating(object sender, CancelEventArgs e) {
    117       try {
    118         int trainingStart = int.Parse(trainingSamplesStartTextBox.Text);
    119         int trainingEnd = int.Parse(trainingSamplesEndTextBox.Text);
    120         int validationStart = int.Parse(validationSamplesStartTextBox.Text);
    121         int validationEnd = int.Parse(validationSamplesEndTextBox.Text);
    122         int testStart = int.Parse(testSamplesStartTextBox.Text);
    123         int testEnd = int.Parse(testSamplesEndTextBox.Text);
    124         if (trainingStart < 0 || validationStart < 0 || testStart < 0 ||
    125           trainingEnd >= problem.Dataset.Rows || validationEnd >= problem.Dataset.Rows || testEnd >= problem.Dataset.Rows ||
    126           trainingStart >= trainingEnd ||
    127           validationStart >= validationEnd ||
    128           testStart >= testEnd ||
    129           IsOverlapping(trainingStart, trainingEnd, validationStart, validationEnd) ||
    130           IsOverlapping(trainingStart, trainingEnd, testStart, testEnd) ||
    131           IsOverlapping(validationStart, validationEnd, testStart, testEnd))
    132           ColorSamplesTextBoxes(Color.Red);
    133         else
    134           ColorSamplesTextBoxes(Color.White);
    135       }
    136       catch (FormatException ex) {
    137         ColorSamplesTextBoxes(Color.Red);
    138       }
    139     }
    140 
    141     private void samplesTextBox_Validated(object sender, EventArgs e) {
    142       problem.TrainingSamplesStart = int.Parse(trainingSamplesStartTextBox.Text);
    143       problem.TrainingSamplesEnd = int.Parse(trainingSamplesEndTextBox.Text);
    144       problem.ValidationSamplesStart = int.Parse(validationSamplesStartTextBox.Text);
    145       problem.ValidationSamplesEnd = int.Parse(validationSamplesEndTextBox.Text);
    146       problem.TestSamplesStart = int.Parse(testSamplesStartTextBox.Text);
    147       problem.TestSamplesEnd = int.Parse(testSamplesEndTextBox.Text);
    148       problem.FireChanged();
    149     }
    150 
    151     private void ColorSamplesTextBoxes(Color color) {
    152       trainingSamplesStartTextBox.BackColor = color;
    153       trainingSamplesEndTextBox.BackColor = color;
    154       validationSamplesStartTextBox.BackColor = color;
    155       validationSamplesEndTextBox.BackColor = color;
    156       testSamplesStartTextBox.BackColor = color;
    157       testSamplesEndTextBox.BackColor = color;
    158     }
    159 
    160     private bool IsOverlapping(int x0, int y0, int x1, int y1) {
    161       Trace.Assert(x0 <= y0 && x1 <= y1);
    162       int tmp;
    163       // make sure that x0,y0 is the left interval
    164       if (x1 < x0) {
    165         tmp = x1;
    166         x1 = x0;
    167         x0 = tmp;
    168         tmp = y1;
    169         y1 = y0;
    170         y0 = tmp;
    171       }
    172       return y0 > x1;
    173     }
    17486    private void ShowWarningMessageBox(Exception ex) {
    17587      MessageBox.Show(ex.Message,
     
    195107    }
    196108
    197     private void radioButton_CheckedChanged(object sender, EventArgs e) {
    198       minTimeOffsetLabel.Enabled = timeSeriesRadioButton.Checked;
    199       minTimeOffsetTextBox.Enabled = timeSeriesRadioButton.Checked;
    200       maxTimeOffsetLabel.Enabled = timeSeriesRadioButton.Checked;
    201       maxTimeOffsetTextBox.Enabled = timeSeriesRadioButton.Checked;
    202       autoregressiveCheckBox.Enabled = timeSeriesRadioButton.Checked;
    203       autoregressiveLabel.Enabled = timeSeriesRadioButton.Checked;
    204       if (timeSeriesRadioButton.Checked) problem.LearningTask = LearningTask.TimeSeries;
    205       else if (classificationRadioButton.Checked) problem.LearningTask = LearningTask.Classification;
    206       else if (regressionRadioButton.Checked) problem.LearningTask = LearningTask.Regression;
    207       problem.FireChanged();
    208     }
    209 
    210     private void timeOffsetTextBox_Validating(object sender, CancelEventArgs e) {
    211       int min, max;
    212       e.Cancel = !int.TryParse(minTimeOffsetTextBox.Text, out min);
    213       e.Cancel = !int.TryParse(maxTimeOffsetTextBox.Text, out max);
    214       e.Cancel = min > max;
    215     }
    216     private void timeOffsetTextBox_Validated(object sender, EventArgs e) {
    217       problem.MinTimeOffset = int.Parse(minTimeOffsetTextBox.Text);
    218       problem.MaxTimeOffset = int.Parse(maxTimeOffsetTextBox.Text);
    219       problem.FireChanged();
    220     }
    221109  }
    222110}
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/Server.cs

    r2223 r2375  
    3333using HeuristicLab.Modeling.Database;
    3434using HeuristicLab.Modeling.Database.SQLServerCompact;
     35using HeuristicLab.DataAnalysis;
    3536
    3637namespace HeuristicLab.CEDMA.Server {
     
    4445    private IExecuter executer;
    4546    public IExecuter Executer { get { return executer; } }
    46     private Problem problem;
    47     public Problem Problem { get { return problem; } }
     47    //private Problem problem;
     48    //public Problem Problem { get { return problem; } }
     49    private Dataset dataset;
     50    public Dataset Dataset { get { return dataset; } }
    4851
    4952    private string gridServiceUrl;
     
    5558    public Server() {
    5659      database = new DatabaseService(sqlServerCompactConnectionString);
    57       problem = new Problem();
     60      dataset = new Dataset();
    5861      try {
    59         problem.Dataset = database.GetDataset();
     62        dataset = database.GetDataset();
    6063      }
    61       catch (InvalidOperationException ex) {
     64      catch (InvalidOperationException) {
    6265      }
    6366    }
    6467
    6568    internal void Connect(string serverUrl) {
    66       dispatcher = new SimpleDispatcher(database, problem);
     69      dispatcher = new SimpleDispatcher(database, dataset);
    6770      IGridServer gridServer = null;
    6871      if (serverUrl.Contains("ExecutionEngine")) {
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/ServerApplication.cs

    r2223 r2375  
    2727
    2828namespace HeuristicLab.CEDMA.Server {
    29   [ClassInfo(Name = "CEDMA", Description = "Cooperative Evolutionary Data Mining.", AutoRestart=true)]
     29  [ClassInfo(Name = "CEDMA", Description = "Cooperative Evolutionary Data Mining.", AutoRestart = true)]
    3030  class ServerApplication : ApplicationBase {
    3131    public override void Run() {
     
    3535      serverControl.Dock = DockStyle.Fill;
    3636      mainForm.Controls.Add(serverControl);
    37       mainForm.Name = "CEDMA";
     37      mainForm.Text = "CEDMA";
    3838      Application.Run(mainForm);
    3939    }
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/ServerView.cs

    r2223 r2375  
    4242    private Server server;
    4343
    44     public ServerView(Server server) : base() {
     44    public ServerView(Server server)
     45      : base() {
    4546      this.server = server;
    4647      InitializeComponent();
     
    5253      executerControl.Dock = DockStyle.Fill;
    5354      executerTabPage.Controls.Add(executerControl);
    54       UserControl dispatcherControl = (UserControl)server.Dispatcher.CreateView();
     55      UserControl dispatcherControl = (UserControl)((IViewable)server.Dispatcher).CreateView();
    5556      dispatcherControl.Dock = DockStyle.Fill;
    5657      dispatcherTabPage.Controls.Add(dispatcherControl);
    57       UserControl problemControl = (UserControl)server.Problem.CreateView();
     58      UserControl problemControl = new ProblemView(server.Dataset);
    5859      problemControl.Dock = DockStyle.Fill;
    5960      problemPage.Controls.Add(problemControl);
    60       connectButton.Enabled = false;     
     61      connectButton.Enabled = false;
    6162    }
    6263  }
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/ServerView.designer.cs

    r2223 r2375  
    5858      //
    5959      this.gridAddressLabel.AutoSize = true;
    60       this.gridAddressLabel.Location = new System.Drawing.Point(12, 35);
     60      this.gridAddressLabel.Location = new System.Drawing.Point(2, 8);
    6161      this.gridAddressLabel.Name = "gridAddressLabel";
    6262      this.gridAddressLabel.Size = new System.Drawing.Size(69, 13);
     
    6666      // address
    6767      //
    68       this.address.Location = new System.Drawing.Point(106, 32);
     68      this.address.Location = new System.Drawing.Point(96, 5);
    6969      this.address.Name = "address";
    7070      this.address.Size = new System.Drawing.Size(160, 20);
     
    7373      // connectButton
    7474      //
    75       this.connectButton.Location = new System.Drawing.Point(272, 30);
     75      this.connectButton.Location = new System.Drawing.Point(262, 3);
    7676      this.connectButton.Name = "connectButton";
    7777      this.connectButton.Size = new System.Drawing.Size(75, 23);
     
    8989      this.tabControl.Controls.Add(this.dispatcherTabPage);
    9090      this.tabControl.Controls.Add(this.problemPage);
    91       this.tabControl.Location = new System.Drawing.Point(3, 58);
     91      this.tabControl.Location = new System.Drawing.Point(3, 31);
    9292      this.tabControl.Name = "tabControl";
    9393      this.tabControl.SelectedIndex = 0;
    94       this.tabControl.Size = new System.Drawing.Size(573, 543);
     94      this.tabControl.Size = new System.Drawing.Size(573, 570);
    9595      this.tabControl.TabIndex = 14;
    9696      //
     
    100100      this.executerTabPage.Name = "executerTabPage";
    101101      this.executerTabPage.Padding = new System.Windows.Forms.Padding(3);
    102       this.executerTabPage.Size = new System.Drawing.Size(565, 517);
     102      this.executerTabPage.Size = new System.Drawing.Size(565, 544);
    103103      this.executerTabPage.TabIndex = 0;
    104104      this.executerTabPage.Text = "Executer";
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/SimpleDispatcher.cs

    r2366 r2375  
    3434using HeuristicLab.Modeling;
    3535using HeuristicLab.Modeling.Database;
     36using HeuristicLab.DataAnalysis;
    3637
    3738namespace HeuristicLab.CEDMA.Server {
    38   public class SimpleDispatcher : IDispatcher {
     39  public class SimpleDispatcher : IDispatcher, IViewable {
    3940    private class AlgorithmConfiguration {
    4041      public string name;
    41       public int targetVariable;
    42       public List<int> inputVariables;
    43     }
     42      public ProblemSpecification problemSpecification;
     43    }
     44
     45    internal event EventHandler Changed;
    4446
    4547    private IModelingDatabase database;
     
    5052    }
    5153
    52     private Problem problem;
    53     public Problem Problem {
     54    private Dataset dataset;
     55    public Dataset Dataset {
    5456      get {
    55         return problem;
    56       }
    57     }
    58     internal event EventHandler Changed;
     57        return dataset;
     58      }
     59    }
    5960
    6061    public IEnumerable<string> TargetVariables {
    6162      get {
    62         return Enumerable.Range(0, problem.Dataset.Columns).Select(x => problem.Dataset.GetVariableName(x));
    63       }
    64     }
    65 
    66     public IEnumerable<string> InputVariables {
     63        return Enumerable.Range(0, Dataset.Columns).Select(x => Dataset.GetVariableName(x));
     64      }
     65    }
     66
     67    public IEnumerable<string> Variables {
    6768      get {
    6869        return TargetVariables;
     
    7071    }
    7172
    72     private HeuristicLab.Modeling.IAlgorithm[] algorithms;
    73     public IEnumerable<HeuristicLab.Modeling.IAlgorithm> Algorithms {
    74       get {
    75         switch (Problem.LearningTask) {
    76           case LearningTask.Regression: {
    77               return algorithms.Where(a => (a as IClassificationAlgorithm) == null && (a as ITimeSeriesAlgorithm) == null);
    78             }
    79           case LearningTask.Classification: {
    80               return algorithms.Where(a => (a as IClassificationAlgorithm) != null);
    81             }
    82           case LearningTask.TimeSeries: {
    83               return algorithms.Where(a => (a as ITimeSeriesAlgorithm) != null);
    84             }
    85         }
    86         return new HeuristicLab.Modeling.IAlgorithm[] { };
    87       }
    88     }
    89 
    90     private List<HeuristicLab.Modeling.IAlgorithm> activeAlgorithms;
    91     public IEnumerable<HeuristicLab.Modeling.IAlgorithm> ActiveAlgorithms {
    92       get { return activeAlgorithms; }
     73    private HeuristicLab.Modeling.IAlgorithm[] defaultAlgorithms;
     74    public IEnumerable<HeuristicLab.Modeling.IAlgorithm> GetAlgorithms(LearningTask task) {
     75      switch (task) {
     76        case LearningTask.Regression: {
     77            return defaultAlgorithms.Where(a => (a as IClassificationAlgorithm) == null && (a as ITimeSeriesAlgorithm) == null);
     78          }
     79        case LearningTask.Classification: {
     80            return defaultAlgorithms.Where(a => (a as IClassificationAlgorithm) != null);
     81          }
     82        case LearningTask.TimeSeries: {
     83            return defaultAlgorithms.Where(a => (a as ITimeSeriesAlgorithm) != null);
     84          }
     85        default: {
     86            return new HeuristicLab.Modeling.IAlgorithm[] { };
     87          }
     88      }
    9389    }
    9490
    9591    private Random random;
    96     private List<int> allowedTargetVariables;
    97     private Dictionary<int, List<int>> activeInputVariables;
    98     private Dictionary<int, List<AlgorithmConfiguration>> finishedAndDispatchedRuns;
     92    private Dictionary<string, ProblemSpecification> problemSpecifications;
     93    private Dictionary<string, List<HeuristicLab.Modeling.IAlgorithm>> algorithms;
     94    public IEnumerable<HeuristicLab.Modeling.IAlgorithm> GetAllowedAlgorithms(string targetVariable) {
     95      if (algorithms.ContainsKey(targetVariable))
     96        return algorithms[targetVariable];
     97      else return new HeuristicLab.Modeling.IAlgorithm[] { };
     98    }
     99    private Dictionary<string, bool> activeVariables;
     100    public IEnumerable<string> AllowedTargetVariables {
     101      get { return activeVariables.Where(x => x.Value).Select(x => x.Key); }
     102    }
     103    private Dictionary<string, List<AlgorithmConfiguration>> finishedAndDispatchedRuns;
    99104    private object locker = new object();
    100105
    101     public SimpleDispatcher(IModelingDatabase database, Problem problem) {
    102       this.problem = problem;
     106    public SimpleDispatcher(IModelingDatabase database, Dataset dataset) {
     107      this.dataset = dataset;
    103108      this.database = database;
    104       this.random = new Random();
    105 
    106       this.finishedAndDispatchedRuns = new Dictionary<int, List<AlgorithmConfiguration>>();
    107       this.allowedTargetVariables = new List<int>();
    108       this.activeInputVariables = new Dictionary<int, List<int>>();
    109       this.activeAlgorithms = new List<HeuristicLab.Modeling.IAlgorithm>();
     109      dataset.Changed += (sender, args) => FireChanged();
     110      random = new Random();
     111
     112      activeVariables = new Dictionary<string, bool>();
     113      problemSpecifications = new Dictionary<string, ProblemSpecification>();
     114      algorithms = new Dictionary<string, List<HeuristicLab.Modeling.IAlgorithm>>();
     115      finishedAndDispatchedRuns = new Dictionary<string, List<AlgorithmConfiguration>>();
     116
    110117      DiscoveryService ds = new DiscoveryService();
    111       this.algorithms = ds.GetInstances<HeuristicLab.Modeling.IAlgorithm>();
    112       problem.Changed += (sender, args) => {
    113         lock (locker) {
    114           allowedTargetVariables.Clear();
    115           activeInputVariables.Clear();
    116           activeAlgorithms.Clear();
    117         }
    118         OnChanged();
    119       };
    120 
    121       PopulateFinishedRuns();
     118      defaultAlgorithms = ds.GetInstances<HeuristicLab.Modeling.IAlgorithm>();
     119
     120      // PopulateFinishedRuns();
    122121    }
    123122
    124123    public HeuristicLab.Modeling.IAlgorithm GetNextJob() {
    125124      lock (locker) {
    126         if (allowedTargetVariables.Count > 0) {
    127           int[] targetVariables = allowedTargetVariables.ToArray();
    128           int targetVariable = SelectTargetVariable(targetVariables);
    129           int[] inputVariables = activeInputVariables[targetVariable].ToArray();
    130 
    131           HeuristicLab.Modeling.IAlgorithm selectedAlgorithm = SelectAndConfigureAlgorithm(targetVariable, inputVariables, problem);
     125        if (activeVariables.Count > 0) {
     126          string[] targetVariables = activeVariables.Keys.ToArray();
     127          string targetVariable = SelectTargetVariable(targetVariables);
     128          HeuristicLab.Modeling.IAlgorithm selectedAlgorithm = SelectAndConfigureAlgorithm(targetVariable);
    132129
    133130          return selectedAlgorithm;
     
    136133    }
    137134
    138     public virtual int SelectTargetVariable(int[] targetVariables) {
     135    public virtual string SelectTargetVariable(string[] targetVariables) {
    139136      return targetVariables[random.Next(targetVariables.Length)];
    140137    }
    141138
    142     public HeuristicLab.Modeling.IAlgorithm SelectAndConfigureAlgorithm(int targetVariable, int[] inputVariables, Problem problem) {
     139    public HeuristicLab.Modeling.IAlgorithm SelectAndConfigureAlgorithm(string targetVariable) {
    143140      HeuristicLab.Modeling.IAlgorithm selectedAlgorithm = null;
    144       DiscoveryService ds = new DiscoveryService();
    145       var allAlgorithms = ds.GetInstances<HeuristicLab.Modeling.IAlgorithm>();
    146       var allowedAlgorithmTypes = activeAlgorithms.Select(x => x.GetType());
    147141      var possibleAlgos =
    148         allAlgorithms
    149         .Where(x => allowedAlgorithmTypes.Contains(x.GetType()) &&
    150           ((x is IStochasticAlgorithm) || !AlgorithmFinishedOrDispatched(targetVariable, inputVariables, x.Name)));
     142        algorithms[targetVariable]
     143        .Where(x =>
     144          ((x is IStochasticAlgorithm) || !AlgorithmFinishedOrDispatched(problemSpecifications[targetVariable], x.Name)));
    151145      if (possibleAlgos.Count() > 0) selectedAlgorithm = possibleAlgos.ElementAt(random.Next(possibleAlgos.Count()));
    152146      if (selectedAlgorithm != null) {
    153         SetProblemParameters(selectedAlgorithm, problem, targetVariable, inputVariables);
     147        SetProblemParameters(selectedAlgorithm, problemSpecifications[targetVariable]);
    154148        if (!(selectedAlgorithm is IStochasticAlgorithm))
    155           AddDispatchedRun(targetVariable, inputVariables, selectedAlgorithm.Name);
     149          AddDispatchedRun(problemSpecifications[targetVariable], selectedAlgorithm.Name);
    156150      }
    157151      return selectedAlgorithm;
    158152    }
    159153
    160     private void PopulateFinishedRuns() {
    161       var dispatchedAlgos = from model in Database.GetAllModels()
    162                             select new {
    163                               TargetVariable = model.TargetVariable.Name,
    164                               Algorithm = model.Algorithm.Name,
    165                               Inputvariables = Database.GetInputVariableResults(model).Select(x => x.Variable.Name).Distinct()
    166                             };
    167       foreach (var algo in dispatchedAlgos) {
    168         AddDispatchedRun(algo.TargetVariable, algo.Inputvariables, algo.Algorithm);
    169       }
    170     }
    171 
    172     private void SetProblemParameters(HeuristicLab.Modeling.IAlgorithm algo, Problem problem, int targetVariable, int[] inputVariables) {
    173       algo.Dataset = problem.Dataset;
    174       algo.TargetVariable = targetVariable;
    175       algo.ProblemInjector.GetVariable("TrainingSamplesStart").GetValue<IntData>().Data = problem.TrainingSamplesStart;
    176       algo.ProblemInjector.GetVariable("TrainingSamplesEnd").GetValue<IntData>().Data = problem.TrainingSamplesEnd;
    177       algo.ProblemInjector.GetVariable("ValidationSamplesStart").GetValue<IntData>().Data = problem.ValidationSamplesStart;
    178       algo.ProblemInjector.GetVariable("ValidationSamplesEnd").GetValue<IntData>().Data = problem.ValidationSamplesEnd;
    179       algo.ProblemInjector.GetVariable("TestSamplesStart").GetValue<IntData>().Data = problem.TestSamplesStart;
    180       algo.ProblemInjector.GetVariable("TestSamplesEnd").GetValue<IntData>().Data = problem.TestSamplesEnd;
    181       ItemList<IntData> allowedFeatures = algo.ProblemInjector.GetVariable("AllowedFeatures").GetValue<ItemList<IntData>>();
    182       foreach (int inputVariable in inputVariables) {
    183         if (inputVariable != targetVariable) {
    184           allowedFeatures.Add(new IntData(inputVariable));
     154    //private void PopulateFinishedRuns() {
     155    //  var dispatchedAlgos = from model in Database.GetAllModels()
     156    //                        select new {
     157    //                          TargetVariable = model.TargetVariable.Name,
     158    //                          Algorithm = model.Algorithm.Name,
     159    //                          InputVariables = Database.GetInputVariableResults(model).Select(x => x.Variable.Name).Distinct(),
     160    //                        };
     161    //  foreach (var algo in dispatchedAlgos) {
     162    //    ProblemSpecification spec = new ProblemSpecification();
     163    //    spec.TargetVariable = algo.TargetVariable;
     164    //    foreach (string variable in algo.InputVariables) spec.AddInputVariable(variable);
     165    //    AddDispatchedRun(spec, algo.Algorithm);
     166    //  }
     167    //}
     168
     169    private void SetProblemParameters(HeuristicLab.Modeling.IAlgorithm algo, ProblemSpecification spec) {
     170      algo.Dataset = spec.Dataset;
     171      algo.TargetVariable = spec.Dataset.GetVariableIndex(spec.TargetVariable);
     172      algo.TrainingSamplesStart = spec.TrainingSamplesStart;
     173      algo.TrainingSamplesEnd = spec.TrainingSamplesEnd;
     174      algo.ValidationSamplesStart = spec.ValidationSamplesStart;
     175      algo.ValidationSamplesEnd = spec.ValidationSamplesEnd;
     176      algo.TestSamplesStart = spec.TestSamplesStart;
     177      algo.TestSamplesEnd = spec.TestSamplesEnd;
     178      List<int> allowedFeatures = new List<int>();
     179      foreach (string inputVariable in spec.InputVariables) {
     180        if (inputVariable != spec.TargetVariable) {
     181          allowedFeatures.Add(spec.Dataset.GetVariableIndex(inputVariable));
    185182        }
    186183      }
    187184
    188       if (problem.LearningTask == LearningTask.TimeSeries) {
     185      if (spec.LearningTask == LearningTask.TimeSeries) {
    189186        ITimeSeriesAlgorithm timeSeriesAlgo = (ITimeSeriesAlgorithm)algo;
    190         timeSeriesAlgo.MinTimeOffset = problem.MinTimeOffset;
    191         timeSeriesAlgo.MaxTimeOffset = problem.MaxTimeOffset;
    192         if (problem.AutoRegressive) {
    193           allowedFeatures.Add(new IntData(targetVariable));
     187        timeSeriesAlgo.MinTimeOffset = spec.MinTimeOffset;
     188        timeSeriesAlgo.MaxTimeOffset = spec.MaxTimeOffset;
     189        if (spec.AutoRegressive) {
     190          allowedFeatures.Add(spec.Dataset.GetVariableIndex(spec.TargetVariable));
    194191        }
    195192      }
    196     }
    197 
    198 
    199     private void AddDispatchedRun(string targetVariable, IEnumerable<string> inputVariables, string algorithm) {
    200       AddDispatchedRun(
    201         Problem.Dataset.GetVariableIndex(targetVariable),
    202         inputVariables.Select(x => Problem.Dataset.GetVariableIndex(x)).ToArray(),
    203         algorithm);
    204     }
    205 
    206     private void AddDispatchedRun(int targetVariable, int[] inputVariables, string algoName) {
    207       if (!finishedAndDispatchedRuns.ContainsKey(targetVariable)) {
    208         finishedAndDispatchedRuns[targetVariable] = new List<AlgorithmConfiguration>();
    209       }
     193      algo.AllowedVariables = allowedFeatures;
     194    }
     195
     196
     197    private void AddDispatchedRun(ProblemSpecification specification, string algorithm) {
    210198      AlgorithmConfiguration conf = new AlgorithmConfiguration();
    211       conf.name = algoName;
    212       conf.inputVariables = new List<int>(inputVariables);
    213       conf.targetVariable = targetVariable;
    214       finishedAndDispatchedRuns[targetVariable].Add(conf);
    215     }
    216 
    217     private bool AlgorithmFinishedOrDispatched(int targetVariable, int[] inputVariables, string algoName) {
     199      conf.name = algorithm;
     200      conf.problemSpecification = new ProblemSpecification(specification);
     201      if (!finishedAndDispatchedRuns.ContainsKey(specification.TargetVariable))
     202        finishedAndDispatchedRuns.Add(specification.TargetVariable, new List<AlgorithmConfiguration>());
     203      finishedAndDispatchedRuns[specification.TargetVariable].Add(conf);
     204    }
     205
     206    private bool AlgorithmFinishedOrDispatched(ProblemSpecification specification, string algoName) {
    218207      return
    219         finishedAndDispatchedRuns.ContainsKey(targetVariable) &&
    220         finishedAndDispatchedRuns[targetVariable].Any(x => targetVariable == x.targetVariable &&
     208        finishedAndDispatchedRuns.ContainsKey(specification.TargetVariable) &&
     209        finishedAndDispatchedRuns[specification.TargetVariable].Any(x =>
    221210                                                           algoName == x.name &&
    222                                                            inputVariables.Count() == x.inputVariables.Count() &&
    223                                                            inputVariables.All(v => x.inputVariables.Contains(v)));
    224     }
    225 
    226     public void EnableAlgorithm(HeuristicLab.Modeling.IAlgorithm algo) {
    227       lock (locker) {
    228         if (!activeAlgorithms.Contains(algo)) activeAlgorithms.Add(algo);
    229       }
    230     }
    231 
    232     public void DisableAlgorithm(HeuristicLab.Modeling.IAlgorithm algo) {
    233       lock (locker) {
    234         while (activeAlgorithms.Remove(algo)) ;
    235       }
     211                                                           specification.Equals(x.problemSpecification));
    236212    }
    237213
    238214    internal void EnableTargetVariable(string name) {
    239       int varIndex = problem.Dataset.GetVariableIndex(name);
    240       lock (locker)
    241         if (!allowedTargetVariables.Contains(varIndex)) allowedTargetVariables.Add(varIndex);
     215      activeVariables[name] = true;
    242216    }
    243217
    244218    internal void DisableTargetVariable(string name) {
    245       int varIndex = problem.Dataset.GetVariableIndex(name);
    246       lock (locker)
    247         while (allowedTargetVariables.Remove(varIndex)) ;
    248     }
    249 
    250     internal void EnableInputVariable(string target, string name) {
    251       int targetIndex = problem.Dataset.GetVariableIndex(target);
    252       int inputIndex = problem.Dataset.GetVariableIndex(name);
    253       lock (locker) {
    254         if (!activeInputVariables.ContainsKey(targetIndex)) activeInputVariables[targetIndex] = new List<int>();
    255         if (!activeInputVariables[targetIndex].Contains(inputIndex)) {
    256           activeInputVariables[targetIndex].Add(inputIndex);
    257         }
    258       }
    259     }
    260 
    261     internal void DisableInputVariable(string target, string name) {
    262       int targetIndex = problem.Dataset.GetVariableIndex(target);
    263       int inputIndex = problem.Dataset.GetVariableIndex(name);
    264       lock (locker) {
    265         if (!activeInputVariables.ContainsKey(targetIndex)) activeInputVariables[targetIndex] = new List<int>();
    266         while (activeInputVariables[targetIndex].Remove(inputIndex)) ;
    267       }
    268     }
    269 
    270     public void OnChanged() {
     219      activeVariables[name] = false;
     220    }
     221
     222    public void EnableAlgorithm(string targetVariable, HeuristicLab.Modeling.IAlgorithm algo) {
     223      if (!algorithms.ContainsKey(targetVariable)) algorithms.Add(targetVariable, new List<HeuristicLab.Modeling.IAlgorithm>());
     224      algorithms[targetVariable].Add(algo);
     225    }
     226
     227    public void DisableAlgorithm(string targetVariable, HeuristicLab.Modeling.IAlgorithm algo) {
     228      algorithms[targetVariable].Remove(algo);
     229    }
     230
     231    public ProblemSpecification GetProblemSpecification(string targetVariable) {
     232      if (!problemSpecifications.ContainsKey(targetVariable))
     233        problemSpecifications[targetVariable] = CreateDefaultProblemSpecification(targetVariable);
     234
     235      return problemSpecifications[targetVariable];
     236    }
     237
     238    //internal void EnableInputVariable(string target, string name) {
     239    //  problemSpecifications[target].AddInputVariable(name);
     240    //}
     241
     242    //internal void DisableInputVariable(string target, string name) {
     243    //  problemSpecifications[target].RemoveInputVariable(name);
     244    //}
     245
     246    //internal void SetLearningTask(string target, LearningTask task) {
     247    //  problemSpecifications[target].LearningTask = task;
     248    //}
     249
     250    //internal void SetDatasetBoundaries(
     251    //  string target,
     252    //  int trainingStart, int trainingEnd,
     253    //  int validationStart, int validationEnd,
     254    //  int testStart, int testEnd) {
     255    //  problemSpecifications[target].TrainingSamplesStart = trainingStart;
     256    //  problemSpecifications[target].TrainingSamplesEnd = trainingEnd;
     257    //  problemSpecifications[target].ValidationSamplesStart = validationStart;
     258    //  problemSpecifications[target].ValidationSamplesEnd = validationEnd;
     259    //  problemSpecifications[target].TestSamplesStart = testStart;
     260    //  problemSpecifications[target].TestSamplesEnd = testEnd;
     261    //}
     262
     263    private ProblemSpecification CreateDefaultProblemSpecification(string targetVariable) {
     264      ProblemSpecification spec = new ProblemSpecification();
     265      spec.Dataset = dataset;
     266      spec.TargetVariable = targetVariable;
     267      spec.LearningTask = LearningTask.Regression;
     268      int targetColumn = dataset.GetVariableIndex(targetVariable);
     269      // find index of first correct target value
     270      int firstValueIndex;
     271      for (firstValueIndex = 0; firstValueIndex < dataset.Rows; firstValueIndex++) {
     272        double x = dataset.GetValue(firstValueIndex, targetColumn);
     273        if (!(double.IsNaN(x) || double.IsInfinity(x))) break;
     274      }
     275      // find index of last correct target value
     276      int lastValueIndex;
     277      for (lastValueIndex = dataset.Rows - 1; lastValueIndex > firstValueIndex; lastValueIndex--) {
     278        double x = dataset.GetValue(lastValueIndex, targetColumn);
     279        if (!(double.IsNaN(x) || double.IsInfinity(x))) break;
     280      }
     281
     282      int validTargetRange = lastValueIndex - firstValueIndex;
     283      spec.TrainingSamplesStart = firstValueIndex;
     284      spec.TrainingSamplesEnd = firstValueIndex + (int)Math.Floor(validTargetRange * 0.5);
     285      spec.ValidationSamplesStart = spec.TrainingSamplesEnd;
     286      spec.ValidationSamplesEnd = firstValueIndex + (int)Math.Floor(validTargetRange * 0.75);
     287      spec.TestSamplesStart = spec.ValidationSamplesEnd;
     288      spec.TestSamplesEnd = lastValueIndex;
     289      return spec;
     290    }
     291
     292    public void FireChanged() {
    271293      if (Changed != null) Changed(this, new EventArgs());
    272294    }
    273 
    274     internal IEnumerable<string> GetInputVariables(string target) {
    275       int targetIndex = problem.Dataset.GetVariableIndex(target);
    276       lock (locker) {
    277         if (!activeInputVariables.ContainsKey(targetIndex)) activeInputVariables[targetIndex] = new List<int>();
    278         return activeInputVariables[targetIndex]
    279           .Select(i => problem.Dataset.GetVariableName(i));
    280       }
    281     }
    282 
    283295
    284296    #region IViewable Members
     
    289301
    290302    #endregion
    291 
    292 
    293303  }
    294304}
  • trunk/sources/HeuristicLab.DataAnalysis/3.2/Dataset.cs

    r2368 r2375  
    198198    public void SetVariableName(int variableIndex, string name) {
    199199      variableNames[variableIndex] = name;
     200      if (fireChangeEvents) FireChanged();
    200201    }
    201202
  • trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/OffspringSelectionGPRegression.cs

    r2363 r2375  
    2121
    2222using System;
     23using System.Linq;
    2324using System.Collections.Generic;
    2425using HeuristicLab.Core;
     
    5455          return CreateGPModel();
    5556      }
     57    }
     58    public IEnumerable<int> AllowedVariables {
     59      get {
     60        ItemList<IntData> allowedVariables = ProblemInjector.GetVariableValue<ItemList<IntData>>("AllowedFeatures", null, false);
     61        return allowedVariables.Select(x => x.Data);
     62      }
     63      set {
     64        ItemList<IntData> allowedVariables = ProblemInjector.GetVariableValue<ItemList<IntData>>("AllowedFeatures", null, false);
     65        foreach (int x in value) allowedVariables.Add(new IntData(x));
     66      }
     67    }
     68
     69    public int TrainingSamplesStart {
     70      get { return ProblemInjector.GetVariableValue<IntData>("TrainingSamplesStart", null, false).Data; }
     71      set { ProblemInjector.GetVariableValue<IntData>("TrainingSamplesStart", null, false).Data = value; }
     72    }
     73
     74    public int TrainingSamplesEnd {
     75      get { return ProblemInjector.GetVariableValue<IntData>("TrainingSamplesEnd", null, false).Data; }
     76      set { ProblemInjector.GetVariableValue<IntData>("TrainingSamplesEnd", null, false).Data = value; }
     77    }
     78
     79    public int ValidationSamplesStart {
     80      get { return ProblemInjector.GetVariableValue<IntData>("ValidationSamplesStart", null, false).Data; }
     81      set { ProblemInjector.GetVariableValue<IntData>("ValidationSamplesStart", null, false).Data = value; }
     82    }
     83
     84    public int ValidationSamplesEnd {
     85      get { return ProblemInjector.GetVariableValue<IntData>("ValidationSamplesEnd", null, false).Data; }
     86      set { ProblemInjector.GetVariableValue<IntData>("ValidationSamplesEnd", null, false).Data = value; }
     87    }
     88
     89    public int TestSamplesStart {
     90      get { return ProblemInjector.GetVariableValue<IntData>("TestSamplesStart", null, false).Data; }
     91      set { ProblemInjector.GetVariableValue<IntData>("TestSamplesStart", null, false).Data = value; }
     92    }
     93
     94    public int TestSamplesEnd {
     95      get { return ProblemInjector.GetVariableValue<IntData>("TestSamplesEnd", null, false).Data; }
     96      set { ProblemInjector.GetVariableValue<IntData>("TestSamplesEnd", null, false).Data = value; }
    5697    }
    5798
  • trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/StandardGPRegression.cs

    r2363 r2375  
    2929using System.Collections.Generic;
    3030using System;
     31using System.Linq;
    3132using HeuristicLab.DataAnalysis;
    3233using HeuristicLab.Operators.Programmable;
     
    5455          return CreateGPModel();
    5556      }
     57    }
     58
     59    public IEnumerable<int> AllowedVariables {
     60      get {
     61        ItemList<IntData> allowedVariables = ProblemInjector.GetVariableValue<ItemList<IntData>>("AllowedFeatures", null, false);
     62        return allowedVariables.Select(x => x.Data);
     63      }
     64      set {
     65        ItemList<IntData> allowedVariables = ProblemInjector.GetVariableValue<ItemList<IntData>>("AllowedFeatures", null, false);
     66        foreach (int x in value) allowedVariables.Add(new IntData(x));
     67      }
     68    }
     69
     70    public int TrainingSamplesStart {
     71      get { return ProblemInjector.GetVariableValue<IntData>("TrainingSamplesStart", null, false).Data; }
     72      set { ProblemInjector.GetVariableValue<IntData>("TrainingSamplesStart", null, false).Data = value; }
     73    }
     74
     75    public int TrainingSamplesEnd {
     76      get { return ProblemInjector.GetVariableValue<IntData>("TrainingSamplesEnd", null, false).Data; }
     77      set { ProblemInjector.GetVariableValue<IntData>("TrainingSamplesEnd", null, false).Data = value; }
     78    }
     79
     80    public int ValidationSamplesStart {
     81      get { return ProblemInjector.GetVariableValue<IntData>("ValidationSamplesStart", null, false).Data; }
     82      set { ProblemInjector.GetVariableValue<IntData>("ValidationSamplesStart", null, false).Data = value; }
     83    }
     84
     85    public int ValidationSamplesEnd {
     86      get { return ProblemInjector.GetVariableValue<IntData>("ValidationSamplesEnd", null, false).Data; }
     87      set { ProblemInjector.GetVariableValue<IntData>("ValidationSamplesEnd", null, false).Data = value; }
     88    }
     89
     90    public int TestSamplesStart {
     91      get { return ProblemInjector.GetVariableValue<IntData>("TestSamplesStart", null, false).Data; }
     92      set { ProblemInjector.GetVariableValue<IntData>("TestSamplesStart", null, false).Data = value; }
     93    }
     94
     95    public int TestSamplesEnd {
     96      get { return ProblemInjector.GetVariableValue<IntData>("TestSamplesEnd", null, false).Data; }
     97      set { ProblemInjector.GetVariableValue<IntData>("TestSamplesEnd", null, false).Data = value; }
    5698    }
    5799
  • trunk/sources/HeuristicLab.LinearRegression/3.2/LinearRegression.cs

    r2363 r2375  
    6969        probInjector.OperatorGraph.InitialOperator.AddSubOperator(value, 0);
    7070      }
     71    }
     72    public IEnumerable<int> AllowedVariables {
     73      get {
     74        ItemList<IntData> allowedVariables = ProblemInjector.GetVariableValue<ItemList<IntData>>("AllowedFeatures", null, false);
     75        return allowedVariables.Select(x => x.Data);
     76      }
     77      set {
     78        ItemList<IntData> allowedVariables = ProblemInjector.GetVariableValue<ItemList<IntData>>("AllowedFeatures", null, false);
     79        foreach (int x in value) allowedVariables.Add(new IntData(x));
     80      }
     81    }
     82
     83    public int TrainingSamplesStart {
     84      get { return ProblemInjector.GetVariableValue<IntData>("TrainingSamplesStart", null, false).Data; }
     85      set { ProblemInjector.GetVariableValue<IntData>("TrainingSamplesStart", null, false).Data = value; }
     86    }
     87
     88    public int TrainingSamplesEnd {
     89      get { return ProblemInjector.GetVariableValue<IntData>("TrainingSamplesEnd", null, false).Data; }
     90      set { ProblemInjector.GetVariableValue<IntData>("TrainingSamplesEnd", null, false).Data = value; }
     91    }
     92
     93    public int ValidationSamplesStart {
     94      get { return ProblemInjector.GetVariableValue<IntData>("ValidationSamplesStart", null, false).Data; }
     95      set { ProblemInjector.GetVariableValue<IntData>("ValidationSamplesStart", null, false).Data = value; }
     96    }
     97
     98    public int ValidationSamplesEnd {
     99      get { return ProblemInjector.GetVariableValue<IntData>("ValidationSamplesEnd", null, false).Data; }
     100      set { ProblemInjector.GetVariableValue<IntData>("ValidationSamplesEnd", null, false).Data = value; }
     101    }
     102
     103    public int TestSamplesStart {
     104      get { return ProblemInjector.GetVariableValue<IntData>("TestSamplesStart", null, false).Data; }
     105      set { ProblemInjector.GetVariableValue<IntData>("TestSamplesStart", null, false).Data = value; }
     106    }
     107
     108    public int TestSamplesEnd {
     109      get { return ProblemInjector.GetVariableValue<IntData>("TestSamplesEnd", null, false).Data; }
     110      set { ProblemInjector.GetVariableValue<IntData>("TestSamplesEnd", null, false).Data = value; }
    71111    }
    72112
  • trunk/sources/HeuristicLab.Modeling/3.2/IAlgorithm.cs

    r2285 r2375  
    3030    string Name { get; }
    3131    string Description { get; }
    32     IOperator ProblemInjector { get; set; }
     32
    3333    Dataset Dataset { get; set; }
     34    IEnumerable<int> AllowedVariables { get; set; }
     35    int TrainingSamplesStart { get; set; }
     36    int TrainingSamplesEnd { get; set; }
     37    int ValidationSamplesStart { get; set; }
     38    int ValidationSamplesEnd { get; set; }
     39    int TestSamplesStart { get; set; }
     40    int TestSamplesEnd { get; set; }
    3441    int TargetVariable { get; set; }
    3542    IEngine Engine { get; }
  • trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SupportVectorRegression.cs

    r2363 r2375  
    7777        return CreateSVMModel(bestModelScope);
    7878      }
     79    }
     80    public IEnumerable<int> AllowedVariables {
     81      get {
     82        ItemList<IntData> allowedVariables = ProblemInjector.GetVariableValue<ItemList<IntData>>("AllowedFeatures", null, false);
     83        return allowedVariables.Select(x => x.Data);
     84      }
     85      set {
     86        ItemList<IntData> allowedVariables = ProblemInjector.GetVariableValue<ItemList<IntData>>("AllowedFeatures", null, false);
     87        foreach (int x in value) allowedVariables.Add(new IntData(x));
     88      }
     89    }
     90
     91    public int TrainingSamplesStart {
     92      get { return ProblemInjector.GetVariableValue<IntData>("TrainingSamplesStart", null, false).Data; }
     93      set { ProblemInjector.GetVariableValue<IntData>("TrainingSamplesStart", null, false).Data = value; }
     94    }
     95
     96    public int TrainingSamplesEnd {
     97      get { return ProblemInjector.GetVariableValue<IntData>("TrainingSamplesEnd", null, false).Data; }
     98      set { ProblemInjector.GetVariableValue<IntData>("TrainingSamplesEnd", null, false).Data = value; }
     99    }
     100
     101    public int ValidationSamplesStart {
     102      get { return ProblemInjector.GetVariableValue<IntData>("ValidationSamplesStart", null, false).Data; }
     103      set { ProblemInjector.GetVariableValue<IntData>("ValidationSamplesStart", null, false).Data = value; }
     104    }
     105
     106    public int ValidationSamplesEnd {
     107      get { return ProblemInjector.GetVariableValue<IntData>("ValidationSamplesEnd", null, false).Data; }
     108      set { ProblemInjector.GetVariableValue<IntData>("ValidationSamplesEnd", null, false).Data = value; }
     109    }
     110
     111    public int TestSamplesStart {
     112      get { return ProblemInjector.GetVariableValue<IntData>("TestSamplesStart", null, false).Data; }
     113      set { ProblemInjector.GetVariableValue<IntData>("TestSamplesStart", null, false).Data = value; }
     114    }
     115
     116    public int TestSamplesEnd {
     117      get { return ProblemInjector.GetVariableValue<IntData>("TestSamplesEnd", null, false).Data; }
     118      set { ProblemInjector.GetVariableValue<IntData>("TestSamplesEnd", null, false).Data = value; }
    79119    }
    80120
Note: See TracChangeset for help on using the changeset viewer.