Free cookie consent management tool by TermsFeed Policy Generator

Changeset 5654


Ignore:
Timestamp:
03/10/11 11:20:28 (14 years ago)
Author:
cneumuel
Message:

#1215

  • made MetaOptimizationProblem storable
  • fixed remove item exception in ValueConfigurationCheckedItemCollectionView
  • added possibility to select engine in CreateExperimentDialog
Location:
branches/HeuristicLab.MetaOptimization
Files:
2 added
2 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization.Views/3.3/CreateExperimentDialog.Designer.cs

    r5313 r5654  
    5353      this.repetitionsNumericUpDown = new System.Windows.Forms.NumericUpDown();
    5454      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
     55      this.label1 = new System.Windows.Forms.Label();
     56      this.engineComboBox = new System.Windows.Forms.ComboBox();
    5557      ((System.ComponentModel.ISupportInitialize)(this.repetitionsNumericUpDown)).BeginInit();
    5658      this.SuspendLayout();
     
    6062      this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
    6163      this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
    62       this.okButton.Location = new System.Drawing.Point(113, 58);
     64      this.okButton.Location = new System.Drawing.Point(113, 83);
    6365      this.okButton.Name = "okButton";
    6466      this.okButton.Size = new System.Drawing.Size(75, 23);
     
    7274      this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
    7375      this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
    74       this.cancelButton.Location = new System.Drawing.Point(194, 58);
     76      this.cancelButton.Location = new System.Drawing.Point(194, 83);
    7577      this.cancelButton.Name = "cancelButton";
    7678      this.cancelButton.Size = new System.Drawing.Size(75, 23);
     
    137139      this.repetitionsNumericUpDown.Validated += new System.EventHandler(this.repetitionsNumericUpDown_Validated);
    138140      //
     141      // label1
     142      //
     143      this.label1.AutoSize = true;
     144      this.label1.Location = new System.Drawing.Point(12, 57);
     145      this.label1.Name = "label1";
     146      this.label1.Size = new System.Drawing.Size(43, 13);
     147      this.label1.TabIndex = 6;
     148      this.label1.Text = "&Engine:";
     149      //
     150      // engineComboBox
     151      //
     152      this.engineComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     153                  | System.Windows.Forms.AnchorStyles.Right)));
     154      this.engineComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     155      this.engineComboBox.FormattingEnabled = true;
     156      this.engineComboBox.Location = new System.Drawing.Point(113, 54);
     157      this.engineComboBox.Name = "engineComboBox";
     158      this.engineComboBox.Size = new System.Drawing.Size(156, 21);
     159      this.engineComboBox.TabIndex = 7;
     160      //
    139161      // CreateExperimentDialog
    140162      //
     
    143165      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    144166      this.CancelButton = this.cancelButton;
    145       this.ClientSize = new System.Drawing.Size(281, 93);
     167      this.ClientSize = new System.Drawing.Size(281, 118);
     168      this.Controls.Add(this.engineComboBox);
     169      this.Controls.Add(this.label1);
    146170      this.Controls.Add(this.repetitionsNumericUpDown);
    147171      this.Controls.Add(this.repetitionsLabel);
     
    172196    private System.Windows.Forms.NumericUpDown repetitionsNumericUpDown;
    173197    private System.Windows.Forms.ToolTip toolTip;
     198    private System.Windows.Forms.Label label1;
     199    private System.Windows.Forms.ComboBox engineComboBox;
    174200
    175201  }
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization.Views/3.3/CreateExperimentDialog.cs

    r5313 r5654  
    2121
    2222using System;
     23using System.Collections.Generic;
    2324using System.Windows.Forms;
    24 using HeuristicLab.Optimization;
     25using HeuristicLab.Core;
    2526
    2627namespace HeuristicLab.Problems.MetaOptimization.Views {
     
    3334      get { return (int)repetitionsNumericUpDown.Value; }
    3435    }
     36    public IEngine Engine {
     37      get { return (IEngine)engineComboBox.SelectedItem; }
     38    }
    3539
    36     public CreateExperimentDialog() {
     40    public CreateExperimentDialog(IEnumerable<IEngine> engines, Type selectedEngine) {
    3741      InitializeComponent();
     42      foreach (var engine in engines) {
     43        this.engineComboBox.Items.Add(engine);
     44        if (engine.GetType() == selectedEngine) {
     45          this.engineComboBox.SelectedItem = engine;
     46        }
     47        if (this.engineComboBox.SelectedItem == null) {
     48          this.engineComboBox.SelectedIndex = 0;
     49        }
     50      }
    3851    }
    3952
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization.Views/3.3/CreateExperimentDialog.resx

    r5313 r5654  
    121121    <value>17, 17</value>
    122122  </metadata>
     123  <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     124    <value>17, 17</value>
     125  </metadata>
    123126</root>
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization.Views/3.3/HeuristicLab.Problems.MetaOptimization.Views-3.3.csproj

    r5313 r5654  
    114114      <HintPath>..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
    115115    </Reference>
     116    <Reference Include="HeuristicLab.SequentialEngine-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     117      <HintPath>..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.SequentialEngine-3.3.dll</HintPath>
     118    </Reference>
    116119    <Reference Include="System" />
    117120    <Reference Include="System.Core" />
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization.Views/3.3/MetaOptimizationProblemView.cs

    r5337 r5654  
    11using System;
    2 using System.Collections.Generic;
    3 using System.ComponentModel;
    4 using System.Drawing;
    5 using System.Data;
    62using System.Linq;
    7 using System.Text;
     3using System.Windows.Forms;
     4using HeuristicLab.Core;
    85using HeuristicLab.MainForm;
     6using HeuristicLab.Optimization;
    97using HeuristicLab.Optimization.Views;
    10 using HeuristicLab.Optimization;
    11 using System.Windows.Forms;
     8using HeuristicLab.PluginInfrastructure;
    129
    1310namespace HeuristicLab.Problems.MetaOptimization.Views {
     
    6865        }
    6966        if (result == System.Windows.Forms.DialogResult.OK) {
    70           CreateExperimentDialog dlg = new CreateExperimentDialog();
     67          CreateExperimentDialog dlg = new CreateExperimentDialog(ApplicationManager.Manager.GetInstances<IEngine>(), typeof(SequentialEngine.SequentialEngine));
    7168          DialogResult dlgResult = dlg.ShowDialog();
    7269
    7370          if (dlgResult == DialogResult.OK) {
    74             IAlgorithm algorithm = Content.Algorithm;
     71            var algorithm = (EngineAlgorithm)Content.Algorithm.Clone();
    7572            if(Content.Problems.Count > 0) algorithm.Problem = Content.Problems.First();
     73            algorithm.Engine = (IEngine)dlg.Engine.Clone();
    7674            Experiment experiment;
    7775
     
    8987    #endregion
    9088
    91     protected void parameterCollectionView_DragEnterOver(object sender, System.Windows.Forms.DragEventArgs e) {
     89    private void parameterCollectionView_DragEnterOver(object sender, System.Windows.Forms.DragEventArgs e) {
    9290      e.Effect = DragDropEffects.None;
    9391      Type type = e.Data.GetData("Type") as Type;
     
    9997      }
    10098    }
    101     protected void parameterCollectionView_DragDrop(object sender, System.Windows.Forms.DragEventArgs e) {
     99    private void parameterCollectionView_DragDrop(object sender, System.Windows.Forms.DragEventArgs e) {
    102100      if (e.Effect != DragDropEffects.None) {
    103101        IAlgorithm algorithm = e.Data.GetData("Value") as IAlgorithm;
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/MetaOptimizationProblem.cs

    r5653 r5654  
    2222using System;
    2323using System.Linq;
     24using HeuristicLab.Algorithms.GeneticAlgorithm;
    2425using HeuristicLab.Common;
    2526using HeuristicLab.Core;
     
    2930using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3031using HeuristicLab.PluginInfrastructure;
    31 using HeuristicLab.Algorithms.GeneticAlgorithm;
    3232using HeuristicLab.Problems.TestFunctions;
    3333
     
    3636  [Creatable("Problems")]
    3737  [StorableClass]
    38   public sealed class MetaOptimizationProblem : SingleObjectiveProblem<IParameterConfigurationEvaluator, IParameterConfigurationCreator> {
     38  public sealed class MetaOptimizationProblem : SingleObjectiveProblem<IParameterConfigurationEvaluator, IParameterConfigurationCreator>, IStorableContent {
     39    public string Filename { get; set; }
     40
    3941    public const string AlgorithmTypeParameterName = "AlgorithmType";
    4042    public const string ProblemTypeParameterName = "ProblemType";
Note: See TracChangeset for help on using the changeset viewer.