Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/26/15 21:32:52 (9 years ago)
Author:
abeham
Message:

#2431:

  • worked on IRRRun (early abort still troublesome)
  • Updated RLD view to allow defining targets
  • Attempting to handle maximization/minimization
Location:
branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3
Files:
4 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/HeuristicLab.Optimization.Views-3.3.csproj

    r12803 r12804  
    223223      <DependentUpon>CreateNewSingleEncodingDialog.cs</DependentUpon>
    224224    </Compile>
     225    <Compile Include="IRRestarterView.cs">
     226      <SubType>UserControl</SubType>
     227    </Compile>
     228    <Compile Include="IRRestarterView.Designer.cs">
     229      <DependentUpon>IRRestarterView.cs</DependentUpon>
     230    </Compile>
    225231    <Compile Include="ISolutionSimilarityCalculatorView.cs">
    226232      <SubType>UserControl</SubType>
  • branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/IRRestarterView.Designer.cs

    r12764 r12804  
    2121
    2222namespace HeuristicLab.Optimization.Views {
    23   partial class TimeLimitRunView {
     23  partial class IndependentRandomRestarterView {
    2424    /// <summary>
    2525    /// Required designer variable.
     
    3434    /// </summary>
    3535    private void InitializeComponent() {
    36       System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TimeLimitRunView));
     36      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(IndependentRandomRestarterView));
    3737      this.timeLimitLabel = new System.Windows.Forms.Label();
    38       this.timeLimitTextBox = new System.Windows.Forms.TextBox();
    39       this.label1 = new System.Windows.Forms.Label();
    40       this.snapshotsTextBox = new System.Windows.Forms.TextBox();
    41       this.storeAlgorithmInEachSnapshotCheckBox = new System.Windows.Forms.CheckBox();
     38      this.maxExecutionTimeTextBox = new System.Windows.Forms.TextBox();
     39      this.evaluationsLimitabel = new System.Windows.Forms.Label();
     40      this.maxEvaluationsTextBox = new System.Windows.Forms.TextBox();
    4241      this.tabControl = new HeuristicLab.MainForm.WindowsForms.DragOverTabControl();
    4342      this.algorithmTabPage = new System.Windows.Forms.TabPage();
     
    4544      this.openAlgorithmButton = new System.Windows.Forms.Button();
    4645      this.newAlgorithmButton = new System.Windows.Forms.Button();
    47       this.snapshotsTabPage = new System.Windows.Forms.TabPage();
    48       this.snapshotsView = new HeuristicLab.Optimization.Views.RunCollectionView();
     46      this.currentRunTabPage = new System.Windows.Forms.TabPage();
     47      this.currentRunView = new HeuristicLab.Optimization.Views.RunView();
    4948      this.runsTabPage = new System.Windows.Forms.TabPage();
    5049      this.runsView = new HeuristicLab.Optimization.Views.RunCollectionView();
    5150      this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
    52       this.snapshotButton = new System.Windows.Forms.Button();
    53       this.sequenceButton = new System.Windows.Forms.Button();
     51      this.targetValueTextBox = new System.Windows.Forms.TextBox();
     52      this.targetValueLabel = new System.Windows.Forms.Label();
     53      this.terminationComboBox = new System.Windows.Forms.ComboBox();
     54      this.terminationLabel = new System.Windows.Forms.Label();
     55      this.moveCostPerSolutionTextBox = new System.Windows.Forms.TextBox();
     56      this.moveCostPerSolutionLabel = new System.Windows.Forms.Label();
     57      this.maximizationLabel = new System.Windows.Forms.Label();
     58      this.maximizationCheckBox = new System.Windows.Forms.CheckBox();
    5459      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    5560      this.tabControl.SuspendLayout();
    5661      this.algorithmTabPage.SuspendLayout();
    57       this.snapshotsTabPage.SuspendLayout();
     62      this.currentRunTabPage.SuspendLayout();
    5863      this.runsTabPage.SuspendLayout();
    5964      this.SuspendLayout();
     
    95100      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
    96101      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
    97       this.nameTextBox.Location = new System.Drawing.Point(69, 0);
    98       this.nameTextBox.Size = new System.Drawing.Size(455, 20);
     102      this.nameTextBox.Location = new System.Drawing.Point(115, 0);
     103      this.nameTextBox.Size = new System.Drawing.Size(409, 20);
    99104      //
    100105      // infoLabel
     
    107112      this.timeLimitLabel.Location = new System.Drawing.Point(3, 29);
    108113      this.timeLimitLabel.Name = "timeLimitLabel";
    109       this.timeLimitLabel.Size = new System.Drawing.Size(53, 13);
     114      this.timeLimitLabel.Size = new System.Drawing.Size(106, 13);
    110115      this.timeLimitLabel.TabIndex = 3;
    111       this.timeLimitLabel.Text = "Time limit:";
    112       //
    113       // timeLimitTextBox
    114       //
    115       this.timeLimitTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     116      this.timeLimitLabel.Text = "Max Execution Time:";
     117      //
     118      // maxExecutionTimeTextBox
     119      //
     120      this.maxExecutionTimeTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    116121            | System.Windows.Forms.AnchorStyles.Right)));
    117       this.timeLimitTextBox.Location = new System.Drawing.Point(69, 26);
    118       this.timeLimitTextBox.Name = "timeLimitTextBox";
    119       this.timeLimitTextBox.Size = new System.Drawing.Size(455, 20);
    120       this.timeLimitTextBox.TabIndex = 4;
    121       this.timeLimitTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.timeLimitTextBox_Validating);
    122       //
    123       // label1
    124       //
    125       this.label1.AutoSize = true;
    126       this.label1.Location = new System.Drawing.Point(3, 55);
    127       this.label1.Name = "label1";
    128       this.label1.Size = new System.Drawing.Size(60, 13);
    129       this.label1.TabIndex = 5;
    130       this.label1.Text = "Snapshots:";
    131       //
    132       // snapshotsTextBox
    133       //
    134       this.snapshotsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    135             | System.Windows.Forms.AnchorStyles.Right)));
    136       this.snapshotsTextBox.Location = new System.Drawing.Point(69, 52);
    137       this.snapshotsTextBox.Name = "snapshotsTextBox";
    138       this.snapshotsTextBox.Size = new System.Drawing.Size(175, 20);
    139       this.snapshotsTextBox.TabIndex = 6;
    140       this.snapshotsTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.snapshotsTextBox_Validating);
    141       //
    142       // storeAlgorithmInEachSnapshotCheckBox
    143       //
    144       this.storeAlgorithmInEachSnapshotCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    145       this.storeAlgorithmInEachSnapshotCheckBox.AutoSize = true;
    146       this.storeAlgorithmInEachSnapshotCheckBox.Location = new System.Drawing.Point(340, 54);
    147       this.storeAlgorithmInEachSnapshotCheckBox.Name = "storeAlgorithmInEachSnapshotCheckBox";
    148       this.storeAlgorithmInEachSnapshotCheckBox.Size = new System.Drawing.Size(184, 17);
    149       this.storeAlgorithmInEachSnapshotCheckBox.TabIndex = 7;
    150       this.storeAlgorithmInEachSnapshotCheckBox.Text = "Store Algorithm in Each Snapshot";
    151       this.storeAlgorithmInEachSnapshotCheckBox.UseVisualStyleBackColor = true;
    152       this.storeAlgorithmInEachSnapshotCheckBox.CheckedChanged += new System.EventHandler(this.storeAlgorithmInEachSnapshotCheckBox_CheckedChanged);
     122      this.maxExecutionTimeTextBox.Location = new System.Drawing.Point(115, 26);
     123      this.maxExecutionTimeTextBox.Name = "maxExecutionTimeTextBox";
     124      this.maxExecutionTimeTextBox.Size = new System.Drawing.Size(409, 20);
     125      this.maxExecutionTimeTextBox.TabIndex = 4;
     126      this.maxExecutionTimeTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.maxExecutionTimeTextBox_Validating);
     127      //
     128      // evaluationsLimitabel
     129      //
     130      this.evaluationsLimitabel.AutoSize = true;
     131      this.evaluationsLimitabel.Location = new System.Drawing.Point(3, 55);
     132      this.evaluationsLimitabel.Name = "evaluationsLimitabel";
     133      this.evaluationsLimitabel.Size = new System.Drawing.Size(88, 13);
     134      this.evaluationsLimitabel.TabIndex = 5;
     135      this.evaluationsLimitabel.Text = "Max Evaluations:";
     136      //
     137      // maxEvaluationsTextBox
     138      //
     139      this.maxEvaluationsTextBox.Location = new System.Drawing.Point(115, 52);
     140      this.maxEvaluationsTextBox.Name = "maxEvaluationsTextBox";
     141      this.maxEvaluationsTextBox.Size = new System.Drawing.Size(157, 20);
     142      this.maxEvaluationsTextBox.TabIndex = 6;
     143      this.maxEvaluationsTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.maxEvaluationsTextBox_Validating);
    153144      //
    154145      // tabControl
     
    159150            | System.Windows.Forms.AnchorStyles.Right)));
    160151      this.tabControl.Controls.Add(this.algorithmTabPage);
    161       this.tabControl.Controls.Add(this.snapshotsTabPage);
     152      this.tabControl.Controls.Add(this.currentRunTabPage);
    162153      this.tabControl.Controls.Add(this.runsTabPage);
    163       this.tabControl.Location = new System.Drawing.Point(0, 78);
     154      this.tabControl.Location = new System.Drawing.Point(0, 132);
    164155      this.tabControl.Name = "tabControl";
    165156      this.tabControl.SelectedIndex = 0;
    166       this.tabControl.Size = new System.Drawing.Size(546, 356);
     157      this.tabControl.Size = new System.Drawing.Size(546, 302);
    167158      this.tabControl.TabIndex = 8;
    168159      //
     
    176167      this.algorithmTabPage.Name = "algorithmTabPage";
    177168      this.algorithmTabPage.Padding = new System.Windows.Forms.Padding(3);
    178       this.algorithmTabPage.Size = new System.Drawing.Size(538, 330);
     169      this.algorithmTabPage.Size = new System.Drawing.Size(538, 276);
    179170      this.algorithmTabPage.TabIndex = 1;
    180171      this.algorithmTabPage.Text = "Algorithm";
     
    195186      this.algorithmViewHost.Name = "algorithmViewHost";
    196187      this.algorithmViewHost.ReadOnly = false;
    197       this.algorithmViewHost.Size = new System.Drawing.Size(526, 288);
     188      this.algorithmViewHost.Size = new System.Drawing.Size(526, 234);
    198189      this.algorithmViewHost.TabIndex = 2;
    199190      this.algorithmViewHost.ViewsLabelVisible = true;
     
    202193      // openAlgorithmButton
    203194      //
    204       this.openAlgorithmButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Open;
     195      this.openAlgorithmButton.Image = ((System.Drawing.Image)(resources.GetObject("openAlgorithmButton.Image")));
    205196      this.openAlgorithmButton.Location = new System.Drawing.Point(36, 6);
    206197      this.openAlgorithmButton.Name = "openAlgorithmButton";
     
    213204      // newAlgorithmButton
    214205      //
    215       this.newAlgorithmButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.NewDocument;
     206      this.newAlgorithmButton.Image = ((System.Drawing.Image)(resources.GetObject("newAlgorithmButton.Image")));
    216207      this.newAlgorithmButton.Location = new System.Drawing.Point(6, 6);
    217208      this.newAlgorithmButton.Name = "newAlgorithmButton";
     
    222213      this.newAlgorithmButton.Click += new System.EventHandler(this.newAlgorithmButton_Click);
    223214      //
    224       // snapshotsTabPage
    225       //
    226       this.snapshotsTabPage.Controls.Add(this.snapshotsView);
    227       this.snapshotsTabPage.Location = new System.Drawing.Point(4, 22);
    228       this.snapshotsTabPage.Name = "snapshotsTabPage";
    229       this.snapshotsTabPage.Padding = new System.Windows.Forms.Padding(3);
    230       this.snapshotsTabPage.Size = new System.Drawing.Size(538, 330);
    231       this.snapshotsTabPage.TabIndex = 2;
    232       this.snapshotsTabPage.Text = "Snapshots";
    233       this.snapshotsTabPage.UseVisualStyleBackColor = true;
    234       //
    235       // snapshotsView
    236       //
    237       this.snapshotsView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    238             | System.Windows.Forms.AnchorStyles.Left)
    239             | System.Windows.Forms.AnchorStyles.Right)));
    240       this.snapshotsView.Caption = "RunCollection View";
    241       this.snapshotsView.Content = null;
    242       this.snapshotsView.Location = new System.Drawing.Point(6, 6);
    243       this.snapshotsView.Name = "snapshotsView";
    244       this.snapshotsView.ReadOnly = false;
    245       this.snapshotsView.Size = new System.Drawing.Size(526, 317);
    246       this.snapshotsView.TabIndex = 0;
     215      // currentRunTabPage
     216      //
     217      this.currentRunTabPage.Controls.Add(this.currentRunView);
     218      this.currentRunTabPage.Location = new System.Drawing.Point(4, 22);
     219      this.currentRunTabPage.Name = "currentRunTabPage";
     220      this.currentRunTabPage.Padding = new System.Windows.Forms.Padding(6);
     221      this.currentRunTabPage.Size = new System.Drawing.Size(538, 276);
     222      this.currentRunTabPage.TabIndex = 4;
     223      this.currentRunTabPage.Text = "Current Run";
     224      this.currentRunTabPage.UseVisualStyleBackColor = true;
     225      //
     226      // currentRunView
     227      //
     228      this.currentRunView.Caption = "Run View";
     229      this.currentRunView.Content = null;
     230      this.currentRunView.Dock = System.Windows.Forms.DockStyle.Fill;
     231      this.currentRunView.Location = new System.Drawing.Point(6, 6);
     232      this.currentRunView.Name = "currentRunView";
     233      this.currentRunView.ReadOnly = false;
     234      this.currentRunView.Size = new System.Drawing.Size(526, 264);
     235      this.currentRunView.TabIndex = 0;
    247236      //
    248237      // runsTabPage
     
    251240      this.runsTabPage.Location = new System.Drawing.Point(4, 22);
    252241      this.runsTabPage.Name = "runsTabPage";
    253       this.runsTabPage.Size = new System.Drawing.Size(538, 330);
     242      this.runsTabPage.Padding = new System.Windows.Forms.Padding(6);
     243      this.runsTabPage.Size = new System.Drawing.Size(538, 276);
    254244      this.runsTabPage.TabIndex = 3;
    255245      this.runsTabPage.Text = "Runs";
     
    258248      // runsView
    259249      //
    260       this.runsView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    261             | System.Windows.Forms.AnchorStyles.Left)
    262             | System.Windows.Forms.AnchorStyles.Right)));
    263250      this.runsView.Caption = "RunCollection View";
    264251      this.runsView.Content = null;
     252      this.runsView.Dock = System.Windows.Forms.DockStyle.Fill;
    265253      this.runsView.Location = new System.Drawing.Point(6, 6);
    266254      this.runsView.Name = "runsView";
    267255      this.runsView.ReadOnly = false;
    268       this.runsView.Size = new System.Drawing.Size(526, 317);
     256      this.runsView.Size = new System.Drawing.Size(526, 264);
    269257      this.runsView.TabIndex = 1;
    270258      //
     
    276264      this.openFileDialog.Title = "Open Optimizer";
    277265      //
    278       // snapshotButton
    279       //
    280       this.snapshotButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
    281       this.snapshotButton.Location = new System.Drawing.Point(120, 440);
    282       this.snapshotButton.Name = "snapshotButton";
    283       this.snapshotButton.Size = new System.Drawing.Size(24, 24);
    284       this.snapshotButton.TabIndex = 13;
    285       this.snapshotButton.Text = "Snapshot";
    286       this.toolTip.SetToolTip(this.snapshotButton, "Create Snapshot");
    287       this.snapshotButton.UseVisualStyleBackColor = true;
    288       this.snapshotButton.Click += new System.EventHandler(this.snapshotButton_Click);
    289       //
    290       // sequenceButton
    291       //
    292       this.sequenceButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    293       this.sequenceButton.Location = new System.Drawing.Point(250, 50);
    294       this.sequenceButton.Name = "sequenceButton";
    295       this.sequenceButton.Size = new System.Drawing.Size(75, 23);
    296       this.sequenceButton.TabIndex = 16;
    297       this.sequenceButton.Text = "Sequence...";
    298       this.sequenceButton.UseVisualStyleBackColor = true;
    299       this.sequenceButton.Click += new System.EventHandler(this.sequenceButton_Click);
    300       //
    301       // TimeLimitRunView
     266      // targetValueTextBox
     267      //
     268      this.targetValueTextBox.Location = new System.Drawing.Point(115, 78);
     269      this.targetValueTextBox.Name = "targetValueTextBox";
     270      this.targetValueTextBox.Size = new System.Drawing.Size(157, 20);
     271      this.targetValueTextBox.TabIndex = 6;
     272      this.targetValueTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.targetValueTextBox_Validating);
     273      //
     274      // targetValueLabel
     275      //
     276      this.targetValueLabel.AutoSize = true;
     277      this.targetValueLabel.Location = new System.Drawing.Point(3, 81);
     278      this.targetValueLabel.Name = "targetValueLabel";
     279      this.targetValueLabel.Size = new System.Drawing.Size(71, 13);
     280      this.targetValueLabel.TabIndex = 5;
     281      this.targetValueLabel.Text = "Target Value:";
     282      //
     283      // terminationComboBox
     284      //
     285      this.terminationComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     286            | System.Windows.Forms.AnchorStyles.Right)));
     287      this.terminationComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     288      this.terminationComboBox.FormattingEnabled = true;
     289      this.terminationComboBox.Location = new System.Drawing.Point(115, 105);
     290      this.terminationComboBox.Name = "terminationComboBox";
     291      this.terminationComboBox.Size = new System.Drawing.Size(409, 21);
     292      this.terminationComboBox.TabIndex = 16;
     293      this.terminationComboBox.SelectedIndexChanged += new System.EventHandler(this.terminationComboBox_SelectedIndexChanged);
     294      //
     295      // terminationLabel
     296      //
     297      this.terminationLabel.AutoSize = true;
     298      this.terminationLabel.Location = new System.Drawing.Point(3, 108);
     299      this.terminationLabel.Name = "terminationLabel";
     300      this.terminationLabel.Size = new System.Drawing.Size(65, 13);
     301      this.terminationLabel.TabIndex = 5;
     302      this.terminationLabel.Text = "Termination:";
     303      //
     304      // moveCostPerSolutionTextBox
     305      //
     306      this.moveCostPerSolutionTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     307            | System.Windows.Forms.AnchorStyles.Right)));
     308      this.moveCostPerSolutionTextBox.Location = new System.Drawing.Point(401, 52);
     309      this.moveCostPerSolutionTextBox.Name = "moveCostPerSolutionTextBox";
     310      this.moveCostPerSolutionTextBox.Size = new System.Drawing.Size(123, 20);
     311      this.moveCostPerSolutionTextBox.TabIndex = 6;
     312      this.moveCostPerSolutionTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.moveCostPerSolutionTextBox_Validating);
     313      //
     314      // moveCostPerSolutionLabel
     315      //
     316      this.moveCostPerSolutionLabel.AutoSize = true;
     317      this.moveCostPerSolutionLabel.Location = new System.Drawing.Point(278, 55);
     318      this.moveCostPerSolutionLabel.Name = "moveCostPerSolutionLabel";
     319      this.moveCostPerSolutionLabel.Size = new System.Drawing.Size(117, 13);
     320      this.moveCostPerSolutionLabel.TabIndex = 5;
     321      this.moveCostPerSolutionLabel.Text = "Move cost per solution:";
     322      //
     323      // maximizationLabel
     324      //
     325      this.maximizationLabel.AutoSize = true;
     326      this.maximizationLabel.Location = new System.Drawing.Point(278, 81);
     327      this.maximizationLabel.Name = "maximizationLabel";
     328      this.maximizationLabel.Size = new System.Drawing.Size(70, 13);
     329      this.maximizationLabel.TabIndex = 5;
     330      this.maximizationLabel.Text = "Maximization:";
     331      //
     332      // maximizationCheckBox
     333      //
     334      this.maximizationCheckBox.AutoSize = true;
     335      this.maximizationCheckBox.Location = new System.Drawing.Point(401, 80);
     336      this.maximizationCheckBox.Name = "maximizationCheckBox";
     337      this.maximizationCheckBox.Size = new System.Drawing.Size(15, 14);
     338      this.maximizationCheckBox.TabIndex = 17;
     339      this.maximizationCheckBox.UseVisualStyleBackColor = true;
     340      this.maximizationCheckBox.CheckedChanged += new System.EventHandler(this.maximizationCheckBox_CheckedChanged);
     341      //
     342      // IndependentRandomRestarterView
    302343      //
    303344      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    304       this.Controls.Add(this.sequenceButton);
    305       this.Controls.Add(this.snapshotButton);
     345      this.Controls.Add(this.maximizationCheckBox);
     346      this.Controls.Add(this.terminationComboBox);
    306347      this.Controls.Add(this.tabControl);
    307       this.Controls.Add(this.timeLimitTextBox);
     348      this.Controls.Add(this.maxExecutionTimeTextBox);
    308349      this.Controls.Add(this.timeLimitLabel);
    309       this.Controls.Add(this.label1);
    310       this.Controls.Add(this.snapshotsTextBox);
    311       this.Controls.Add(this.storeAlgorithmInEachSnapshotCheckBox);
    312       this.Name = "TimeLimitRunView";
     350      this.Controls.Add(this.terminationLabel);
     351      this.Controls.Add(this.targetValueLabel);
     352      this.Controls.Add(this.maximizationLabel);
     353      this.Controls.Add(this.moveCostPerSolutionLabel);
     354      this.Controls.Add(this.evaluationsLimitabel);
     355      this.Controls.Add(this.moveCostPerSolutionTextBox);
     356      this.Controls.Add(this.targetValueTextBox);
     357      this.Controls.Add(this.maxEvaluationsTextBox);
     358      this.Name = "IndependentRandomRestarterView";
    313359      this.Size = new System.Drawing.Size(549, 464);
    314       this.Controls.SetChildIndex(this.storeAlgorithmInEachSnapshotCheckBox, 0);
    315       this.Controls.SetChildIndex(this.snapshotsTextBox, 0);
    316       this.Controls.SetChildIndex(this.label1, 0);
     360      this.Controls.SetChildIndex(this.maxEvaluationsTextBox, 0);
     361      this.Controls.SetChildIndex(this.targetValueTextBox, 0);
     362      this.Controls.SetChildIndex(this.moveCostPerSolutionTextBox, 0);
     363      this.Controls.SetChildIndex(this.evaluationsLimitabel, 0);
     364      this.Controls.SetChildIndex(this.moveCostPerSolutionLabel, 0);
     365      this.Controls.SetChildIndex(this.maximizationLabel, 0);
     366      this.Controls.SetChildIndex(this.targetValueLabel, 0);
     367      this.Controls.SetChildIndex(this.terminationLabel, 0);
    317368      this.Controls.SetChildIndex(this.timeLimitLabel, 0);
    318       this.Controls.SetChildIndex(this.timeLimitTextBox, 0);
     369      this.Controls.SetChildIndex(this.maxExecutionTimeTextBox, 0);
    319370      this.Controls.SetChildIndex(this.tabControl, 0);
    320371      this.Controls.SetChildIndex(this.nameLabel, 0);
     
    327378      this.Controls.SetChildIndex(this.executionTimeTextBox, 0);
    328379      this.Controls.SetChildIndex(this.startButton, 0);
    329       this.Controls.SetChildIndex(this.snapshotButton, 0);
    330       this.Controls.SetChildIndex(this.sequenceButton, 0);
     380      this.Controls.SetChildIndex(this.terminationComboBox, 0);
     381      this.Controls.SetChildIndex(this.maximizationCheckBox, 0);
    331382      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    332383      this.tabControl.ResumeLayout(false);
    333384      this.algorithmTabPage.ResumeLayout(false);
    334       this.snapshotsTabPage.ResumeLayout(false);
     385      this.currentRunTabPage.ResumeLayout(false);
    335386      this.runsTabPage.ResumeLayout(false);
    336387      this.ResumeLayout(false);
     
    342393
    343394    private System.Windows.Forms.Label timeLimitLabel;
    344     private System.Windows.Forms.TextBox timeLimitTextBox;
    345     private System.Windows.Forms.Label label1;
    346     private System.Windows.Forms.TextBox snapshotsTextBox;
    347     private System.Windows.Forms.CheckBox storeAlgorithmInEachSnapshotCheckBox;
     395    private System.Windows.Forms.TextBox maxExecutionTimeTextBox;
     396    private System.Windows.Forms.Label evaluationsLimitabel;
     397    private System.Windows.Forms.TextBox maxEvaluationsTextBox;
    348398    private MainForm.WindowsForms.DragOverTabControl tabControl;
     399    private System.Windows.Forms.TabPage runsTabPage;
     400    private RunCollectionView runsView;
     401    private System.Windows.Forms.OpenFileDialog openFileDialog;
     402    private System.Windows.Forms.TextBox targetValueTextBox;
     403    private System.Windows.Forms.Label targetValueLabel;
     404    private System.Windows.Forms.ComboBox terminationComboBox;
     405    private System.Windows.Forms.Label terminationLabel;
     406    private System.Windows.Forms.TextBox moveCostPerSolutionTextBox;
     407    private System.Windows.Forms.Label moveCostPerSolutionLabel;
     408    private System.Windows.Forms.Label maximizationLabel;
     409    private System.Windows.Forms.CheckBox maximizationCheckBox;
    349410    private System.Windows.Forms.TabPage algorithmTabPage;
    350411    private MainForm.WindowsForms.ViewHost algorithmViewHost;
    351412    private System.Windows.Forms.Button openAlgorithmButton;
    352413    private System.Windows.Forms.Button newAlgorithmButton;
    353     private System.Windows.Forms.TabPage snapshotsTabPage;
    354     private RunCollectionView snapshotsView;
    355     private System.Windows.Forms.TabPage runsTabPage;
    356     private RunCollectionView runsView;
    357     private System.Windows.Forms.OpenFileDialog openFileDialog;
    358     private System.Windows.Forms.Button snapshotButton;
    359     private System.Windows.Forms.Button sequenceButton;
     414    private System.Windows.Forms.TabPage currentRunTabPage;
     415    private RunView currentRunView;
    360416  }
    361417}
  • branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/IRRestarterView.cs

    r12764 r12804  
    2222using System;
    2323using System.ComponentModel;
     24using System.Globalization;
    2425using System.Linq;
    25 using System.Text.RegularExpressions;
    2626using System.Windows.Forms;
    27 using HeuristicLab.Collections;
     27using HeuristicLab.Analysis;
    2828using HeuristicLab.Common;
    29 using HeuristicLab.Common.Resources;
    3029using HeuristicLab.Core;
    3130using HeuristicLab.Core.Views;
    3231using HeuristicLab.MainForm;
    33 using HeuristicLab.MainForm.WindowsForms;
    3432using HeuristicLab.PluginInfrastructure;
    3533
    3634namespace HeuristicLab.Optimization.Views {
    37   [View("TimeLimit Run View")]
    38   [Content(typeof(TimeLimitRun), IsDefaultView = true)]
    39   public partial class TimeLimitRunView : IOptimizerView {
     35  [View("Independent Random Restarter View")]
     36  [Content(typeof(IndepdentRandomRestarter), IsDefaultView = true)]
     37  public partial class IndependentRandomRestarterView : IOptimizerView {
    4038    protected TypeSelectorDialog algorithmTypeSelectorDialog;
    4139    protected virtual bool SuppressEvents { get; set; }
    4240
    43     public new TimeLimitRun Content {
    44       get { return (TimeLimitRun)base.Content; }
     41    public new IndepdentRandomRestarter Content {
     42      get { return (IndepdentRandomRestarter)base.Content; }
    4543      set { base.Content = value; }
    4644    }
    4745
    48     public TimeLimitRunView() {
     46    public IndependentRandomRestarterView() {
    4947      InitializeComponent();
    50       snapshotButton.Text = String.Empty;
    51       snapshotButton.Image = VSImageLibrary.Camera;
     48      terminationComboBox.Items.AddRange(Enum.GetValues(typeof(TerminationCriterium)).Cast<object>().ToArray());
    5249    }
    5350
     
    6259    protected override void DeregisterContentEvents() {
    6360      Content.PropertyChanged -= Content_PropertyChanged;
    64       Content.SnapshotTimes.ItemsAdded -= Content_SnapshotTimes_Changed;
    65       Content.SnapshotTimes.ItemsMoved -= Content_SnapshotTimes_Changed;
    66       Content.SnapshotTimes.ItemsRemoved -= Content_SnapshotTimes_Changed;
    67       Content.SnapshotTimes.ItemsReplaced -= Content_SnapshotTimes_Changed;
    68       Content.SnapshotTimes.CollectionReset -= Content_SnapshotTimes_Changed;
    6961      base.DeregisterContentEvents();
    7062    }
     
    7264      base.RegisterContentEvents();
    7365      Content.PropertyChanged += Content_PropertyChanged;
    74       Content.SnapshotTimes.ItemsAdded += Content_SnapshotTimes_Changed;
    75       Content.SnapshotTimes.ItemsMoved += Content_SnapshotTimes_Changed;
    76       Content.SnapshotTimes.ItemsRemoved += Content_SnapshotTimes_Changed;
    77       Content.SnapshotTimes.ItemsReplaced += Content_SnapshotTimes_Changed;
    78       Content.SnapshotTimes.CollectionReset += Content_SnapshotTimes_Changed;
    7966    }
    8067
     
    8471      try {
    8572        if (Content == null) {
    86           timeLimitTextBox.Text = TimeSpanHelper.FormatNatural(TimeSpan.FromSeconds(60));
    87           snapshotsTextBox.Text = String.Empty;
    88           storeAlgorithmInEachSnapshotCheckBox.Checked = false;
     73          maxExecutionTimeTextBox.Text = String.Empty;
     74          maxEvaluationsTextBox.Text = String.Empty;
     75          moveCostPerSolutionTextBox.Text = String.Empty;
     76          targetValueTextBox.Text = String.Empty;
     77          maximizationCheckBox.CheckState = CheckState.Indeterminate;
     78          terminationComboBox.SelectedIndex = -1;
     79
    8980          algorithmViewHost.Content = null;
    90           snapshotsView.Content = null;
     81          currentRunView.Content = null;
    9182          runsView.Content = null;
    9283        } else {
    93           timeLimitTextBox.Text = TimeSpanHelper.FormatNatural(Content.MaximumExecutionTime);
    94           snapshotsTextBox.Text = String.Join(" ; ", Content.SnapshotTimes.Select(x => TimeSpanHelper.FormatNatural(x, true)));
    95           storeAlgorithmInEachSnapshotCheckBox.Checked = Content.StoreAlgorithmInEachSnapshot;
     84          maxExecutionTimeTextBox.Text = TimeSpanHelper.FormatNatural(Content.MaximumExecutionTime);
     85          maxEvaluationsTextBox.Text = Content.MaximumEvaluations.ToString();
     86          moveCostPerSolutionTextBox.Text = Content.MoveCostPerSolution.ToString(CultureInfo.CurrentCulture.NumberFormat);
     87          targetValueTextBox.Text = Content.TargetValue.ToString(CultureInfo.CurrentCulture.NumberFormat);
     88          maximizationCheckBox.Checked = Content.Maximization;
     89          terminationComboBox.SelectedItem = Content.TerminationCriterium;
     90
    9691          algorithmViewHost.Content = Content.Algorithm;
    97           snapshotsView.Content = Content.Snapshots;
     92          currentRunView.Content = Content.CurrentRun;
    9893          runsView.Content = Content.Runs;
    9994        }
     
    10398    protected override void SetEnabledStateOfControls() {
    10499      base.SetEnabledStateOfControls();
    105       timeLimitTextBox.Enabled = Content != null && !ReadOnly;
    106       snapshotsTextBox.Enabled = Content != null && !ReadOnly;
    107       storeAlgorithmInEachSnapshotCheckBox.Enabled = Content != null && !ReadOnly;
     100      maxExecutionTimeTextBox.Enabled = Content != null && !ReadOnly && !Locked;
     101      maxEvaluationsTextBox.Enabled = Content != null && !ReadOnly && !Locked;
     102      moveCostPerSolutionTextBox.Enabled = Content != null && !ReadOnly && !Locked;
     103      targetValueTextBox.Enabled = Content != null && !ReadOnly && !Locked;
     104      maximizationCheckBox.Enabled = Content != null && !ReadOnly && !Locked;
     105      terminationComboBox.Enabled = Content != null && !ReadOnly && !Locked;
    108106      newAlgorithmButton.Enabled = Content != null && !ReadOnly;
    109107      openAlgorithmButton.Enabled = Content != null && !ReadOnly;
    110108      algorithmViewHost.Enabled = Content != null;
    111       snapshotsView.Enabled = Content != null;
     109      currentRunView.Enabled = Content != null;
    112110      runsView.Enabled = Content != null;
    113     }
    114 
    115     protected override void SetEnabledStateOfExecutableButtons() {
    116       base.SetEnabledStateOfExecutableButtons();
    117       snapshotButton.Enabled = Content != null && Content.Algorithm != null && Content.ExecutionState == ExecutionState.Paused;
    118111    }
    119112
     
    133126    #region Content events
    134127    private void Content_PropertyChanged(object sender, PropertyChangedEventArgs e) {
    135       switch (e.PropertyName) {
    136         case "MaximumExecutionTime":
    137           SuppressEvents = true;
    138           try {
    139             timeLimitTextBox.Text = TimeSpanHelper.FormatNatural(Content.MaximumExecutionTime);
    140           } finally { SuppressEvents = false; }
    141           break;
    142         case "SnapshotTimes":
    143           SuppressEvents = true;
    144           try {
    145             if (Content.SnapshotTimes.Any())
    146               snapshotsTextBox.Text = String.Join(" ; ", Content.SnapshotTimes.Select(x => TimeSpanHelper.FormatNatural(x, true)));
    147             else snapshotsTextBox.Text = String.Empty;
    148             Content.SnapshotTimes.ItemsAdded += Content_SnapshotTimes_Changed;
    149             Content.SnapshotTimes.ItemsMoved += Content_SnapshotTimes_Changed;
    150             Content.SnapshotTimes.ItemsRemoved += Content_SnapshotTimes_Changed;
    151             Content.SnapshotTimes.ItemsReplaced += Content_SnapshotTimes_Changed;
    152             Content.SnapshotTimes.CollectionReset += Content_SnapshotTimes_Changed;
    153           } finally { SuppressEvents = false; }
    154           break;
    155         case "StoreAlgorithmInEachSnapshot":
    156           SuppressEvents = true;
    157           try {
    158             storeAlgorithmInEachSnapshotCheckBox.Checked = Content.StoreAlgorithmInEachSnapshot;
    159           } finally { SuppressEvents = false; }
    160           break;
    161         case "Algorithm":
    162           SuppressEvents = true;
    163           try {
    164             algorithmViewHost.Content = Content.Algorithm;
    165           } finally { SuppressEvents = false; }
    166           break;
    167         case "Snapshots":
    168           SuppressEvents = true;
    169           try {
    170             snapshotsView.Content = Content.Snapshots;
    171           } finally { SuppressEvents = false; }
    172           break;
    173         case "Runs":
    174           SuppressEvents = true;
    175           try {
    176             runsView.Content = Content.Runs;
    177           } finally { SuppressEvents = false; }
    178           break;
    179       }
    180     }
    181 
    182     private void Content_SnapshotTimes_Changed(object sender, EventArgs e) {
    183128      SuppressEvents = true;
    184129      try {
    185         if (Content.SnapshotTimes.Any())
    186           snapshotsTextBox.Text = string.Join(" ; ", Content.SnapshotTimes.Select(x => TimeSpanHelper.FormatNatural(x, true)));
    187         else snapshotsTextBox.Text = String.Empty;
     130        switch (e.PropertyName) {
     131          case "TerminationCriterium": terminationComboBox.SelectedItem = Content.TerminationCriterium; break;
     132          case "MaximumExecutionTime": maxExecutionTimeTextBox.Text = TimeSpanHelper.FormatNatural(Content.MaximumExecutionTime); break;
     133          case "MaximumEvaluations": maxEvaluationsTextBox.Text = Content.MaximumEvaluations.ToString(); break;
     134          case "TargetValue": targetValueTextBox.Text = Content.TargetValue.ToString(CultureInfo.CurrentCulture.NumberFormat); break;
     135          case "Maximization": maximizationCheckBox.Checked = Content.Maximization; break;
     136          case "MoveCostPerSolution": moveCostPerSolutionTextBox.Text = Content.MoveCostPerSolution.ToString(CultureInfo.CurrentCulture.NumberFormat); break;
     137          case "Algorithm": algorithmViewHost.Content = Content.Algorithm; break;
     138          case "CurrentRun": currentRunView.Content = Content.CurrentRun; break;
     139          case "Runs": runsView.Content = Content.Runs; break;
     140        }
    188141      } finally { SuppressEvents = false; }
    189142    }
     
    191144
    192145    #region Control events
    193     private void timeLimitTextBox_Validating(object sender, CancelEventArgs e) {
    194       if (SuppressEvents) return;
     146    private void maxExecutionTimeTextBox_Validating(object sender, CancelEventArgs e) {
     147      if (SuppressEvents) return;
     148      if (InvokeRequired) {
     149        Invoke((Action<object, CancelEventArgs>)maxExecutionTimeTextBox_Validating, sender, e);
     150        return;
     151      }
    195152      TimeSpan ts;
    196       if (!TimeSpanHelper.TryGetFromNaturalFormat(timeLimitTextBox.Text, out ts)) {
    197         e.Cancel = !timeLimitTextBox.ReadOnly && timeLimitTextBox.Enabled;
    198         errorProvider.SetError(timeLimitTextBox, "Please enter a valid time span, e.g. 20 seconds ; 45s ; 4min ; 1h ; 3 hours ; 2 days ; 4d");
     153      if (!TimeSpanHelper.TryGetFromNaturalFormat(maxExecutionTimeTextBox.Text, out ts)) {
     154        e.Cancel = !maxExecutionTimeTextBox.ReadOnly && maxExecutionTimeTextBox.Enabled;
     155        errorProvider.SetError(maxExecutionTimeTextBox, "Please enter a valid time span, e.g. 20 seconds ; 45s ; 4min ; 1h ; 3 hours ; 2 days ; 4d");
    199156      } else {
    200157        Content.MaximumExecutionTime = ts;
    201158        e.Cancel = false;
    202         errorProvider.SetError(timeLimitTextBox, null);
    203       }
    204     }
    205 
    206     private void snapshotsTextBox_Validating(object sender, CancelEventArgs e) {
    207       if (SuppressEvents) return;
    208       e.Cancel = false;
    209       errorProvider.SetError(snapshotsTextBox, null);
    210 
    211       var snapshotTimes = new ObservableList<TimeSpan>();
    212       var matches = Regex.Matches(snapshotsTextBox.Text, @"(\d+[ ;,\t]*\w+)");
    213       foreach (Match m in matches) {
    214         TimeSpan value;
    215         if (!TimeSpanHelper.TryGetFromNaturalFormat(m.Value, out value)) {
    216           e.Cancel = !snapshotsTextBox.ReadOnly && snapshotsTextBox.Enabled; // don't cancel an operation that cannot be edited
    217           errorProvider.SetError(snapshotsTextBox, "Error parsing " + m.Value + ", please provide a valid time span, e.g. 20 seconds ; 45s ; 4min ; 1h ; 3 hours ; 2 days ; 4d");
    218           return;
    219         } else {
    220           snapshotTimes.Add(value);
    221         }
    222       }
    223       Content.SnapshotTimes = snapshotTimes;
    224     }
    225 
    226     private void storeAlgorithmInEachSnapshotCheckBox_CheckedChanged(object sender, EventArgs e) {
    227       if (SuppressEvents) return;
    228       SuppressEvents = true;
    229       try {
    230         Content.StoreAlgorithmInEachSnapshot = storeAlgorithmInEachSnapshotCheckBox.Checked;
    231       } finally { SuppressEvents = false; }
     159        errorProvider.SetError(maxExecutionTimeTextBox, null);
     160      }
     161    }
     162
     163    private void maxEvaluationsTextBox_Validating(object sender, CancelEventArgs e) {
     164      if (SuppressEvents) return;
     165      if (InvokeRequired) {
     166        Invoke((Action<object, CancelEventArgs>)maxEvaluationsTextBox_Validating, sender, e);
     167        return;
     168      }
     169      int value;
     170      if (!int.TryParse(maxEvaluationsTextBox.Text, out value)) {
     171        e.Cancel = !maxEvaluationsTextBox.ReadOnly && maxEvaluationsTextBox.Enabled;
     172        errorProvider.SetError(maxEvaluationsTextBox, "Please enter a valid integer number.");
     173      } else {
     174        Content.MaximumEvaluations = value;
     175        e.Cancel = false;
     176        errorProvider.SetError(maxEvaluationsTextBox, null);
     177      }
     178    }
     179
     180    private void moveCostPerSolutionTextBox_Validating(object sender, CancelEventArgs e) {
     181      if (SuppressEvents) return;
     182      if (InvokeRequired) {
     183        Invoke((Action<object, CancelEventArgs>)moveCostPerSolutionTextBox_Validating, sender, e);
     184        return;
     185      }
     186      double value;
     187      if (!double.TryParse(moveCostPerSolutionTextBox.Text, out value)) {
     188        e.Cancel = !moveCostPerSolutionTextBox.ReadOnly && moveCostPerSolutionTextBox.Enabled;
     189        errorProvider.SetError(moveCostPerSolutionTextBox, "Please enter a valid integer number.");
     190      } else {
     191        Content.MoveCostPerSolution = value;
     192        e.Cancel = false;
     193        errorProvider.SetError(moveCostPerSolutionTextBox, null);
     194      }
     195    }
     196
     197    private void targetValueTextBox_Validating(object sender, CancelEventArgs e) {
     198      if (SuppressEvents) return;
     199      if (InvokeRequired) {
     200        Invoke((Action<object, CancelEventArgs>)targetValueTextBox_Validating, sender, e);
     201        return;
     202      }
     203      double value;
     204      if (!double.TryParse(targetValueTextBox.Text, out value)) {
     205        e.Cancel = !targetValueTextBox.ReadOnly && targetValueTextBox.Enabled;
     206        errorProvider.SetError(targetValueTextBox, "Please enter a valid integer number.");
     207      } else {
     208        Content.TargetValue = value;
     209        e.Cancel = false;
     210        errorProvider.SetError(targetValueTextBox, null);
     211      }
     212    }
     213
     214    private void maximizationCheckBox_CheckedChanged(object sender, EventArgs e) {
     215      if (SuppressEvents) return;
     216      if (InvokeRequired) {
     217        Invoke((Action<object, EventArgs>)maximizationCheckBox_CheckedChanged, sender, e);
     218        return;
     219      }
     220      Content.Maximization = maximizationCheckBox.Checked;
     221    }
     222
     223    private void terminationComboBox_SelectedIndexChanged(object sender, EventArgs e) {
     224      if (SuppressEvents) return;
     225      if (InvokeRequired) {
     226        Invoke((Action<object, EventArgs>)terminationComboBox_SelectedIndexChanged, sender, e);
     227        return;
     228      }
     229      Content.TerminationCriterium = (TerminationCriterium)terminationComboBox.SelectedItem;
    232230    }
    233231
     
    236234        algorithmTypeSelectorDialog = new TypeSelectorDialog { Caption = "Select Algorithm" };
    237235        algorithmTypeSelectorDialog.TypeSelector.Caption = "Available Algorithms";
    238         algorithmTypeSelectorDialog.TypeSelector.Configure(typeof(IAlgorithm), false, true);
     236        algorithmTypeSelectorDialog.TypeSelector.Configure(typeof(IAlgorithm)
     237          , showNotInstantiableTypes: false, showGenericTypes: false);
    239238      }
    240239      if (algorithmTypeSelectorDialog.ShowDialog(this) == DialogResult.OK) {
     
    275274    private void algorithmTabPage_DragEnterOver(object sender, DragEventArgs e) {
    276275      e.Effect = DragDropEffects.None;
    277       if (!ReadOnly && (e.Data.GetData(Constants.DragDropDataFormat) is IAlgorithm)) {
     276      var alg = e.Data.GetData(Constants.DragDropDataFormat) as IAlgorithm;
     277      if (!ReadOnly && alg != null) {
     278        if (!typeof(ISingleObjectiveHeuristicOptimizationProblem).IsAssignableFrom(alg.ProblemType))
     279          return;
    278280        if ((e.KeyState & 32) == 32) e.Effect = DragDropEffects.Link;  // ALT key
    279281        else if ((e.KeyState & 4) == 4) e.Effect = DragDropEffects.Move;  // SHIFT key
     
    291293      }
    292294    }
    293 
    294     private void snapshotButton_Click(object sender, EventArgs e) {
    295       Content.Snapshot();
    296     }
    297 
    298     private void sequenceButton_Click(object sender, EventArgs e) {
    299       using (var dialog = new DefineArithmeticTimeSpanProgressionDialog(TimeSpan.FromSeconds(1), Content.MaximumExecutionTime, TimeSpan.FromSeconds(1))) {
    300         if (dialog.ShowDialog() == DialogResult.OK) {
    301           if (dialog.Values.Any())
    302             Content.SnapshotTimes = new ObservableList<TimeSpan>(dialog.Values);
    303           else Content.SnapshotTimes = new ObservableList<TimeSpan>();
    304         }
    305       }
    306     }
    307295    #endregion
    308296    #endregion
  • branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionRLDView.Designer.cs

    r12803 r12804  
    4444    /// </summary>
    4545    private void InitializeComponent() {
     46      this.components = new System.ComponentModel.Container();
    4647      this.dataTableComboBox = new System.Windows.Forms.ComboBox();
    4748      this.label1 = new System.Windows.Forms.Label();
     
    5051      this.groupComboBox = new System.Windows.Forms.ComboBox();
    5152      this.logScalingCheckBox = new System.Windows.Forms.CheckBox();
     53      this.targetsTextBox = new System.Windows.Forms.TextBox();
     54      this.label3 = new System.Windows.Forms.Label();
     55      this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components);
     56      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    5257      this.SuspendLayout();
    5358      //
     
    8186      this.viewHost.Content = null;
    8287      this.viewHost.Enabled = false;
    83       this.viewHost.Location = new System.Drawing.Point(4, 57);
     88      this.viewHost.Location = new System.Drawing.Point(4, 90);
    8489      this.viewHost.Name = "viewHost";
    8590      this.viewHost.ReadOnly = false;
    86       this.viewHost.Size = new System.Drawing.Size(520, 291);
     91      this.viewHost.Size = new System.Drawing.Size(520, 258);
    8792      this.viewHost.TabIndex = 2;
    8893      this.viewHost.ViewsLabelVisible = true;
     
    122127      this.logScalingCheckBox.CheckedChanged += new System.EventHandler(this.logScalingCheckBox_CheckedChanged);
    123128      //
    124       // RunCollectionECDFView
     129      // targetsTextBox
     130      //
     131      this.targetsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     132            | System.Windows.Forms.AnchorStyles.Right)));
     133      this.targetsTextBox.Location = new System.Drawing.Point(69, 57);
     134      this.targetsTextBox.Name = "targetsTextBox";
     135      this.targetsTextBox.Size = new System.Drawing.Size(455, 20);
     136      this.targetsTextBox.TabIndex = 6;
     137      this.targetsTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.targetsTextBox_Validating);
     138      //
     139      // label3
     140      //
     141      this.label3.AutoSize = true;
     142      this.label3.Location = new System.Drawing.Point(3, 60);
     143      this.label3.Name = "label3";
     144      this.label3.Size = new System.Drawing.Size(46, 13);
     145      this.label3.TabIndex = 1;
     146      this.label3.Text = "Targets:";
     147      //
     148      // errorProvider
     149      //
     150      this.errorProvider.ContainerControl = this;
     151      //
     152      // RunCollectionRLDView
    125153      //
    126154      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
     155      this.Controls.Add(this.targetsTextBox);
    127156      this.Controls.Add(this.logScalingCheckBox);
    128157      this.Controls.Add(this.groupComboBox);
    129158      this.Controls.Add(this.label2);
    130159      this.Controls.Add(this.viewHost);
     160      this.Controls.Add(this.label3);
    131161      this.Controls.Add(this.label1);
    132162      this.Controls.Add(this.dataTableComboBox);
    133       this.Name = "RunCollectionECDFView";
     163      this.Name = "RunCollectionRLDView";
    134164      this.Size = new System.Drawing.Size(527, 374);
     165      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    135166      this.ResumeLayout(false);
    136167      this.PerformLayout();
     
    146177    private System.Windows.Forms.ComboBox groupComboBox;
    147178    private System.Windows.Forms.CheckBox logScalingCheckBox;
     179    private System.Windows.Forms.TextBox targetsTextBox;
     180    private System.Windows.Forms.Label label3;
     181    protected System.Windows.Forms.ErrorProvider errorProvider;
    148182  }
    149183}
  • branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionRLDView.cs

    r12803 r12804  
    4242    }
    4343
     44    private double[] levels;
     45
    4446    private bool suppressUpdates;
    4547    private readonly IndexedDataTable<double> combinedDataTable;
     
    167169        var table = (string)dataTableComboBox.SelectedItem;
    168170        if (string.IsNullOrEmpty(table)) return;
    169         var maximum = Content.Select(x => ((IndexedDataTable<double>)x.Results[table]).Rows.First().Values.Max(y => y.Item2)).Max();
    170         var minimum = Content.Select(x => ((IndexedDataTable<double>)x.Results[table]).Rows.First().Values.Min(y => y.Item2)).Min();
    171         var levels = Enumerable.Range(0, 51).Select(x => maximum - (x / 50.0) * (maximum - minimum)).ToArray();
     171        if (levels == null) {
     172          var worst = Content.Select(x => ((IndexedDataTable<double>)x.Results[table]).Rows.First().Values.Max(y => y.Item2)).First();
     173          var best = Content.Select(x => ((IndexedDataTable<double>)x.Results[table]).Rows.First().Values.Min(y => y.Item2)).Last();
     174          levels = Enumerable.Range(0, 51).Select(x => worst + (x / 50.0) * (best - worst)).ToArray();
     175          suppressTargetsEvents = true;
     176          targetsTextBox.Text = string.Join(" ; ", levels);
     177          suppressTargetsEvents = false;
     178        }
    172179        var selectedGroup = (string)groupComboBox.SelectedItem;
    173180        if (string.IsNullOrEmpty(selectedGroup)) return;
     
    184191            var resultsTable = (IndexedDataTable<double>)run.Results[table];
    185192            xAxisTitles.Add(resultsTable.VisualProperties.XAxisTitle);
    186             var graph = new LinkedList<Tuple<double, double>>(resultsTable.Rows.First().Values);
    187             var current = graph.First.Next;
    188             // prune convergence graph to obtain first hit times only
    189             while (current != null) {
    190               if (current.Value.Item2.IsAlmost(current.Previous.Value.Item2)) {
    191                 var h = current;
    192                 current = current.Previous;
    193                 graph.Remove(h);
    194               }
    195               current = current.Next;
    196             }
     193            var values = resultsTable.Rows.First().Values;
     194            var maximization = values.First().Item2 < values.Last().Item2;
    197195            var i = 0;
    198             current = graph.First;
    199             while (i < levels.Length && current != null) {
    200               if (current.Value.Item2 < levels[i]) {
    201                 if (hits.ContainsKey(current.Value.Item1))
    202                   hits[current.Value.Item1]++;
    203                 else hits[current.Value.Item1] = 1;
     196            var j = 0;
     197            var current = values[j];
     198            var prev = Tuple.Create(-1.0, double.NaN);
     199            while (i < levels.Length) {
     200              if ((double.IsNaN(prev.Item2) || prev.Item2 != current.Item2)
     201                  && (maximization && current.Item2 >= levels[i]
     202                  || !maximization && current.Item2 <= levels[i])) {
     203                if (hits.ContainsKey(current.Item1))
     204                  hits[current.Item1]++;
     205                else hits[current.Item1] = 1;
    204206                i++;
    205207              } else {
    206                 current = current.Next;
     208                j++;
     209                if (j >= values.Count) break;
     210                prev = current;
     211                current = values[j];
    207212              }
    208213            }
     
    266271      combinedDataTable.VisualProperties.XAxisLogScale = logScalingCheckBox.Checked;
    267272    }
     273
     274    private bool suppressTargetsEvents;
     275    private void targetsTextBox_Validating(object sender, CancelEventArgs e) {
     276      if (suppressTargetsEvents) return;
     277      var targetStrings = targetsTextBox.Text.Split(new[] { ';', '\t', ' ' }, StringSplitOptions.RemoveEmptyEntries);
     278      var targetList = new List<double>();
     279      foreach (var ts in targetStrings) {
     280        double t;
     281        if (!double.TryParse(ts, out t)) {
     282          errorProvider.SetError(targetsTextBox, "Not all targets can be parsed: " + ts);
     283          e.Cancel = true;
     284          return;
     285        }
     286        targetList.Add(t);
     287      }
     288      if (targetList.Count == 0) {
     289        errorProvider.SetError(targetsTextBox, "Give at least one target value!");
     290        e.Cancel = true;
     291        return;
     292      }
     293      e.Cancel = false;
     294      errorProvider.SetError(targetsTextBox, null);
     295      levels = targetList.ToArray();
     296    }
    268297  }
    269298}
  • branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/RunView.cs

    r12012 r12804  
    9797
    9898    private void Content_PropertyChanged(object sender, PropertyChangedEventArgs e) {
     99      if (InvokeRequired) {
     100        Invoke((Action<object, PropertyChangedEventArgs>)Content_PropertyChanged, sender, e);
     101        return;
     102      }
    99103      if (e.PropertyName == "Color") {
    100104        if (InvokeRequired) this.Invoke((Action)UpdateColor, null);
     
    112116
    113117    private void ParametersOnItemsChanged(object sender, CollectionItemsChangedEventArgs<KeyValuePair<string, IItem>> e) {
     118      if (InvokeRequired) {
     119        Invoke((Action<object, CollectionItemsChangedEventArgs<KeyValuePair<string, IItem>>>)ParametersOnItemsChanged, sender, e);
     120        return;
     121      }
    114122      foreach (var item in e.OldItems) {
    115123        listView.Items.Remove(parametersItemToListViewItem[item.Key]);
     
    124132
    125133    private void ParametersOnItemsRemoved(object sender, CollectionItemsChangedEventArgs<KeyValuePair<string, IItem>> e) {
     134      if (InvokeRequired) {
     135        Invoke((Action<object, CollectionItemsChangedEventArgs<KeyValuePair<string, IItem>>>)ParametersOnItemsRemoved, sender, e);
     136        return;
     137      }
    126138      foreach (var item in e.Items) {
    127139        listView.Items.Remove(parametersItemToListViewItem[item.Key]);
     
    131143
    132144    private void ResultsOnItemsChanged(object sender, CollectionItemsChangedEventArgs<KeyValuePair<string, IItem>> e) {
     145      if (InvokeRequired) {
     146        Invoke((Action<object, CollectionItemsChangedEventArgs<KeyValuePair<string, IItem>>>)ResultsOnItemsChanged, sender, e);
     147        return;
     148      }
    133149      foreach (var item in e.OldItems) {
    134150        listView.Items.Remove(resultsItemToListViewItem[item.Key]);
     
    143159
    144160    private void ResultsOnItemsRemoved(object sender, CollectionItemsChangedEventArgs<KeyValuePair<string, IItem>> e) {
     161      if (InvokeRequired) {
     162        Invoke((Action<object, CollectionItemsChangedEventArgs<KeyValuePair<string, IItem>>>)ResultsOnItemsRemoved, sender, e);
     163        return;
     164      }
    145165      foreach (var item in e.Items) {
    146166        listView.Items.Remove(resultsItemToListViewItem[item.Key]);
Note: See TracChangeset for help on using the changeset viewer.