Free cookie consent management tool by TermsFeed Policy Generator

Changeset 2378 for trunk/sources


Ignore:
Timestamp:
09/22/09 13:47:46 (15 years ago)
Author:
gkronber
Message:

Added "Set for all" button to simplify CEDMA algorithm configuration. #754

Location:
trunk/sources/HeuristicLab.CEDMA.Server/3.3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/DispatcherView.Designer.cs

    r2375 r2378  
    5151      this.testLabel = new System.Windows.Forms.Label();
    5252      this.setAllButton = new System.Windows.Forms.Button();
     53      this.setAlgorithmDefault = new System.Windows.Forms.Button();
    5354      this.splitContainer.Panel1.SuspendLayout();
    5455      this.splitContainer.Panel2.SuspendLayout();
     
    129130      //
    130131      this.learningTaskGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     132      this.learningTaskGroupBox.Controls.Add(this.setAlgorithmDefault);
    131133      this.learningTaskGroupBox.Controls.Add(this.autoregressiveLabel);
    132134      this.learningTaskGroupBox.Controls.Add(this.classificationRadioButton);
     
    178180      this.algorithmsListBox.Location = new System.Drawing.Point(6, 155);
    179181      this.algorithmsListBox.Name = "algorithmsListBox";
    180       this.algorithmsListBox.Size = new System.Drawing.Size(331, 154);
     182      this.algorithmsListBox.Size = new System.Drawing.Size(331, 124);
    181183      this.algorithmsListBox.TabIndex = 4;
    182184      this.algorithmsListBox.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.algorithmsListBox_ItemCheck);
     
    367369      this.setAllButton.UseVisualStyleBackColor = true;
    368370      this.setAllButton.Click += new System.EventHandler(this.setAllButton_Click);
     371      //
     372      // setAlgorithmDefault
     373      //
     374      this.setAlgorithmDefault.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     375      this.setAlgorithmDefault.Location = new System.Drawing.Point(6, 292);
     376      this.setAlgorithmDefault.Name = "setAlgorithmDefault";
     377      this.setAlgorithmDefault.Size = new System.Drawing.Size(96, 23);
     378      this.setAlgorithmDefault.TabIndex = 36;
     379      this.setAlgorithmDefault.Text = "Use as default";
     380      this.setAlgorithmDefault.UseVisualStyleBackColor = true;
     381      this.setAlgorithmDefault.Click += new System.EventHandler(this.setAlgorithmDefault_Click);
    369382      //
    370383      // DispatcherView
     
    417430    private System.Windows.Forms.RadioButton timeSeriesRadioButton;
    418431    private System.Windows.Forms.CheckBox autoregressiveCheckBox;
     432    private System.Windows.Forms.Button setAlgorithmDefault;
    419433  }
    420434}
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/DispatcherView.cs

    r2377 r2378  
    125125          }
    126126        }
     127      }
     128    }
     129
     130   
     131    private void setAlgorithmDefault_Click(object sender, EventArgs e) {
     132      foreach (string targetVar in dispatcher.TargetVariables) {
     133        ProblemSpecification spec = dispatcher.GetProblemSpecification(targetVar);
     134        spec.LearningTask = selectedSpec.LearningTask;
     135        spec.MinTimeOffset = selectedSpec.MinTimeOffset;
     136        spec.MaxTimeOffset = selectedSpec.MaxTimeOffset;
     137        spec.AutoRegressive = selectedSpec.AutoRegressive;
     138        var allowedAlgos = dispatcher.GetAllowedAlgorithms(selectedSpec.TargetVariable);
     139        foreach(var algo in allowedAlgos)
     140          dispatcher.EnableAlgorithm(spec.TargetVariable, algo);
    127141      }
    128142    }
     
    226240      return y0 > x1;
    227241    }
     242
    228243  }
    229244}
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/SimpleDispatcher.cs

    r2377 r2378  
    189189        timeSeriesAlgo.MinTimeOffset = spec.MinTimeOffset;
    190190        timeSeriesAlgo.MaxTimeOffset = spec.MaxTimeOffset;
     191        timeSeriesAlgo.TrainingSamplesStart = spec.TrainingSamplesStart - spec.MinTimeOffset +1 ; // first possible index is 1 because of differential symbol
    191192        if (spec.AutoRegressive) {
    192193          allowedFeatures.Add(spec.Dataset.GetVariableIndex(spec.TargetVariable));
     
    224225    public void EnableAlgorithm(string targetVariable, HeuristicLab.Modeling.IAlgorithm algo) {
    225226      if (!algorithms.ContainsKey(targetVariable)) algorithms.Add(targetVariable, new List<HeuristicLab.Modeling.IAlgorithm>());
     227      if(!algorithms[targetVariable].Contains(algo))
    226228      algorithms[targetVariable].Add(algo);
    227229    }
Note: See TracChangeset for help on using the changeset viewer.