Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/12/15 10:29:01 (9 years ago)
Author:
abeham
Message:

#2457: Added view

Location:
branches/PerformanceComparison
Files:
4 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Views/3.3/ExpertSystemOptimizerView.Designer.cs

    r12839 r12847  
    2020#endregion
    2121
    22 namespace HeuristicLab.Optimization.Views {
    23   partial class IndependentRandomRestarterView {
     22namespace HeuristicLab.OptimizationExpertSystem.Views {
     23  partial class ExpertSystemOptimizerView {
    2424    /// <summary>
    2525    /// Required designer variable.
     
    3434    /// </summary>
    3535    private void InitializeComponent() {
    36       this.timeLimitLabel = new System.Windows.Forms.Label();
    37       this.maxExecutionTimeTextBox = new System.Windows.Forms.TextBox();
    3836      this.evaluationsLimitabel = new System.Windows.Forms.Label();
    3937      this.maxEvaluationsTextBox = new System.Windows.Forms.TextBox();
    4038      this.tabControl = new HeuristicLab.MainForm.WindowsForms.DragOverTabControl();
     39      this.problemTabPage = new System.Windows.Forms.TabPage();
     40      this.problemViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
     41      this.openProblemButton = new System.Windows.Forms.Button();
     42      this.newProblemButton = new System.Windows.Forms.Button();
    4143      this.algorithmTabPage = new System.Windows.Forms.TabPage();
    4244      this.algorithmViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    43       this.openAlgorithmButton = new System.Windows.Forms.Button();
    44       this.newAlgorithmButton = new System.Windows.Forms.Button();
    45       this.currentRunTabPage = new System.Windows.Forms.TabPage();
    46       this.currentRunView = new HeuristicLab.Optimization.Views.RunView();
     45      this.algorithmSuggestionLabel = new System.Windows.Forms.Label();
     46      this.suggestedInstancesComboBox = new System.Windows.Forms.ComboBox();
    4747      this.runsTabPage = new System.Windows.Forms.TabPage();
    4848      this.runsView = new HeuristicLab.Optimization.Views.RunCollectionView();
     49      this.okbTabPage = new System.Windows.Forms.TabPage();
     50      this.okbRunCollectionView = new HeuristicLab.Optimization.Views.RunCollectionView();
    4951      this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
    50       this.targetValueTextBox = new System.Windows.Forms.TextBox();
    51       this.targetValueLabel = new System.Windows.Forms.Label();
    52       this.terminationComboBox = new System.Windows.Forms.ComboBox();
    53       this.terminationLabel = new System.Windows.Forms.Label();
    54       this.moveCostPerSolutionTextBox = new System.Windows.Forms.TextBox();
    55       this.moveCostPerSolutionLabel = new System.Windows.Forms.Label();
    56       this.maximizationLabel = new System.Windows.Forms.Label();
    57       this.maximizationCheckBox = new System.Windows.Forms.CheckBox();
    58       this.storeSolutionInRunLabel = new System.Windows.Forms.Label();
    59       this.storeBestSolutionCheckBox = new System.Windows.Forms.CheckBox();
    6052      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    6153      this.tabControl.SuspendLayout();
     54      this.problemTabPage.SuspendLayout();
    6255      this.algorithmTabPage.SuspendLayout();
    63       this.currentRunTabPage.SuspendLayout();
    6456      this.runsTabPage.SuspendLayout();
     57      this.okbTabPage.SuspendLayout();
    6558      this.SuspendLayout();
    6659      //
     
    10396      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
    10497      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
    105       this.nameTextBox.Location = new System.Drawing.Point(115, 0);
    106       this.nameTextBox.Size = new System.Drawing.Size(409, 20);
     98      this.nameTextBox.Location = new System.Drawing.Point(75, 0);
     99      this.nameTextBox.Size = new System.Drawing.Size(449, 20);
    107100      //
    108101      // infoLabel
     
    110103      this.infoLabel.Location = new System.Drawing.Point(530, 3);
    111104      //
    112       // timeLimitLabel
    113       //
    114       this.timeLimitLabel.AutoSize = true;
    115       this.timeLimitLabel.Location = new System.Drawing.Point(3, 29);
    116       this.timeLimitLabel.Name = "timeLimitLabel";
    117       this.timeLimitLabel.Size = new System.Drawing.Size(106, 13);
    118       this.timeLimitLabel.TabIndex = 3;
    119       this.timeLimitLabel.Text = "Max Execution Time:";
    120       //
    121       // maxExecutionTimeTextBox
    122       //
    123       this.maxExecutionTimeTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    124             | System.Windows.Forms.AnchorStyles.Right)));
    125       this.maxExecutionTimeTextBox.Location = new System.Drawing.Point(115, 26);
    126       this.maxExecutionTimeTextBox.Name = "maxExecutionTimeTextBox";
    127       this.maxExecutionTimeTextBox.Size = new System.Drawing.Size(409, 20);
    128       this.maxExecutionTimeTextBox.TabIndex = 4;
    129       this.maxExecutionTimeTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.maxExecutionTimeTextBox_Validating);
    130       //
    131105      // evaluationsLimitabel
    132106      //
    133107      this.evaluationsLimitabel.AutoSize = true;
    134       this.evaluationsLimitabel.Location = new System.Drawing.Point(3, 55);
     108      this.evaluationsLimitabel.Location = new System.Drawing.Point(3, 29);
    135109      this.evaluationsLimitabel.Name = "evaluationsLimitabel";
    136       this.evaluationsLimitabel.Size = new System.Drawing.Size(88, 13);
     110      this.evaluationsLimitabel.Size = new System.Drawing.Size(66, 13);
    137111      this.evaluationsLimitabel.TabIndex = 5;
    138       this.evaluationsLimitabel.Text = "Max Evaluations:";
     112      this.evaluationsLimitabel.Text = "Budget (FE):";
    139113      //
    140114      // maxEvaluationsTextBox
    141115      //
    142       this.maxEvaluationsTextBox.Location = new System.Drawing.Point(115, 52);
     116      this.maxEvaluationsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     117            | System.Windows.Forms.AnchorStyles.Right)));
     118      this.maxEvaluationsTextBox.Location = new System.Drawing.Point(75, 26);
    143119      this.maxEvaluationsTextBox.Name = "maxEvaluationsTextBox";
    144       this.maxEvaluationsTextBox.Size = new System.Drawing.Size(157, 20);
     120      this.maxEvaluationsTextBox.Size = new System.Drawing.Size(449, 20);
    145121      this.maxEvaluationsTextBox.TabIndex = 6;
    146122      this.maxEvaluationsTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.maxEvaluationsTextBox_Validating);
     
    152128            | System.Windows.Forms.AnchorStyles.Left)
    153129            | System.Windows.Forms.AnchorStyles.Right)));
     130      this.tabControl.Controls.Add(this.problemTabPage);
    154131      this.tabControl.Controls.Add(this.algorithmTabPage);
    155       this.tabControl.Controls.Add(this.currentRunTabPage);
    156132      this.tabControl.Controls.Add(this.runsTabPage);
    157       this.tabControl.Location = new System.Drawing.Point(0, 152);
     133      this.tabControl.Controls.Add(this.okbTabPage);
     134      this.tabControl.Location = new System.Drawing.Point(0, 52);
    158135      this.tabControl.Name = "tabControl";
    159136      this.tabControl.SelectedIndex = 0;
    160       this.tabControl.Size = new System.Drawing.Size(546, 282);
     137      this.tabControl.Size = new System.Drawing.Size(546, 382);
    161138      this.tabControl.TabIndex = 17;
    162139      //
     140      // problemTabPage
     141      //
     142      this.problemTabPage.AllowDrop = true;
     143      this.problemTabPage.Controls.Add(this.problemViewHost);
     144      this.problemTabPage.Controls.Add(this.openProblemButton);
     145      this.problemTabPage.Controls.Add(this.newProblemButton);
     146      this.problemTabPage.Location = new System.Drawing.Point(4, 22);
     147      this.problemTabPage.Name = "problemTabPage";
     148      this.problemTabPage.Padding = new System.Windows.Forms.Padding(3);
     149      this.problemTabPage.Size = new System.Drawing.Size(538, 356);
     150      this.problemTabPage.TabIndex = 1;
     151      this.problemTabPage.Text = "Problem";
     152      this.problemTabPage.UseVisualStyleBackColor = true;
     153      this.problemTabPage.DragDrop += new System.Windows.Forms.DragEventHandler(this.problemTabPage_DragDrop);
     154      this.problemTabPage.DragEnter += new System.Windows.Forms.DragEventHandler(this.problemTabPage_DragEnterOver);
     155      this.problemTabPage.DragOver += new System.Windows.Forms.DragEventHandler(this.problemTabPage_DragEnterOver);
     156      //
     157      // problemViewHost
     158      //
     159      this.problemViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     160            | System.Windows.Forms.AnchorStyles.Left)
     161            | System.Windows.Forms.AnchorStyles.Right)));
     162      this.problemViewHost.Caption = "View";
     163      this.problemViewHost.Content = null;
     164      this.problemViewHost.Enabled = false;
     165      this.problemViewHost.Location = new System.Drawing.Point(6, 36);
     166      this.problemViewHost.Name = "problemViewHost";
     167      this.problemViewHost.ReadOnly = false;
     168      this.problemViewHost.Size = new System.Drawing.Size(526, 314);
     169      this.problemViewHost.TabIndex = 2;
     170      this.problemViewHost.ViewsLabelVisible = true;
     171      this.problemViewHost.ViewType = null;
     172      //
     173      // openProblemButton
     174      //
     175      this.openProblemButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Open;
     176      this.openProblemButton.Location = new System.Drawing.Point(36, 6);
     177      this.openProblemButton.Name = "openProblemButton";
     178      this.openProblemButton.Size = new System.Drawing.Size(24, 24);
     179      this.openProblemButton.TabIndex = 1;
     180      this.toolTip.SetToolTip(this.openProblemButton, "Open Problem");
     181      this.openProblemButton.UseVisualStyleBackColor = true;
     182      this.openProblemButton.Click += new System.EventHandler(this.openProblemButton_Click);
     183      //
     184      // newProblemButton
     185      //
     186      this.newProblemButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.NewDocument;
     187      this.newProblemButton.Location = new System.Drawing.Point(6, 6);
     188      this.newProblemButton.Name = "newProblemButton";
     189      this.newProblemButton.Size = new System.Drawing.Size(24, 24);
     190      this.newProblemButton.TabIndex = 0;
     191      this.toolTip.SetToolTip(this.newProblemButton, "New Problem");
     192      this.newProblemButton.UseVisualStyleBackColor = true;
     193      this.newProblemButton.Click += new System.EventHandler(this.newProblemButton_Click);
     194      //
    163195      // algorithmTabPage
    164196      //
    165       this.algorithmTabPage.AllowDrop = true;
    166197      this.algorithmTabPage.Controls.Add(this.algorithmViewHost);
    167       this.algorithmTabPage.Controls.Add(this.openAlgorithmButton);
    168       this.algorithmTabPage.Controls.Add(this.newAlgorithmButton);
     198      this.algorithmTabPage.Controls.Add(this.algorithmSuggestionLabel);
     199      this.algorithmTabPage.Controls.Add(this.suggestedInstancesComboBox);
    169200      this.algorithmTabPage.Location = new System.Drawing.Point(4, 22);
    170201      this.algorithmTabPage.Name = "algorithmTabPage";
    171202      this.algorithmTabPage.Padding = new System.Windows.Forms.Padding(3);
    172       this.algorithmTabPage.Size = new System.Drawing.Size(538, 256);
    173       this.algorithmTabPage.TabIndex = 1;
     203      this.algorithmTabPage.Size = new System.Drawing.Size(538, 356);
     204      this.algorithmTabPage.TabIndex = 4;
    174205      this.algorithmTabPage.Text = "Algorithm";
    175206      this.algorithmTabPage.UseVisualStyleBackColor = true;
    176       this.algorithmTabPage.DragDrop += new System.Windows.Forms.DragEventHandler(this.algorithmTabPage_DragDrop);
    177       this.algorithmTabPage.DragEnter += new System.Windows.Forms.DragEventHandler(this.algorithmTabPage_DragEnterOver);
    178       this.algorithmTabPage.DragOver += new System.Windows.Forms.DragEventHandler(this.algorithmTabPage_DragEnterOver);
    179207      //
    180208      // algorithmViewHost
     
    189217      this.algorithmViewHost.Name = "algorithmViewHost";
    190218      this.algorithmViewHost.ReadOnly = false;
    191       this.algorithmViewHost.Size = new System.Drawing.Size(526, 214);
     219      this.algorithmViewHost.Size = new System.Drawing.Size(526, 314);
    192220      this.algorithmViewHost.TabIndex = 2;
    193221      this.algorithmViewHost.ViewsLabelVisible = true;
    194222      this.algorithmViewHost.ViewType = null;
    195223      //
    196       // openAlgorithmButton
    197       //
    198       this.openAlgorithmButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Open;
    199       this.openAlgorithmButton.Location = new System.Drawing.Point(36, 6);
    200       this.openAlgorithmButton.Name = "openAlgorithmButton";
    201       this.openAlgorithmButton.Size = new System.Drawing.Size(24, 24);
    202       this.openAlgorithmButton.TabIndex = 1;
    203       this.toolTip.SetToolTip(this.openAlgorithmButton, "Open Optimizer");
    204       this.openAlgorithmButton.UseVisualStyleBackColor = true;
    205       this.openAlgorithmButton.Click += new System.EventHandler(this.openAlgorithmButton_Click);
    206       //
    207       // newAlgorithmButton
    208       //
    209       this.newAlgorithmButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.NewDocument;
    210       this.newAlgorithmButton.Location = new System.Drawing.Point(6, 6);
    211       this.newAlgorithmButton.Name = "newAlgorithmButton";
    212       this.newAlgorithmButton.Size = new System.Drawing.Size(24, 24);
    213       this.newAlgorithmButton.TabIndex = 0;
    214       this.toolTip.SetToolTip(this.newAlgorithmButton, "New Optimizer");
    215       this.newAlgorithmButton.UseVisualStyleBackColor = true;
    216       this.newAlgorithmButton.Click += new System.EventHandler(this.newAlgorithmButton_Click);
    217       //
    218       // currentRunTabPage
    219       //
    220       this.currentRunTabPage.Controls.Add(this.currentRunView);
    221       this.currentRunTabPage.Location = new System.Drawing.Point(4, 22);
    222       this.currentRunTabPage.Name = "currentRunTabPage";
    223       this.currentRunTabPage.Padding = new System.Windows.Forms.Padding(6);
    224       this.currentRunTabPage.Size = new System.Drawing.Size(538, 256);
    225       this.currentRunTabPage.TabIndex = 4;
    226       this.currentRunTabPage.Text = "Current Run";
    227       this.currentRunTabPage.UseVisualStyleBackColor = true;
    228       //
    229       // currentRunView
    230       //
    231       this.currentRunView.Caption = "Run View";
    232       this.currentRunView.Content = null;
    233       this.currentRunView.Dock = System.Windows.Forms.DockStyle.Fill;
    234       this.currentRunView.Location = new System.Drawing.Point(6, 6);
    235       this.currentRunView.Name = "currentRunView";
    236       this.currentRunView.ReadOnly = false;
    237       this.currentRunView.Size = new System.Drawing.Size(526, 244);
    238       this.currentRunView.TabIndex = 0;
     224      // algorithmSuggestionLabel
     225      //
     226      this.algorithmSuggestionLabel.AutoSize = true;
     227      this.algorithmSuggestionLabel.Location = new System.Drawing.Point(6, 9);
     228      this.algorithmSuggestionLabel.Name = "algorithmSuggestionLabel";
     229      this.algorithmSuggestionLabel.Size = new System.Drawing.Size(156, 13);
     230      this.algorithmSuggestionLabel.TabIndex = 1;
     231      this.algorithmSuggestionLabel.Text = "Suggested Algorithm Instances:";
     232      //
     233      // suggestedInstancesComboBox
     234      //
     235      this.suggestedInstancesComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     236            | System.Windows.Forms.AnchorStyles.Right)));
     237      this.suggestedInstancesComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     238      this.suggestedInstancesComboBox.FormattingEnabled = true;
     239      this.suggestedInstancesComboBox.Location = new System.Drawing.Point(178, 6);
     240      this.suggestedInstancesComboBox.Name = "suggestedInstancesComboBox";
     241      this.suggestedInstancesComboBox.Size = new System.Drawing.Size(354, 21);
     242      this.suggestedInstancesComboBox.TabIndex = 0;
     243      this.suggestedInstancesComboBox.SelectedIndexChanged += new System.EventHandler(this.suggestedInstancesComboBox_SelectedIndexChanged);
    239244      //
    240245      // runsTabPage
     
    243248      this.runsTabPage.Location = new System.Drawing.Point(4, 22);
    244249      this.runsTabPage.Name = "runsTabPage";
    245       this.runsTabPage.Padding = new System.Windows.Forms.Padding(6);
    246       this.runsTabPage.Size = new System.Drawing.Size(538, 256);
     250      this.runsTabPage.Padding = new System.Windows.Forms.Padding(3);
     251      this.runsTabPage.Size = new System.Drawing.Size(538, 356);
    247252      this.runsTabPage.TabIndex = 3;
    248253      this.runsTabPage.Text = "Runs";
     
    254259      this.runsView.Content = null;
    255260      this.runsView.Dock = System.Windows.Forms.DockStyle.Fill;
    256       this.runsView.Location = new System.Drawing.Point(6, 6);
     261      this.runsView.Location = new System.Drawing.Point(3, 3);
    257262      this.runsView.Name = "runsView";
    258263      this.runsView.ReadOnly = false;
    259       this.runsView.Size = new System.Drawing.Size(526, 244);
     264      this.runsView.Size = new System.Drawing.Size(532, 350);
    260265      this.runsView.TabIndex = 1;
     266      //
     267      // okbTabPage
     268      //
     269      this.okbTabPage.Controls.Add(this.okbRunCollectionView);
     270      this.okbTabPage.Location = new System.Drawing.Point(4, 22);
     271      this.okbTabPage.Name = "okbTabPage";
     272      this.okbTabPage.Padding = new System.Windows.Forms.Padding(3);
     273      this.okbTabPage.Size = new System.Drawing.Size(538, 356);
     274      this.okbTabPage.TabIndex = 5;
     275      this.okbTabPage.Text = "Knowledge Base";
     276      this.okbTabPage.UseVisualStyleBackColor = true;
     277      //
     278      // okbRunCollectionView
     279      //
     280      this.okbRunCollectionView.Caption = "RunCollection View";
     281      this.okbRunCollectionView.Content = null;
     282      this.okbRunCollectionView.Dock = System.Windows.Forms.DockStyle.Fill;
     283      this.okbRunCollectionView.Location = new System.Drawing.Point(3, 3);
     284      this.okbRunCollectionView.Name = "okbRunCollectionView";
     285      this.okbRunCollectionView.ReadOnly = false;
     286      this.okbRunCollectionView.Size = new System.Drawing.Size(532, 350);
     287      this.okbRunCollectionView.TabIndex = 0;
    261288      //
    262289      // openFileDialog
     
    267294      this.openFileDialog.Title = "Open Optimizer";
    268295      //
    269       // targetValueTextBox
    270       //
    271       this.targetValueTextBox.Location = new System.Drawing.Point(115, 78);
    272       this.targetValueTextBox.Name = "targetValueTextBox";
    273       this.targetValueTextBox.Size = new System.Drawing.Size(157, 20);
    274       this.targetValueTextBox.TabIndex = 10;
    275       this.targetValueTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.targetValueTextBox_Validating);
    276       //
    277       // targetValueLabel
    278       //
    279       this.targetValueLabel.AutoSize = true;
    280       this.targetValueLabel.Location = new System.Drawing.Point(3, 81);
    281       this.targetValueLabel.Name = "targetValueLabel";
    282       this.targetValueLabel.Size = new System.Drawing.Size(71, 13);
    283       this.targetValueLabel.TabIndex = 9;
    284       this.targetValueLabel.Text = "Target Value:";
    285       //
    286       // terminationComboBox
    287       //
    288       this.terminationComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    289             | System.Windows.Forms.AnchorStyles.Right)));
    290       this.terminationComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
    291       this.terminationComboBox.FormattingEnabled = true;
    292       this.terminationComboBox.Location = new System.Drawing.Point(115, 105);
    293       this.terminationComboBox.Name = "terminationComboBox";
    294       this.terminationComboBox.Size = new System.Drawing.Size(409, 21);
    295       this.terminationComboBox.TabIndex = 14;
    296       this.terminationComboBox.SelectedIndexChanged += new System.EventHandler(this.terminationComboBox_SelectedIndexChanged);
    297       //
    298       // terminationLabel
    299       //
    300       this.terminationLabel.AutoSize = true;
    301       this.terminationLabel.Location = new System.Drawing.Point(3, 108);
    302       this.terminationLabel.Name = "terminationLabel";
    303       this.terminationLabel.Size = new System.Drawing.Size(65, 13);
    304       this.terminationLabel.TabIndex = 13;
    305       this.terminationLabel.Text = "Termination:";
    306       //
    307       // moveCostPerSolutionTextBox
    308       //
    309       this.moveCostPerSolutionTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    310             | System.Windows.Forms.AnchorStyles.Right)));
    311       this.moveCostPerSolutionTextBox.Location = new System.Drawing.Point(401, 52);
    312       this.moveCostPerSolutionTextBox.Name = "moveCostPerSolutionTextBox";
    313       this.moveCostPerSolutionTextBox.Size = new System.Drawing.Size(123, 20);
    314       this.moveCostPerSolutionTextBox.TabIndex = 8;
    315       this.moveCostPerSolutionTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.moveCostPerSolutionTextBox_Validating);
    316       //
    317       // moveCostPerSolutionLabel
    318       //
    319       this.moveCostPerSolutionLabel.AutoSize = true;
    320       this.moveCostPerSolutionLabel.Location = new System.Drawing.Point(278, 55);
    321       this.moveCostPerSolutionLabel.Name = "moveCostPerSolutionLabel";
    322       this.moveCostPerSolutionLabel.Size = new System.Drawing.Size(117, 13);
    323       this.moveCostPerSolutionLabel.TabIndex = 7;
    324       this.moveCostPerSolutionLabel.Text = "Move cost per solution:";
    325       //
    326       // maximizationLabel
    327       //
    328       this.maximizationLabel.AutoSize = true;
    329       this.maximizationLabel.Location = new System.Drawing.Point(278, 81);
    330       this.maximizationLabel.Name = "maximizationLabel";
    331       this.maximizationLabel.Size = new System.Drawing.Size(70, 13);
    332       this.maximizationLabel.TabIndex = 11;
    333       this.maximizationLabel.Text = "Maximization:";
    334       //
    335       // maximizationCheckBox
    336       //
    337       this.maximizationCheckBox.AutoSize = true;
    338       this.maximizationCheckBox.Location = new System.Drawing.Point(401, 80);
    339       this.maximizationCheckBox.Name = "maximizationCheckBox";
    340       this.maximizationCheckBox.Size = new System.Drawing.Size(15, 14);
    341       this.maximizationCheckBox.TabIndex = 12;
    342       this.maximizationCheckBox.UseVisualStyleBackColor = true;
    343       this.maximizationCheckBox.CheckedChanged += new System.EventHandler(this.maximizationCheckBox_CheckedChanged);
    344       //
    345       // storeSolutionInRunLabel
    346       //
    347       this.storeSolutionInRunLabel.AutoSize = true;
    348       this.storeSolutionInRunLabel.Location = new System.Drawing.Point(3, 132);
    349       this.storeSolutionInRunLabel.Name = "storeSolutionInRunLabel";
    350       this.storeSolutionInRunLabel.Size = new System.Drawing.Size(76, 13);
    351       this.storeSolutionInRunLabel.TabIndex = 15;
    352       this.storeSolutionInRunLabel.Text = "Store Solution:";
    353       //
    354       // storeBestSolutionCheckBox
    355       //
    356       this.storeBestSolutionCheckBox.AutoSize = true;
    357       this.storeBestSolutionCheckBox.Location = new System.Drawing.Point(115, 132);
    358       this.storeBestSolutionCheckBox.Name = "storeBestSolutionCheckBox";
    359       this.storeBestSolutionCheckBox.Size = new System.Drawing.Size(15, 14);
    360       this.storeBestSolutionCheckBox.TabIndex = 16;
    361       this.storeBestSolutionCheckBox.UseVisualStyleBackColor = true;
    362       this.storeBestSolutionCheckBox.CheckedChanged += new System.EventHandler(this.storeBestSolutionCheckBox_CheckedChanged);
    363       //
    364       // IndependentRandomRestarterView
     296      // ExpertSystemOptimizerView
    365297      //
    366298      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    367       this.Controls.Add(this.storeBestSolutionCheckBox);
    368       this.Controls.Add(this.maximizationCheckBox);
    369       this.Controls.Add(this.terminationComboBox);
    370299      this.Controls.Add(this.tabControl);
    371       this.Controls.Add(this.maxExecutionTimeTextBox);
    372       this.Controls.Add(this.timeLimitLabel);
    373       this.Controls.Add(this.terminationLabel);
    374       this.Controls.Add(this.storeSolutionInRunLabel);
    375       this.Controls.Add(this.targetValueLabel);
    376       this.Controls.Add(this.maximizationLabel);
    377       this.Controls.Add(this.moveCostPerSolutionLabel);
    378300      this.Controls.Add(this.evaluationsLimitabel);
    379       this.Controls.Add(this.moveCostPerSolutionTextBox);
    380       this.Controls.Add(this.targetValueTextBox);
    381301      this.Controls.Add(this.maxEvaluationsTextBox);
    382       this.Name = "IndependentRandomRestarterView";
     302      this.Name = "ExpertSystemOptimizerView";
    383303      this.Size = new System.Drawing.Size(549, 464);
    384304      this.Controls.SetChildIndex(this.maxEvaluationsTextBox, 0);
    385       this.Controls.SetChildIndex(this.targetValueTextBox, 0);
    386       this.Controls.SetChildIndex(this.moveCostPerSolutionTextBox, 0);
    387305      this.Controls.SetChildIndex(this.evaluationsLimitabel, 0);
    388       this.Controls.SetChildIndex(this.moveCostPerSolutionLabel, 0);
    389       this.Controls.SetChildIndex(this.maximizationLabel, 0);
    390       this.Controls.SetChildIndex(this.targetValueLabel, 0);
    391       this.Controls.SetChildIndex(this.storeSolutionInRunLabel, 0);
    392       this.Controls.SetChildIndex(this.terminationLabel, 0);
    393       this.Controls.SetChildIndex(this.timeLimitLabel, 0);
    394       this.Controls.SetChildIndex(this.maxExecutionTimeTextBox, 0);
    395306      this.Controls.SetChildIndex(this.tabControl, 0);
    396307      this.Controls.SetChildIndex(this.nameLabel, 0);
     
    403314      this.Controls.SetChildIndex(this.executionTimeTextBox, 0);
    404315      this.Controls.SetChildIndex(this.startButton, 0);
    405       this.Controls.SetChildIndex(this.terminationComboBox, 0);
    406       this.Controls.SetChildIndex(this.maximizationCheckBox, 0);
    407       this.Controls.SetChildIndex(this.storeBestSolutionCheckBox, 0);
    408316      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    409317      this.tabControl.ResumeLayout(false);
     318      this.problemTabPage.ResumeLayout(false);
    410319      this.algorithmTabPage.ResumeLayout(false);
    411       this.currentRunTabPage.ResumeLayout(false);
     320      this.algorithmTabPage.PerformLayout();
    412321      this.runsTabPage.ResumeLayout(false);
     322      this.okbTabPage.ResumeLayout(false);
    413323      this.ResumeLayout(false);
    414324      this.PerformLayout();
     
    418328    #endregion
    419329
    420     private System.Windows.Forms.Label timeLimitLabel;
    421     private System.Windows.Forms.TextBox maxExecutionTimeTextBox;
    422330    private System.Windows.Forms.Label evaluationsLimitabel;
    423331    private System.Windows.Forms.TextBox maxEvaluationsTextBox;
    424332    private MainForm.WindowsForms.DragOverTabControl tabControl;
    425333    private System.Windows.Forms.TabPage runsTabPage;
    426     private RunCollectionView runsView;
     334    private HeuristicLab.Optimization.Views.RunCollectionView runsView;
    427335    private System.Windows.Forms.OpenFileDialog openFileDialog;
    428     private System.Windows.Forms.TextBox targetValueTextBox;
    429     private System.Windows.Forms.Label targetValueLabel;
    430     private System.Windows.Forms.ComboBox terminationComboBox;
    431     private System.Windows.Forms.Label terminationLabel;
    432     private System.Windows.Forms.TextBox moveCostPerSolutionTextBox;
    433     private System.Windows.Forms.Label moveCostPerSolutionLabel;
    434     private System.Windows.Forms.Label maximizationLabel;
    435     private System.Windows.Forms.CheckBox maximizationCheckBox;
     336    private System.Windows.Forms.TabPage problemTabPage;
     337    private MainForm.WindowsForms.ViewHost problemViewHost;
     338    private System.Windows.Forms.Button openProblemButton;
     339    private System.Windows.Forms.Button newProblemButton;
    436340    private System.Windows.Forms.TabPage algorithmTabPage;
    437341    private MainForm.WindowsForms.ViewHost algorithmViewHost;
    438     private System.Windows.Forms.Button openAlgorithmButton;
    439     private System.Windows.Forms.Button newAlgorithmButton;
    440     private System.Windows.Forms.TabPage currentRunTabPage;
    441     private RunView currentRunView;
    442     private System.Windows.Forms.Label storeSolutionInRunLabel;
    443     private System.Windows.Forms.CheckBox storeBestSolutionCheckBox;
     342    private System.Windows.Forms.Label algorithmSuggestionLabel;
     343    private System.Windows.Forms.ComboBox suggestedInstancesComboBox;
     344    private System.Windows.Forms.TabPage okbTabPage;
     345    private Optimization.Views.RunCollectionView okbRunCollectionView;
    444346  }
    445347}
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Views/3.3/ExpertSystemOptimizerView.cs

    r12839 r12847  
    3030using HeuristicLab.Core.Views;
    3131using HeuristicLab.MainForm;
     32using HeuristicLab.Optimization;
     33using HeuristicLab.Optimization.Views;
    3234using HeuristicLab.PluginInfrastructure;
    3335
    34 namespace HeuristicLab.Optimization.Views {
    35   [View("Independent Random Restarter View")]
    36   [Content(typeof(IndepdentRandomRestarter), IsDefaultView = true)]
    37   public partial class IndependentRandomRestarterView : IOptimizerView {
    38     protected TypeSelectorDialog algorithmTypeSelectorDialog;
     36namespace HeuristicLab.OptimizationExpertSystem.Views {
     37  [View("Expert-system Optimizer View")]
     38  [Content(typeof(ExpertSystemOptimizer), IsDefaultView = true)]
     39  public partial class ExpertSystemOptimizerView : IOptimizerView {
     40    protected TypeSelectorDialog problemTypeSelectorDialog;
    3941    protected virtual bool SuppressEvents { get; set; }
    4042
    41     public new IndepdentRandomRestarter Content {
    42       get { return (IndepdentRandomRestarter)base.Content; }
     43    public new ExpertSystemOptimizer Content {
     44      get { return (ExpertSystemOptimizer)base.Content; }
    4345      set { base.Content = value; }
    4446    }
    4547
    46     public IndependentRandomRestarterView() {
     48    public ExpertSystemOptimizerView() {
    4749      InitializeComponent();
    48       terminationComboBox.Items.AddRange(Enum.GetValues(typeof(TerminationCriterium)).Cast<object>().ToArray());
    4950    }
    5051
    5152    protected override void Dispose(bool disposing) {
    5253      if (disposing) {
    53         if (algorithmTypeSelectorDialog != null) algorithmTypeSelectorDialog.Dispose();
     54        if (problemTypeSelectorDialog != null) problemTypeSelectorDialog.Dispose();
    5455        if (components != null) components.Dispose();
    5556      }
     
    5960    protected override void DeregisterContentEvents() {
    6061      Content.PropertyChanged -= Content_PropertyChanged;
     62      Content.SuggestedInstances.CollectionReset -= SuggestedInstancesOnChanged;
     63      Content.SuggestedInstances.ItemsAdded -= SuggestedInstancesOnChanged;
     64      Content.SuggestedInstances.ItemsMoved -= SuggestedInstancesOnChanged;
     65      Content.SuggestedInstances.ItemsRemoved -= SuggestedInstancesOnChanged;
     66      Content.SuggestedInstances.ItemsReplaced -= SuggestedInstancesOnChanged;
    6167      base.DeregisterContentEvents();
    6268    }
     
    6470      base.RegisterContentEvents();
    6571      Content.PropertyChanged += Content_PropertyChanged;
     72      Content.SuggestedInstances.CollectionReset += SuggestedInstancesOnChanged;
     73      Content.SuggestedInstances.ItemsAdded += SuggestedInstancesOnChanged;
     74      Content.SuggestedInstances.ItemsMoved += SuggestedInstancesOnChanged;
     75      Content.SuggestedInstances.ItemsRemoved += SuggestedInstancesOnChanged;
     76      Content.SuggestedInstances.ItemsReplaced += SuggestedInstancesOnChanged;
    6677    }
    6778
     
    7182      try {
    7283        if (Content == null) {
    73           maxExecutionTimeTextBox.Text = String.Empty;
    7484          maxEvaluationsTextBox.Text = String.Empty;
    75           moveCostPerSolutionTextBox.Text = String.Empty;
    76           targetValueTextBox.Text = String.Empty;
    77           maximizationCheckBox.CheckState = CheckState.Indeterminate;
    78           terminationComboBox.SelectedIndex = -1;
    79           storeBestSolutionCheckBox.CheckState = CheckState.Indeterminate;
    80 
     85
     86          problemViewHost.Content = null;
    8187          algorithmViewHost.Content = null;
    82           currentRunView.Content = null;
    8388          runsView.Content = null;
     89          okbRunCollectionView.Content = null;
    8490        } else {
    85           maxExecutionTimeTextBox.Text = TimeSpanHelper.FormatNatural(Content.MaximumExecutionTime);
    8691          maxEvaluationsTextBox.Text = Content.MaximumEvaluations.ToString();
    87           moveCostPerSolutionTextBox.Text = Content.MoveCostPerSolution.ToString(CultureInfo.CurrentCulture.NumberFormat);
    88           targetValueTextBox.Text = Content.TargetValue.ToString(CultureInfo.CurrentCulture.NumberFormat);
    89           maximizationCheckBox.Checked = Content.Maximization;
    90           terminationComboBox.SelectedItem = Content.TerminationCriterium;
    91           storeBestSolutionCheckBox.Checked = Content.StoreSolutionInRun;
    92 
    93           algorithmViewHost.Content = Content.Algorithm;
    94           currentRunView.Content = Content.CurrentRun;
     92          problemViewHost.Content = Content.Problem;
    9593          runsView.Content = Content.Runs;
    96         }
     94          okbRunCollectionView.Content = Content.KnowledgeBase;
     95        }
     96        UpdateSuggestedInstancesCombobox();
    9797      } finally { SuppressEvents = false; }
    9898    }
     
    100100    protected override void SetEnabledStateOfControls() {
    101101      base.SetEnabledStateOfControls();
    102       maxExecutionTimeTextBox.Enabled = Content != null && !ReadOnly && !Locked;
    103102      maxEvaluationsTextBox.Enabled = Content != null && !ReadOnly && !Locked;
    104       moveCostPerSolutionTextBox.Enabled = Content != null && !ReadOnly && !Locked;
    105       targetValueTextBox.Enabled = Content != null && !ReadOnly && !Locked;
    106       maximizationCheckBox.Enabled = Content != null && !ReadOnly && !Locked;
    107       terminationComboBox.Enabled = Content != null && !ReadOnly && !Locked;
    108       storeBestSolutionCheckBox.Enabled = Content != null && !ReadOnly && !Locked;
    109       newAlgorithmButton.Enabled = Content != null && !ReadOnly;
    110       openAlgorithmButton.Enabled = Content != null && !ReadOnly;
    111       algorithmViewHost.Enabled = Content != null;
    112       currentRunView.Enabled = Content != null;
     103      newProblemButton.Enabled = Content != null && !ReadOnly && !Locked;
     104      openProblemButton.Enabled = Content != null && !ReadOnly && !Locked;
     105      problemViewHost.Enabled = Content != null && !ReadOnly && !Locked;
     106      suggestedInstancesComboBox.Enabled = Content != null && !ReadOnly && !Locked;
     107      algorithmViewHost.Enabled = Content != null && !ReadOnly && !Locked;
    113108      runsView.Enabled = Content != null;
     109      okbRunCollectionView.Enabled = Content != null;
    114110    }
    115111
     
    117113      if ((Content != null) && (Content.ExecutionState == ExecutionState.Started)) {
    118114        //The content must be stopped if no other view showing the content is available
    119         var optimizers = MainFormManager.MainForm.Views.OfType<IContentView>().Where(v => v != this).Select(v => v.Content).OfType<IAlgorithm>();
    120         if (!optimizers.Contains(Content.Algorithm)) {
     115        var optimizers = MainFormManager.MainForm.Views.OfType<IContentView>().Where(v => v != this).Select(v => v.Content).OfType<IOptimizer>();
     116        if (!optimizers.Contains(Content)) {
    121117          var nestedOptimizers = optimizers.SelectMany(opt => opt.NestedOptimizers);
    122118          if (!nestedOptimizers.Contains(Content)) Content.Stop();
     
    124120      }
    125121      base.OnClosed(e);
     122    }
     123
     124    private void UpdateSuggestedInstancesCombobox() {
     125      SuspendRepaint();
     126      try {
     127        var prevSelection = (IAlgorithm)suggestedInstancesComboBox.SelectedItem;
     128        var prevNewIndex = -1;
     129        suggestedInstancesComboBox.Items.Clear();
     130        if (Content == null) return;
     131
     132        for (var i = 0; i < Content.SuggestedInstances.Count; i++) {
     133          suggestedInstancesComboBox.Items.Add(Content.SuggestedInstances[i]);
     134          if (prevSelection == null || Content.SuggestedInstances[i].Name == prevSelection.Name)
     135            prevNewIndex = prevSelection == null ? 0 : i;
     136        }
     137        if (prevNewIndex >= 0) {
     138          suggestedInstancesComboBox.SelectedIndex = prevNewIndex;
     139        }
     140      } finally { ResumeRepaint(true); }
    126141    }
    127142
     
    136151      try {
    137152        switch (e.PropertyName) {
    138           case "TerminationCriterium": terminationComboBox.SelectedItem = Content.TerminationCriterium; break;
    139           case "MaximumExecutionTime": maxExecutionTimeTextBox.Text = TimeSpanHelper.FormatNatural(Content.MaximumExecutionTime); break;
    140153          case "MaximumEvaluations": maxEvaluationsTextBox.Text = Content.MaximumEvaluations.ToString(); break;
    141           case "TargetValue": targetValueTextBox.Text = Content.TargetValue.ToString(CultureInfo.CurrentCulture.NumberFormat); break;
    142           case "Maximization": maximizationCheckBox.Checked = Content.Maximization; break;
    143           case "MoveCostPerSolution": moveCostPerSolutionTextBox.Text = Content.MoveCostPerSolution.ToString(CultureInfo.CurrentCulture.NumberFormat); break;
    144           case "StoreSolutionInRun": storeBestSolutionCheckBox.Checked = Content.StoreSolutionInRun; break;
    145           case "Algorithm": algorithmViewHost.Content = Content.Algorithm; break;
    146           case "CurrentRun": currentRunView.Content = Content.CurrentRun; break;
    147154          case "Runs": runsView.Content = Content.Runs; break;
     155          case "KnowledgeBase": okbRunCollectionView.Content = Content.KnowledgeBase; break;
     156          case "Problem": problemViewHost.Content = Content.Problem; break;
    148157        }
    149158      } finally { SuppressEvents = false; }
    150159    }
     160
     161    private void SuggestedInstancesOnChanged(object sender, EventArgs e) {
     162      SuppressEvents = true;
     163      try {
     164        UpdateSuggestedInstancesCombobox();
     165      } finally { SuppressEvents = false; }
     166    }
    151167    #endregion
    152168
    153169    #region Control events
    154     private void maxExecutionTimeTextBox_Validating(object sender, CancelEventArgs e) {
    155       if (SuppressEvents) return;
    156       if (InvokeRequired) {
    157         Invoke((Action<object, CancelEventArgs>)maxExecutionTimeTextBox_Validating, sender, e);
    158         return;
    159       }
    160       TimeSpan ts;
    161       if (!TimeSpanHelper.TryGetFromNaturalFormat(maxExecutionTimeTextBox.Text, out ts)) {
    162         e.Cancel = !maxExecutionTimeTextBox.ReadOnly && maxExecutionTimeTextBox.Enabled;
    163         errorProvider.SetError(maxExecutionTimeTextBox, "Please enter a valid time span, e.g. 20 seconds ; 45s ; 4min ; 1h ; 3 hours ; 2 days ; 4d");
    164       } else {
    165         Content.MaximumExecutionTime = ts;
    166         e.Cancel = false;
    167         errorProvider.SetError(maxExecutionTimeTextBox, null);
    168       }
    169     }
    170 
    171170    private void maxEvaluationsTextBox_Validating(object sender, CancelEventArgs e) {
    172171      if (SuppressEvents) return;
     
    186185    }
    187186
    188     private void moveCostPerSolutionTextBox_Validating(object sender, CancelEventArgs e) {
    189       if (SuppressEvents) return;
    190       if (InvokeRequired) {
    191         Invoke((Action<object, CancelEventArgs>)moveCostPerSolutionTextBox_Validating, sender, e);
    192         return;
    193       }
    194       double value;
    195       if (!double.TryParse(moveCostPerSolutionTextBox.Text, out value)) {
    196         e.Cancel = !moveCostPerSolutionTextBox.ReadOnly && moveCostPerSolutionTextBox.Enabled;
    197         errorProvider.SetError(moveCostPerSolutionTextBox, "Please enter a valid integer number.");
    198       } else {
    199         Content.MoveCostPerSolution = value;
    200         e.Cancel = false;
    201         errorProvider.SetError(moveCostPerSolutionTextBox, null);
    202       }
    203     }
    204 
    205     private void targetValueTextBox_Validating(object sender, CancelEventArgs e) {
    206       if (SuppressEvents) return;
    207       if (InvokeRequired) {
    208         Invoke((Action<object, CancelEventArgs>)targetValueTextBox_Validating, sender, e);
    209         return;
    210       }
    211       double value;
    212       if (!double.TryParse(targetValueTextBox.Text, out value)) {
    213         e.Cancel = !targetValueTextBox.ReadOnly && targetValueTextBox.Enabled;
    214         errorProvider.SetError(targetValueTextBox, "Please enter a valid integer number.");
    215       } else {
    216         Content.TargetValue = value;
    217         e.Cancel = false;
    218         errorProvider.SetError(targetValueTextBox, null);
    219       }
    220     }
    221 
    222     private void maximizationCheckBox_CheckedChanged(object sender, EventArgs e) {
    223       if (SuppressEvents) return;
    224       if (InvokeRequired) {
    225         Invoke((Action<object, EventArgs>)maximizationCheckBox_CheckedChanged, sender, e);
    226         return;
    227       }
    228       Content.Maximization = maximizationCheckBox.Checked;
    229     }
    230 
    231     private void terminationComboBox_SelectedIndexChanged(object sender, EventArgs e) {
    232       if (SuppressEvents) return;
    233       if (InvokeRequired) {
    234         Invoke((Action<object, EventArgs>)terminationComboBox_SelectedIndexChanged, sender, e);
    235         return;
    236       }
    237       Content.TerminationCriterium = (TerminationCriterium)terminationComboBox.SelectedItem;
    238     }
    239 
    240     private void storeBestSolutionCheckBox_CheckedChanged(object sender, EventArgs e) {
    241       if (SuppressEvents) return;
    242       if (InvokeRequired) {
    243         Invoke((Action<object, EventArgs>)storeBestSolutionCheckBox_CheckedChanged, sender, e);
    244         return;
    245       }
    246       Content.StoreSolutionInRun = storeBestSolutionCheckBox.Checked;
    247     }
    248 
    249     private void newAlgorithmButton_Click(object sender, EventArgs e) {
    250       if (algorithmTypeSelectorDialog == null) {
    251         algorithmTypeSelectorDialog = new TypeSelectorDialog { Caption = "Select Algorithm" };
    252         algorithmTypeSelectorDialog.TypeSelector.Caption = "Available Algorithms";
    253         algorithmTypeSelectorDialog.TypeSelector.Configure(typeof(IAlgorithm)
     187    private void newProblemButton_Click(object sender, EventArgs e) {
     188      if (problemTypeSelectorDialog == null) {
     189        problemTypeSelectorDialog = new TypeSelectorDialog { Caption = "Select Problem" };
     190        problemTypeSelectorDialog.TypeSelector.Caption = "Available Problems";
     191        problemTypeSelectorDialog.TypeSelector.Configure(typeof(IProblem)
    254192          , showNotInstantiableTypes: false, showGenericTypes: false);
    255193      }
    256       if (algorithmTypeSelectorDialog.ShowDialog(this) == DialogResult.OK) {
     194      if (problemTypeSelectorDialog.ShowDialog(this) == DialogResult.OK) {
    257195        try {
    258           Content.Algorithm = (IAlgorithm)algorithmTypeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
     196          Content.Problem = (IProblem)problemTypeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
    259197        } catch (Exception ex) {
    260198          ErrorHandling.ShowErrorDialog(this, ex);
     
    263201    }
    264202
    265     private void openAlgorithmButton_Click(object sender, EventArgs e) {
    266       openFileDialog.Title = "Open Algorithm";
     203    private void openProblemButton_Click(object sender, EventArgs e) {
     204      openFileDialog.Title = "Open Problem";
    267205      if (openFileDialog.ShowDialog(this) == DialogResult.OK) {
    268         newAlgorithmButton.Enabled = openAlgorithmButton.Enabled = false;
    269         algorithmViewHost.Enabled = false;
     206        newProblemButton.Enabled = openProblemButton.Enabled = false;
     207        problemViewHost.Enabled = false;
    270208
    271209        ContentManager.LoadAsync(openFileDialog.FileName, delegate(IStorableContent content, Exception error) {
    272210          try {
    273211            if (error != null) throw error;
    274             var algorithm = content as IAlgorithm;
    275             if (algorithm == null)
    276               MessageBox.Show(this, "The selected file does not contain an algorithm.", "Invalid File", MessageBoxButtons.OK, MessageBoxIcon.Error);
    277             else
    278               Content.Algorithm = algorithm;
     212            var problem = content as IProblem;
     213            if (problem == null) {
     214              var algorithm = content as IAlgorithm;
     215              if (algorithm == null || algorithm.Problem == null)
     216                MessageBox.Show(this, "The selected file is not a problem, nor an algorithm with a problem.", "Invalid File", MessageBoxButtons.OK, MessageBoxIcon.Error);
     217              else Content.Problem = algorithm.Problem;
     218            } else
     219              Content.Problem = problem;
    279220          } catch (Exception ex) {
    280221            ErrorHandling.ShowErrorDialog(this, ex);
    281222          } finally {
    282223            Invoke(new Action(delegate() {
    283               algorithmViewHost.Enabled = true;
    284               newAlgorithmButton.Enabled = openAlgorithmButton.Enabled = true;
     224              problemViewHost.Enabled = true;
     225              newProblemButton.Enabled = openProblemButton.Enabled = true;
    285226            }));
    286227          }
     
    289230    }
    290231
    291     private void algorithmTabPage_DragEnterOver(object sender, DragEventArgs e) {
     232    private void problemTabPage_DragEnterOver(object sender, DragEventArgs e) {
    292233      e.Effect = DragDropEffects.None;
    293       var alg = e.Data.GetData(Constants.DragDropDataFormat) as IAlgorithm;
    294       if (!ReadOnly && alg != null) {
    295         if (!typeof(ISingleObjectiveHeuristicOptimizationProblem).IsAssignableFrom(alg.ProblemType))
    296           return;
     234      var prob = e.Data.GetData(Constants.DragDropDataFormat) as IProblem;
     235      if (!ReadOnly && prob != null) {
    297236        if ((e.KeyState & 32) == 32) e.Effect = DragDropEffects.Link;  // ALT key
    298237        else if ((e.KeyState & 4) == 4) e.Effect = DragDropEffects.Move;  // SHIFT key
     
    303242    }
    304243
    305     private void algorithmTabPage_DragDrop(object sender, DragEventArgs e) {
     244    private void problemTabPage_DragDrop(object sender, DragEventArgs e) {
    306245      if (e.Effect != DragDropEffects.None) {
    307         var algorithm = e.Data.GetData(Constants.DragDropDataFormat) as IAlgorithm;
    308         if (e.Effect.HasFlag(DragDropEffects.Copy)) algorithm = (IAlgorithm)algorithm.Clone();
    309         Content.Algorithm = algorithm;
    310       }
     246        var prob = e.Data.GetData(Constants.DragDropDataFormat) as IProblem;
     247        if (e.Effect.HasFlag(DragDropEffects.Copy)) prob = (IProblem)prob.Clone();
     248        Content.Problem = prob;
     249      }
     250    }
     251
     252    private void suggestedInstancesComboBox_SelectedIndexChanged(object sender, EventArgs e) {
     253      if (SuppressEvents) return;
     254      if (InvokeRequired) { Invoke((Action<object, EventArgs>)suggestedInstancesComboBox_SelectedIndexChanged, sender, e); return; }
     255      if (suggestedInstancesComboBox.SelectedIndex >= 0)
     256        algorithmViewHost.Content = (IAlgorithm)suggestedInstancesComboBox.SelectedItem;
     257      else algorithmViewHost.Content = null;
    311258    }
    312259    #endregion
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Views/3.3/HeuristicLab.OptimizationExpertSystem.Views-3.3.csproj

    r12842 r12847  
    125125    <Reference Include="System" />
    126126    <Reference Include="System.Core" />
     127    <Reference Include="System.Drawing" />
     128    <Reference Include="System.Windows.Forms" />
    127129    <Reference Include="System.Xml.Linq" />
    128130    <Reference Include="System.Data.DataSetExtensions" />
     
    132134  </ItemGroup>
    133135  <ItemGroup>
     136    <Compile Include="ExpertSystemOptimizerView.cs">
     137      <SubType>UserControl</SubType>
     138    </Compile>
     139    <Compile Include="ExpertSystemOptimizerView.Designer.cs">
     140      <DependentUpon>ExpertSystemOptimizerView.cs</DependentUpon>
     141    </Compile>
    134142    <Compile Include="Plugin.cs" />
    135143    <None Include="Properties\AssemblyInfo.cs.frame" />
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Views/3.3/Plugin.cs.frame

    r12842 r12847  
    2828  [Plugin("HeuristicLab.OptimizationExpertSystem.Views", "3.3.12.$WCREV$")]
    2929  [PluginFile("HeuristicLab.OptimizationExpertSystem.Views-3.3.dll", PluginFileType.Assembly)]
    30   [PluginDependency("HeuristicLab.Analysis", "3.7.0")]
     30  [PluginDependency("HeuristicLab.Analysis", "3.3")]
    3131  [PluginDependency("HeuristicLab.Collections", "3.3")]
    3232  [PluginDependency("HeuristicLab.Common", "3.3")]
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/ExpertSystemOptimizer.cs

    r12842 r12847  
    4141    public static new Image StaticItemImage {
    4242      get { return VSImageLibrary.Library; }
     43    }
     44
     45    [Storable]
     46    private int maximumEvaluations;
     47    public int MaximumEvaluations {
     48      get { return maximumEvaluations; }
     49      set {
     50        if (maximumEvaluations == value) return;
     51        maximumEvaluations = value;
     52        OnPropertyChanged("MaximumEvaluations");
     53      }
    4354    }
    4455
     
    104115    }
    105116
     117    [Storable]
     118    private ItemList<IAlgorithm> suggestedInstances;
     119    private ReadOnlyItemList<IAlgorithm> readOnlySuggestedInstances;
     120    public ReadOnlyItemList<IAlgorithm> SuggestedInstances {
     121      get { return readOnlySuggestedInstances; }
     122    }
     123
    106124    public IEnumerable<IOptimizer> NestedOptimizers {
    107       get { yield break; }
     125      get { return SuggestedInstances; }
    108126    }
    109127
     
    117135      knowledgeBase = cloner.Clone(original.knowledgeBase);
    118136      problem = cloner.Clone(original.problem);
     137      suggestedInstances = cloner.Clone(original.suggestedInstances);
     138      readOnlySuggestedInstances = suggestedInstances.AsReadOnly();
    119139    }
    120140    public ExpertSystemOptimizer() {
    121141      Runs = new RunCollection();
     142      KnowledgeBase = new RunCollection();
     143      suggestedInstances = new ItemList<IAlgorithm>();
     144      readOnlySuggestedInstances = suggestedInstances.AsReadOnly();
    122145      ExecutionState = ExecutionState.Stopped;
    123146      ExecutionTime = TimeSpan.Zero;
     
    126149    public override IDeepCloneable Clone(Cloner cloner) {
    127150      return new ExpertSystemOptimizer(this, cloner);
     151    }
     152
     153    [StorableHook(HookType.AfterDeserialization)]
     154    private void AfterDeserialization() {
     155      readOnlySuggestedInstances = suggestedInstances.AsReadOnly();
    128156    }
    129157
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Plugin.cs.frame

    r12842 r12847  
    2828  [Plugin("HeuristicLab.OptimizationExpertSystem", "3.3.12.$WCREV$")]
    2929  [PluginFile("HeuristicLab.OptimizationExpertSystem-3.3.dll", PluginFileType.Assembly)]
    30   [PluginDependency("HeuristicLab.Analysis", "3.7.0")]
     30  [PluginDependency("HeuristicLab.Analysis", "3.3")]
    3131  [PluginDependency("HeuristicLab.Collections", "3.3")]
    3232  [PluginDependency("HeuristicLab.Common", "3.3")]
Note: See TracChangeset for help on using the changeset viewer.