Changeset 6934
- Timestamp:
- 10/18/11 15:08:14 (13 years ago)
- Location:
- branches/Benchmarking/sources
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks.Views/3.3/BenchmarkView.Designer.cs
r6920 r6934 25 25 /// Required designer variable. 26 26 /// </summary> 27 private System.ComponentModel.IContainer components = null;28 27 29 28 #region Component Designer generated code … … 34 33 /// </summary> 35 34 private void InitializeComponent() { 36 //System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AlgorithmView));37 //this.tabControl = new HeuristicLab.MainForm.WindowsForms.DragOverTabControl();38 //this.problemTabPage = new System.Windows.Forms.TabPage();39 //this.problemViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();40 //this.openProblemButton = new System.Windows.Forms.Button();41 //this.newProblemButton = new System.Windows.Forms.Button();42 //this.parametersTabPage = new System.Windows.Forms.TabPage();43 //this.parameterCollectionView = new HeuristicLab.Core.Views.ParameterCollectionView();44 //this.resultsTabPage = new System.Windows.Forms.TabPage();45 //this.resultsView = new HeuristicLab.Optimization.Views.ResultCollectionView();46 //this.runsTabPage = new System.Windows.Forms.TabPage();47 //this.storeAlgorithmInEachRunCheckBox = new System.Windows.Forms.CheckBox();48 //this.runsView = new HeuristicLab.Optimization.Views.RunCollectionView();49 //this.openFileDialog = new System.Windows.Forms.OpenFileDialog();50 //((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();51 //this.tabControl.SuspendLayout();52 //this.problemTabPage.SuspendLayout();53 //this.parametersTabPage.SuspendLayout();54 //this.resultsTabPage.SuspendLayout();55 //this.runsTabPage.SuspendLayout();56 //this.SuspendLayout();57 ////58 //// startButton59 ////60 //this.startButton.Location = new System.Drawing.Point(0, 458);61 //this.toolTip.SetToolTip(this.startButton, "Start/Resume Experiment");62 ////63 //// executionTimeTextBox64 ////65 //this.executionTimeTextBox.Location = new System.Drawing.Point(542, 462);66 ////67 //// executionTimeLabel68 ////69 //this.executionTimeLabel.Location = new System.Drawing.Point(453, 465);70 ////71 //// pauseButton72 ////73 //this.pauseButton.Location = new System.Drawing.Point(30, 458);74 //this.toolTip.SetToolTip(this.pauseButton, "Pause Experiment");75 ////76 //// stopButton77 ////78 //this.stopButton.Location = new System.Drawing.Point(60, 458);79 //this.toolTip.SetToolTip(this.stopButton, "Stop Experiment");80 ////81 //// resetButton82 ////83 //this.resetButton.Location = new System.Drawing.Point(90, 458);84 //this.toolTip.SetToolTip(this.resetButton, "Reset Experiment");85 ////86 //// nameTextBox87 ////88 //this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);89 //this.errorProvider.SetIconPadding(this.nameTextBox, 2);90 //this.nameTextBox.Location = new System.Drawing.Point(60, 0);91 //this.nameTextBox.Size = new System.Drawing.Size(594, 20);92 ////93 //// infoLabel94 ////95 //this.infoLabel.Location = new System.Drawing.Point(660, 3);96 ////97 //// tabControl98 ////99 //this.tabControl.AllowDrop = true;100 //this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)101 // | System.Windows.Forms.AnchorStyles.Left)102 // | System.Windows.Forms.AnchorStyles.Right)));103 //this.tabControl.Controls.Add(this.problemTabPage);104 //this.tabControl.Controls.Add(this.parametersTabPage);105 //this.tabControl.Controls.Add(this.resultsTabPage);106 //this.tabControl.Controls.Add(this.runsTabPage);107 //this.tabControl.Location = new System.Drawing.Point(0, 26);108 //this.tabControl.Name = "tabControl";109 //this.tabControl.SelectedIndex = 0;110 //this.tabControl.Size = new System.Drawing.Size(679, 430);111 //this.tabControl.TabIndex = 3;112 ////113 //// problemTabPage114 ////115 //this.problemTabPage.AllowDrop = true;116 //this.problemTabPage.Controls.Add(this.problemViewHost);117 //this.problemTabPage.Controls.Add(this.openProblemButton);118 //this.problemTabPage.Controls.Add(this.newProblemButton);119 //this.problemTabPage.Location = new System.Drawing.Point(4, 22);120 //this.problemTabPage.Name = "problemTabPage";121 //this.problemTabPage.Padding = new System.Windows.Forms.Padding(3);122 //this.problemTabPage.Size = new System.Drawing.Size(671, 404);123 //this.problemTabPage.TabIndex = 0;124 //this.problemTabPage.Text = "Problem";125 //this.problemTabPage.UseVisualStyleBackColor = true;126 //this.problemTabPage.DragDrop += new System.Windows.Forms.DragEventHandler(this.problemTabPage_DragDrop);127 //this.problemTabPage.DragEnter += new System.Windows.Forms.DragEventHandler(this.problemTabPage_DragEnterOver);128 //this.problemTabPage.DragOver += new System.Windows.Forms.DragEventHandler(this.problemTabPage_DragEnterOver);129 ////130 //// problemViewHost131 ////132 //this.problemViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)133 // | System.Windows.Forms.AnchorStyles.Left)134 // | System.Windows.Forms.AnchorStyles.Right)));135 //this.problemViewHost.Caption = "View";136 //this.problemViewHost.Content = null;137 //this.problemViewHost.Enabled = false;138 //this.problemViewHost.Location = new System.Drawing.Point(6, 36);139 //this.problemViewHost.Name = "problemViewHost";140 //this.problemViewHost.ReadOnly = false;141 //this.problemViewHost.Size = new System.Drawing.Size(659, 362);142 //this.problemViewHost.TabIndex = 3;143 //this.problemViewHost.ViewsLabelVisible = true;144 //this.problemViewHost.ViewType = null;145 ////146 //// openProblemButton147 ////148 //this.openProblemButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Open;149 //this.openProblemButton.Location = new System.Drawing.Point(36, 6);150 //this.openProblemButton.Name = "openProblemButton";151 //this.openProblemButton.Size = new System.Drawing.Size(24, 24);152 //this.openProblemButton.TabIndex = 1;153 //this.toolTip.SetToolTip(this.openProblemButton, "Open Problem");154 //this.openProblemButton.UseVisualStyleBackColor = true;155 //this.openProblemButton.Click += new System.EventHandler(this.openProblemButton_Click);156 ////157 //// newProblemButton158 ////159 //this.newProblemButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.NewDocument;160 //this.newProblemButton.Location = new System.Drawing.Point(6, 6);161 //this.newProblemButton.Name = "newProblemButton";162 //this.newProblemButton.Size = new System.Drawing.Size(24, 24);163 //this.newProblemButton.TabIndex = 0;164 //this.toolTip.SetToolTip(this.newProblemButton, "New Problem");165 //this.newProblemButton.UseVisualStyleBackColor = true;166 //this.newProblemButton.Click += new System.EventHandler(this.newProblemButton_Click);167 ////168 //// parametersTabPage169 ////170 //this.parametersTabPage.Controls.Add(this.parameterCollectionView);171 //this.parametersTabPage.Location = new System.Drawing.Point(4, 22);172 //this.parametersTabPage.Name = "parametersTabPage";173 //this.parametersTabPage.Padding = new System.Windows.Forms.Padding(3);174 //this.parametersTabPage.Size = new System.Drawing.Size(671, 400);175 //this.parametersTabPage.TabIndex = 1;176 //this.parametersTabPage.Text = "Parameters";177 //this.parametersTabPage.UseVisualStyleBackColor = true;178 ////179 //// parameterCollectionView180 ////181 //this.parameterCollectionView.AllowEditingOfHiddenParameters = true;182 //this.parameterCollectionView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)183 // | System.Windows.Forms.AnchorStyles.Left)184 // | System.Windows.Forms.AnchorStyles.Right)));185 //this.parameterCollectionView.Caption = "ParameterCollection View";186 //this.parameterCollectionView.Content = null;187 //this.parameterCollectionView.Location = new System.Drawing.Point(6, 6);188 //this.parameterCollectionView.Name = "parameterCollectionView";189 //this.parameterCollectionView.ReadOnly = false;190 //this.parameterCollectionView.Size = new System.Drawing.Size(659, 388);191 //this.parameterCollectionView.TabIndex = 0;192 ////193 //// resultsTabPage194 ////195 //this.resultsTabPage.Controls.Add(this.resultsView);196 //this.resultsTabPage.Location = new System.Drawing.Point(4, 22);197 //this.resultsTabPage.Name = "resultsTabPage";198 //this.resultsTabPage.Padding = new System.Windows.Forms.Padding(3);199 //this.resultsTabPage.Size = new System.Drawing.Size(671, 400);200 //this.resultsTabPage.TabIndex = 2;201 //this.resultsTabPage.Text = "Results";202 //this.resultsTabPage.UseVisualStyleBackColor = true;203 ////204 //// resultsView205 ////206 //this.resultsView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)207 // | System.Windows.Forms.AnchorStyles.Left)208 // | System.Windows.Forms.AnchorStyles.Right)));209 //this.resultsView.Caption = "ResultCollection View";210 //this.resultsView.Content = null;211 //this.resultsView.Location = new System.Drawing.Point(6, 6);212 //this.resultsView.Name = "resultsView";213 //this.resultsView.ReadOnly = true;214 //this.resultsView.Size = new System.Drawing.Size(659, 388);215 //this.resultsView.TabIndex = 0;216 ////217 //// runsTabPage218 ////219 //this.runsTabPage.Controls.Add(this.storeAlgorithmInEachRunCheckBox);220 //this.runsTabPage.Controls.Add(this.runsView);221 //this.runsTabPage.Location = new System.Drawing.Point(4, 22);222 //this.runsTabPage.Name = "runsTabPage";223 //this.runsTabPage.Padding = new System.Windows.Forms.Padding(3);224 //this.runsTabPage.Size = new System.Drawing.Size(671, 400);225 //this.runsTabPage.TabIndex = 3;226 //this.runsTabPage.Text = "Runs";227 //this.runsTabPage.UseVisualStyleBackColor = true;228 ////229 //// storeAlgorithmInEachRunCheckBox230 ////231 //this.storeAlgorithmInEachRunCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));232 //this.storeAlgorithmInEachRunCheckBox.AutoSize = true;233 //this.storeAlgorithmInEachRunCheckBox.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;234 //this.storeAlgorithmInEachRunCheckBox.Checked = true;235 //this.storeAlgorithmInEachRunCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;236 //this.storeAlgorithmInEachRunCheckBox.Location = new System.Drawing.Point(503, 6);237 //this.storeAlgorithmInEachRunCheckBox.Name = "storeAlgorithmInEachRunCheckBox";238 //this.storeAlgorithmInEachRunCheckBox.Size = new System.Drawing.Size(161, 17);239 //this.storeAlgorithmInEachRunCheckBox.TabIndex = 1;240 //this.storeAlgorithmInEachRunCheckBox.Text = "&Store Algorithm in each Run:";241 //this.toolTip.SetToolTip(this.storeAlgorithmInEachRunCheckBox, "Check to store a copy of the algorithm in each run.");242 //this.storeAlgorithmInEachRunCheckBox.UseVisualStyleBackColor = true;243 //this.storeAlgorithmInEachRunCheckBox.CheckedChanged += new System.EventHandler(this.storeAlgorithmInEachRunCheckBox_CheckedChanged);244 ////245 //// runsView246 ////247 //this.runsView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)248 // | System.Windows.Forms.AnchorStyles.Left)249 // | System.Windows.Forms.AnchorStyles.Right)));250 //this.runsView.Caption = "RunCollection View";251 //this.runsView.Content = null;252 //this.runsView.Location = new System.Drawing.Point(6, 6);253 //this.runsView.Name = "runsView";254 //this.runsView.ReadOnly = false;255 //this.runsView.Size = new System.Drawing.Size(659, 388);256 //this.runsView.TabIndex = 0;257 ////258 //// openFileDialog259 ////260 //this.openFileDialog.DefaultExt = "hl";261 //this.openFileDialog.FileName = "Problem";262 //this.openFileDialog.Filter = "HeuristicLab Files|*.hl|All Files|*.*";263 //this.openFileDialog.Title = "Open Problem";264 ////265 //// AlgorithmView266 ////267 //this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);268 //this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;269 //this.Controls.Add(this.tabControl);270 //this.Name = "AlgorithmView";271 //this.Size = new System.Drawing.Size(679, 482);272 //this.Controls.SetChildIndex(this.executionTimeLabel, 0);273 //this.Controls.SetChildIndex(this.executionTimeTextBox, 0);274 //this.Controls.SetChildIndex(this.resetButton, 0);275 //this.Controls.SetChildIndex(this.tabControl, 0);276 //this.Controls.SetChildIndex(this.stopButton, 0);277 //this.Controls.SetChildIndex(this.pauseButton, 0);278 //this.Controls.SetChildIndex(this.startButton, 0);279 //this.Controls.SetChildIndex(this.infoLabel, 0);280 //this.Controls.SetChildIndex(this.nameLabel, 0);281 //this.Controls.SetChildIndex(this.nameTextBox, 0);282 //((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();283 //this.tabControl.ResumeLayout(false);284 //this.problemTabPage.ResumeLayout(false);285 //this.parametersTabPage.ResumeLayout(false);286 //this.resultsTabPage.ResumeLayout(false);287 //this.runsTabPage.ResumeLayout(false);288 //this.runsTabPage.PerformLayout();289 //this.ResumeLayout(false);290 //this.PerformLayout();291 35 292 36 } 293 37 294 38 #endregion 295 296 //protected HeuristicLab.MainForm.WindowsForms.DragOverTabControl tabControl;297 //protected System.Windows.Forms.TabPage parametersTabPage;298 //protected System.Windows.Forms.TabPage problemTabPage;299 //protected HeuristicLab.Core.Views.ParameterCollectionView parameterCollectionView;300 //protected HeuristicLab.MainForm.WindowsForms.ViewHost problemViewHost;301 //protected System.Windows.Forms.Button newProblemButton;302 //protected System.Windows.Forms.Button openProblemButton;303 //protected System.Windows.Forms.OpenFileDialog openFileDialog;304 //protected System.Windows.Forms.TabPage resultsTabPage;305 //protected HeuristicLab.Optimization.Views.ResultCollectionView resultsView;306 //protected System.Windows.Forms.TabPage runsTabPage;307 //protected RunCollectionView runsView;308 //protected System.Windows.Forms.CheckBox storeAlgorithmInEachRunCheckBox;309 39 } 310 40 } -
branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks.Views/3.3/BenchmarkView.cs
r6920 r6934 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 using System.Linq;25 22 using System.Windows.Forms; 26 using HeuristicLab.Common;27 using HeuristicLab.Core;28 using HeuristicLab.Core.Views;29 23 using HeuristicLab.MainForm; 30 using HeuristicLab.PluginInfrastructure;31 using HeuristicLab.Optimization;32 24 using HeuristicLab.Optimization.Views; 33 25 … … 38 30 [Content(typeof(Linpack), true)] 39 31 public partial class BenchmarkView : AlgorithmView { 40 //private TypeSelectorDialog problemTypeSelectorDialog;41 32 public BenchmarkView() { 42 33 InitializeComponent(); … … 44 35 tabControl.TabPages.Remove(this.parametersTabPage); 45 36 } 46 47 //public new IAlgorithm Content {48 // get { return (IAlgorithm)base.Content; }49 // set { base.Content = value; }50 //}51 52 //protected override void Dispose(bool disposing) {53 // if (disposing) {54 // if (problemTypeSelectorDialog != null) problemTypeSelectorDialog.Dispose();55 // if (components != null) components.Dispose();56 // }57 // base.Dispose(disposing);58 //}59 60 //protected override void OnInitialized(EventArgs e) {61 // // Set order of tab pages according to z order.62 // // NOTE: This is required due to a bug in the VS designer.63 // List<Control> tabPages = new List<Control>();64 // for (int i = 0; i < tabControl.Controls.Count; i++) {65 // tabPages.Add(tabControl.Controls[i]);66 // }67 // tabControl.Controls.Clear();68 // foreach (Control control in tabPages)69 // tabControl.Controls.Add(control);70 71 // base.OnInitialized(e);72 //}73 74 //protected override void DeregisterContentEvents() {75 // Content.ProblemChanged -= new EventHandler(Content_ProblemChanged);76 // Content.StoreAlgorithmInEachRunChanged -= new EventHandler(Content_StoreAlgorithmInEachRunChanged);77 // base.DeregisterContentEvents();78 //}79 //protected override void RegisterContentEvents() {80 // base.RegisterContentEvents();81 // Content.ProblemChanged += new EventHandler(Content_ProblemChanged);82 // Content.StoreAlgorithmInEachRunChanged += new EventHandler(Content_StoreAlgorithmInEachRunChanged);83 //}84 85 //protected override void OnContentChanged() {86 // base.OnContentChanged();87 // if (Content == null) {88 // parameterCollectionView.Content = null;89 // problemViewHost.Content = null;90 // resultsView.Content = null;91 // runsView.Content = null;92 // storeAlgorithmInEachRunCheckBox.Checked = true;93 // } else {94 // parameterCollectionView.Content = Content.Parameters;95 // problemViewHost.ViewType = null;96 // problemViewHost.Content = Content.Problem;97 // resultsView.Content = Content.Results.AsReadOnly();98 // runsView.Content = Content.Runs;99 // storeAlgorithmInEachRunCheckBox.Checked = Content.StoreAlgorithmInEachRun;100 // }101 //}102 103 //protected override void SetEnabledStateOfControls() {104 // base.SetEnabledStateOfControls();105 // parameterCollectionView.Enabled = Content != null;106 // newProblemButton.Enabled = Content != null && !ReadOnly;107 // openProblemButton.Enabled = Content != null && !ReadOnly;108 // problemViewHost.Enabled = Content != null;109 // resultsView.Enabled = Content != null;110 // runsView.Enabled = Content != null;111 // storeAlgorithmInEachRunCheckBox.Enabled = Content != null && !ReadOnly;112 //}113 114 //protected override void OnClosed(FormClosedEventArgs e) {115 // if ((Content != null) && (Content.ExecutionState == ExecutionState.Started)) {116 // //The content must be stopped if no other view showing the content is available117 // var optimizers = MainFormManager.MainForm.Views.OfType<IContentView>().Where(v => v != this).Select(v => v.Content).OfType<IOptimizer>();118 // if (!optimizers.Contains(Content)) {119 // var nestedOptimizers = optimizers.SelectMany(opt => opt.NestedOptimizers);120 // if (!nestedOptimizers.Contains(Content)) Content.Stop();121 // }122 // }123 // base.OnClosed(e);124 //}125 126 //#region Content Events127 //protected override void Content_Prepared(object sender, EventArgs e) {128 // if (InvokeRequired)129 // Invoke(new EventHandler(Content_Prepared), sender, e);130 // else {131 // base.Content_Prepared(sender, e);132 // resultsView.Content = Content.Results.AsReadOnly();133 // }134 //}135 136 //protected virtual void Content_ProblemChanged(object sender, EventArgs e) {137 // if (InvokeRequired)138 // Invoke(new EventHandler(Content_ProblemChanged), sender, e);139 // else {140 // problemViewHost.ViewType = null;141 // problemViewHost.Content = Content.Problem;142 // }143 //}144 //protected virtual void Content_StoreAlgorithmInEachRunChanged(object sender, EventArgs e) {145 // if (InvokeRequired)146 // Invoke(new EventHandler(Content_StoreAlgorithmInEachRunChanged), sender, e);147 // else148 // storeAlgorithmInEachRunCheckBox.Checked = Content.StoreAlgorithmInEachRun;149 //}150 //#endregion151 152 //#region Control Events153 //protected virtual void newProblemButton_Click(object sender, EventArgs e) {154 // if (problemTypeSelectorDialog == null) {155 // problemTypeSelectorDialog = new TypeSelectorDialog();156 // problemTypeSelectorDialog.Caption = "Select Problem";157 // problemTypeSelectorDialog.TypeSelector.Caption = "Available Problems";158 // problemTypeSelectorDialog.TypeSelector.Configure(Content.ProblemType, false, true);159 // }160 // if (problemTypeSelectorDialog.ShowDialog(this) == DialogResult.OK) {161 // try {162 // Content.Problem = (IProblem)problemTypeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();163 // }164 // catch (Exception ex) {165 // ErrorHandling.ShowErrorDialog(this, ex);166 // }167 // }168 //}169 //protected virtual void openProblemButton_Click(object sender, EventArgs e) {170 // openFileDialog.Title = "Open Problem";171 // if (openFileDialog.ShowDialog(this) == DialogResult.OK) {172 // newProblemButton.Enabled = openProblemButton.Enabled = false;173 // problemViewHost.Enabled = false;174 175 // ContentManager.LoadAsync(openFileDialog.FileName, delegate(IStorableContent content, Exception error) {176 // try {177 // if (error != null) throw error;178 // IProblem problem = content as IProblem;179 // if (problem == null)180 // Invoke(new Action(() =>181 // MessageBox.Show(this, "The selected file does not contain a problem.", "Invalid File", MessageBoxButtons.OK, MessageBoxIcon.Error)));182 // else if (!Content.ProblemType.IsInstanceOfType(problem))183 // Invoke(new Action(() =>184 // MessageBox.Show(this, "The selected file contains a problem type which is not supported by this algorithm.", "Invalid Problem Type", MessageBoxButtons.OK, MessageBoxIcon.Error)));185 // else186 // Content.Problem = problem;187 // }188 // catch (Exception ex) {189 // Invoke(new Action(() => ErrorHandling.ShowErrorDialog(this, ex)));190 // }191 // finally {192 // Invoke(new Action(delegate() {193 // problemViewHost.Enabled = true;194 // newProblemButton.Enabled = openProblemButton.Enabled = true;195 // }));196 // }197 // });198 // }199 //}200 //protected virtual void storeAlgorithmInEachRunCheckBox_CheckedChanged(object sender, EventArgs e) {201 // if (Content != null) Content.StoreAlgorithmInEachRun = storeAlgorithmInEachRunCheckBox.Checked;202 //}203 //protected virtual void problemTabPage_DragEnterOver(object sender, DragEventArgs e) {204 // e.Effect = DragDropEffects.None;205 // if (!ReadOnly && (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) != null) && Content.ProblemType.IsAssignableFrom(e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat).GetType())) {206 // if ((e.KeyState & 32) == 32) e.Effect = DragDropEffects.Link; // ALT key207 // else if ((e.KeyState & 4) == 4) e.Effect = DragDropEffects.Move; // SHIFT key208 // else if (e.AllowedEffect.HasFlag(DragDropEffects.Copy)) e.Effect = DragDropEffects.Copy;209 // else if (e.AllowedEffect.HasFlag(DragDropEffects.Move)) e.Effect = DragDropEffects.Move;210 // else if (e.AllowedEffect.HasFlag(DragDropEffects.Link)) e.Effect = DragDropEffects.Link;211 // }212 //}213 //protected virtual void problemTabPage_DragDrop(object sender, DragEventArgs e) {214 // if (e.Effect != DragDropEffects.None) {215 // IProblem problem = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) as IProblem;216 // if (e.Effect.HasFlag(DragDropEffects.Copy)) problem = (IProblem)problem.Clone();217 // Content.Problem = problem;218 // }219 //}220 //#endregion221 37 } 222 38 } -
branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks.Views/3.3/HeuristicLab.Algorithms.Benchmarks.Views-3.3.csproj
r6920 r6934 38 38 </PropertyGroup> 39 39 <ItemGroup> 40 <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 41 <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 42 <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 43 <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 44 <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 45 <Reference Include="HeuristicLab.Problems.DataAnalysis.Views-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 40 46 <Reference Include="System" /> 41 47 <Reference Include="System.Core" /> 48 <Reference Include="System.Drawing" /> 42 49 <Reference Include="System.Windows.Forms" /> 43 50 <Reference Include="System.Xml.Linq" /> … … 65 72 <ProjectReference Include="..\..\HeuristicLab.Algorithms.Benchmarks\3.3\HeuristicLab.Algorithms.Benchmarks-3.3.csproj"> 66 73 <Project>{068C70A7-8CAF-4AB6-8721-4564D62292BC}</Project> 67 <Name>HeuristicLab.Algorithms.Benchmark .3.3</Name>74 <Name>HeuristicLab.Algorithms.Benchmarks-3.3</Name> 68 75 </ProjectReference> 69 76 <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj"> … … 103 110 <Name>HeuristicLab.PluginInfrastructure-3.3</Name> 104 111 </ProjectReference> 112 <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views-3.4.csproj"> 113 <Project>{BF1E4DF4-A4CC-451F-9D50-303F405E265E}</Project> 114 <Name>HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views-3.4</Name> 115 </ProjectReference> 116 </ItemGroup> 117 <ItemGroup> 118 <EmbeddedResource Include="BenchmarkView.resx"> 119 <DependentUpon>BenchmarkView.cs</DependentUpon> 120 </EmbeddedResource> 105 121 </ItemGroup> 106 122 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> -
branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks.Views/3.3/Plugin.cs.frame
r6920 r6934 26 26 /// Plugin class for HeuristicLab.Algorithms.Benchmarks plugin. 27 27 /// </summary> 28 [Plugin("HeuristicLab.Algorithms.Benchmarks.Views", "Provides wrappers for data analysis algorithms implemented in external libraries (linear regression, linear discriminant analysis, k-means clustering, support vector classification and regression)", "3.4.1.$WCREV$")]28 [Plugin("HeuristicLab.Algorithms.Benchmarks.Views", "Provides views for benchmarking algorithms.", "3.3.5.$WCREV$")] 29 29 [PluginFile("HeuristicLab.Algorithms.Benchmarks.Views-3.3.dll", PluginFileType.Assembly)] 30 [PluginDependency("HeuristicLab.Algorithms.Benchmarks", "3.3")] 30 31 [PluginDependency("HeuristicLab.Collections", "3.3")] 31 32 [PluginDependency("HeuristicLab.Common", "3.3")] 32 [PluginDependency("HeuristicLab.Common.Resources", "3.3")]33 33 [PluginDependency("HeuristicLab.Core", "3.3")] 34 [PluginDependency("HeuristicLab.Data", "3.3")] 35 [PluginDependency("HeuristicLab.Operators", "3.3")] 34 [PluginDependency("HeuristicLab.Core.Views", "3.3")] 35 [PluginDependency("HeuristicLab.MainForm", "3.3")] 36 [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")] 36 37 [PluginDependency("HeuristicLab.Optimization", "3.3")] 37 [PluginDependency("HeuristicLab.Parameters", "3.3")] 38 [PluginDependency("HeuristicLab.Persistence", "3.3")] 38 [PluginDependency("HeuristicLab.Optimization.Views", "3.3")] 39 39 public class HeuristicLabAlgorithmsBenchmarksViewsPlugin : PluginBase { 40 40 } -
branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks/3.3/Dhrystone.cs
r6920 r6934 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Diagnostics; 3 using System.Threading;4 using System.Threading.Tasks;5 24 using HeuristicLab.Common; 6 25 using HeuristicLab.Core; … … 10 29 11 30 namespace HeuristicLab.Algorithms.Benchmarks { 12 [Item("Dhrystone Algorithm", " A Dhrystone benchmarkalgorithm.")]31 [Item("Dhrystone Algorithm", "Dhrystone benchmarking algorithm.")] 13 32 [Creatable("Benchmarks")] 14 33 [StorableClass] 15 public class Dhrystone : Algorithm { 16 private DateTime lastUpdateTime; 17 18 [Storable] 19 private ResultCollection results; 34 public class Dhrystone : Benchmark { 20 35 21 36 #region Benchmark Fields … … 46 61 #endregion 47 62 48 #region Properties49 50 public override ResultCollection Results {51 get { return results; }52 }53 54 #endregion55 56 63 #region Costructors 57 64 58 65 public Dhrystone() 59 66 : base() { 60 results = new ResultCollection(); 67 61 68 } 62 69 63 70 private Dhrystone(Dhrystone original, Cloner cloner) 64 71 : base(original, cloner) { 65 results = new ResultCollection(); 66 } 67 68 #endregion 72 73 } 74 75 #endregion 76 77 #region IDeepClonable Members 69 78 70 79 public override IDeepCloneable Clone(Cloner cloner) { … … 72 81 } 73 82 74 public override void Prepare() { 75 results.Clear(); 76 OnPrepared(); 77 } 78 79 public override void Start() { 80 var cancellationTokenSource = new CancellationTokenSource(); 81 OnStarted(); 82 Task task = Task.Factory.StartNew(Run, cancellationTokenSource.Token, cancellationTokenSource.Token); 83 task.ContinueWith(t => { 84 try { 85 t.Wait(); 86 } 87 catch (AggregateException ex) { 88 try { 89 ex.Flatten().Handle(x => x is OperationCanceledException); 90 } 91 catch (AggregateException remaining) { 92 if (remaining.InnerExceptions.Count == 1) OnExceptionOccurred(remaining.InnerExceptions[0]); 93 else OnExceptionOccurred(remaining); 94 } 95 } 96 cancellationTokenSource.Dispose(); 97 cancellationTokenSource = null; 98 OnStopped(); 99 }); 100 } 101 102 private void Run(object state) { 103 CancellationToken cancellationToken = (CancellationToken)state; 104 lastUpdateTime = DateTime.Now; 105 System.Timers.Timer timer = new System.Timers.Timer(250); 106 timer.AutoReset = true; 107 timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed); 108 timer.Start(); 109 try { 110 RunBenchmark(); 111 } 112 finally { 113 timer.Elapsed -= new System.Timers.ElapsedEventHandler(timer_Elapsed); 114 timer.Stop(); 115 ExecutionTime += DateTime.Now - lastUpdateTime; 116 } 117 118 cancellationToken.ThrowIfCancellationRequested(); 119 } 120 121 private void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { 122 System.Timers.Timer timer = (System.Timers.Timer)sender; 123 timer.Enabled = false; 124 DateTime now = DateTime.Now; 125 ExecutionTime += now - lastUpdateTime; 126 lastUpdateTime = now; 127 timer.Enabled = true; 128 } 129 130 #region Dhrystone Benchmark 131 132 private void RunBenchmark() { 83 #endregion 84 85 #region Benchmark Methods 86 87 protected override void RunBenchmark() { 133 88 int Int_Loc_1; 134 89 int Int_Loc_2; … … 162 117 } 163 118 164 //System.Console.WriteLine("Execution start, " + Number_Of_Runs + " runs through Dhrystone");165 119 Stopwatch sw = new Stopwatch(); 166 120 sw.Start(); … … 205 159 sw.Stop(); 206 160 total_time = sw.ElapsedMilliseconds; 207 //System.Console.WriteLine("total time: {0} ms", total_time);208 //System.Console.WriteLine("Result: " + Number_Of_Runs * 1000 / total_time + " dhrystone/ms.");209 161 210 162 Results.Add(new Result("DIPS", new DoubleValue(Number_Of_Runs * 1000 / total_time))); … … 389 341 public int Int_Comp; 390 342 public string String_Comp; 391 /*392 public int Enum_Comp_2;393 public string String_Comp_2;394 public char Char_Comp_1;395 public char Char_Comp_2;396 */397 343 } 398 344 -
branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks/3.3/HeuristicLab.Algorithms.Benchmarks-3.3.csproj
r6920 r6934 40 40 <Reference Include="System" /> 41 41 <Reference Include="System.Core" /> 42 <Reference Include="System.Drawing" /> 42 43 <Reference Include="System.Xml.Linq" /> 43 44 <Reference Include="System.Data.DataSetExtensions" /> … … 47 48 </ItemGroup> 48 49 <ItemGroup> 50 <Compile Include="Benchmark.cs"> 51 <SubType>Code</SubType> 52 </Compile> 49 53 <Compile Include="Whetstone.cs" /> 50 54 <Compile Include="Dhrystone.cs" /> -
branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks/3.3/Linpack.cs
r6920 r6934 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Diagnostics; 3 using System.Threading;4 using System.Threading.Tasks;5 24 using HeuristicLab.Common; 6 25 using HeuristicLab.Core; … … 10 29 11 30 namespace HeuristicLab.Algorithms.Benchmarks { 12 [Item("Linpack Algorithm", " A Linpack benchmarkalgorithm.")]31 [Item("Linpack Algorithm", "Linpack benchmarking algorithm.")] 13 32 [Creatable("Benchmarks")] 14 33 [StorableClass] 15 public class Linpack : Algorithm { 16 private DateTime lastUpdateTime; 17 18 [Storable] 19 private ResultCollection results; 34 public class Linpack : Benchmark { 20 35 21 36 #region Benchmark Fields … … 33 48 #endregion 34 49 35 #region Properties36 37 public override ResultCollection Results {38 get { return results; }39 }40 41 #endregion42 43 50 #region Costructors 44 51 45 52 public Linpack() 46 53 : base() { 47 results = new ResultCollection();48 54 } 49 55 50 56 private Linpack(Linpack original, Cloner cloner) 51 57 : base(original, cloner) { 52 results = new ResultCollection();53 58 } 54 59 55 60 #endregion 61 62 #region IDeepClonable Members 56 63 57 64 public override IDeepCloneable Clone(Cloner cloner) { … … 59 66 } 60 67 61 public override void Prepare() { 62 results.Clear(); 63 OnPrepared(); 64 } 65 66 public override void Start() { 67 var cancellationTokenSource = new CancellationTokenSource(); 68 OnStarted(); 69 Task task = Task.Factory.StartNew(Run, cancellationTokenSource.Token, cancellationTokenSource.Token); 70 task.ContinueWith(t => { 71 try { 72 t.Wait(); 73 } 74 catch (AggregateException ex) { 75 try { 76 ex.Flatten().Handle(x => x is OperationCanceledException); 77 } 78 catch (AggregateException remaining) { 79 if (remaining.InnerExceptions.Count == 1) OnExceptionOccurred(remaining.InnerExceptions[0]); 80 else OnExceptionOccurred(remaining); 81 } 82 } 83 cancellationTokenSource.Dispose(); 84 cancellationTokenSource = null; 85 OnStopped(); 86 }); 87 } 88 89 private void Run(object state) { 90 CancellationToken cancellationToken = (CancellationToken)state; 91 lastUpdateTime = DateTime.Now; 92 System.Timers.Timer timer = new System.Timers.Timer(250); 93 timer.AutoReset = true; 94 timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed); 95 timer.Start(); 96 try { 97 RunBenchmark(); 98 } 99 finally { 100 timer.Elapsed -= new System.Timers.ElapsedEventHandler(timer_Elapsed); 101 timer.Stop(); 102 ExecutionTime += DateTime.Now - lastUpdateTime; 103 } 104 105 cancellationToken.ThrowIfCancellationRequested(); 106 } 107 108 private void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { 109 System.Timers.Timer timer = (System.Timers.Timer)sender; 110 timer.Enabled = false; 111 DateTime now = DateTime.Now; 112 ExecutionTime += now - lastUpdateTime; 113 lastUpdateTime = now; 114 timer.Enabled = true; 115 } 68 #endregion 116 69 117 70 #region Linpack Benchmark 118 119 private void RunBenchmark() { 71 // implementation based on Java version: http://www.netlib.org/benchmark/linpackjava/ 72 73 protected override void RunBenchmark() { 120 74 int n = DEFAULT_PSIZE; 121 75 int ldaa = DEFAULT_PSIZE; … … 189 143 mflops_result /= 1000; 190 144 191 //System.Console.WriteLine("Mflops/s: " + mflops_result + " Time: " + time_result + " secs" + " Norm Res: " + residn_result + " Precision: " + eps_result);192 193 145 Results.Add(new Result("Mflops/s", new DoubleValue(mflops_result))); 194 //Results.Add(new Result("ca.Mflops/s", new DoubleValue(mflops_result * Environment.ProcessorCount)));146 Results.Add(new Result("total Mflops/s", new DoubleValue(mflops_result * Environment.ProcessorCount))); 195 147 } 196 148 -
branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks/3.3/Plugin.cs.frame
r6920 r6934 26 26 /// Plugin class for HeuristicLab.Algorithms.Benchmark plugin. 27 27 /// </summary> 28 [Plugin("HeuristicLab.Algorithms.Benchmarks", "Provides wrappers for data analysis algorithms implemented in external libraries (linear regression, linear discriminant analysis, k-means clustering, support vector classification and regression)", "3.4.1.$WCREV$")]28 [Plugin("HeuristicLab.Algorithms.Benchmarks", "Provides different benchmarking algorithms", "3.3.5.$WCREV$")] 29 29 [PluginFile("HeuristicLab.Algorithms.Benchmarks-3.3.dll", PluginFileType.Assembly)] 30 30 [PluginDependency("HeuristicLab.Collections", "3.3")] -
branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks/3.3/Whetstone.cs
r6920 r6934 1 using System; 2 using System.Threading; 3 using System.Threading.Tasks; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 4 23 using HeuristicLab.Common; 5 24 using HeuristicLab.Core; … … 9 28 10 29 namespace HeuristicLab.Algorithms.Benchmarks { 11 [Item("Whetstone Algorithm", " A Whetstone benchmarkalgorithm.")]30 [Item("Whetstone Algorithm", "Whetstone benchmarking algorithm.")] 12 31 [Creatable("Benchmarks")] 13 32 [StorableClass] 14 public class Whetstone : Algorithm { 15 private DateTime lastUpdateTime; 16 17 [Storable] 18 private ResultCollection results; 33 public class Whetstone : Benchmark { 19 34 20 35 #region Benchmark Fields … … 22 37 private long begin_time; 23 38 private long end_time; 24 //private long total_time;25 39 26 40 private int ITERATIONS; … … 34 48 #endregion 35 49 36 #region Properties37 38 public override ResultCollection Results {39 get { return results; }40 }41 42 #endregion43 44 50 #region Costructors 45 51 46 52 public Whetstone() 47 53 : base() { 48 results = new ResultCollection(); 54 49 55 } 50 56 51 57 private Whetstone(Whetstone original, Cloner cloner) 52 58 : base(original, cloner) { 53 results = new ResultCollection(); 54 } 55 56 #endregion 59 60 } 61 62 #endregion 63 64 #region IDeepClonable Members 57 65 58 66 public override IDeepCloneable Clone(Cloner cloner) { … … 60 68 } 61 69 62 public override void Prepare() { 63 results.Clear(); 64 OnPrepared(); 65 } 66 67 public override void Start() { 68 var cancellationTokenSource = new CancellationTokenSource(); 69 OnStarted(); 70 Task task = Task.Factory.StartNew(Run, cancellationTokenSource.Token, cancellationTokenSource.Token); 71 task.ContinueWith(t => { 72 try { 73 t.Wait(); 74 } 75 catch (AggregateException ex) { 76 try { 77 ex.Flatten().Handle(x => x is OperationCanceledException); 78 } 79 catch (AggregateException remaining) { 80 if (remaining.InnerExceptions.Count == 1) OnExceptionOccurred(remaining.InnerExceptions[0]); 81 else OnExceptionOccurred(remaining); 82 } 83 } 84 cancellationTokenSource.Dispose(); 85 cancellationTokenSource = null; 86 OnStopped(); 87 }); 88 } 89 90 private void Run(object state) { 91 CancellationToken cancellationToken = (CancellationToken)state; 92 lastUpdateTime = DateTime.Now; 93 System.Timers.Timer timer = new System.Timers.Timer(250); 94 timer.AutoReset = true; 95 timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed); 96 timer.Start(); 97 try { 98 RunBenchmark(); 99 } 100 finally { 101 timer.Elapsed -= new System.Timers.ElapsedEventHandler(timer_Elapsed); 102 timer.Stop(); 103 ExecutionTime += DateTime.Now - lastUpdateTime; 104 } 105 106 cancellationToken.ThrowIfCancellationRequested(); 107 } 108 109 private void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { 110 System.Timers.Timer timer = (System.Timers.Timer)sender; 111 timer.Enabled = false; 112 DateTime now = DateTime.Now; 113 ExecutionTime += now - lastUpdateTime; 114 lastUpdateTime = now; 115 timer.Enabled = true; 116 } 70 #endregion 117 71 118 72 #region Whetstone Benchmark 119 73 120 pr ivate void RunBenchmark() {74 protected override void RunBenchmark() { 121 75 ITERATIONS = 100; // ITERATIONS / 10 = Millions Whetstone instructions 122 76 … … 130 84 131 85 for (int runNumber = 1; runNumber <= numberOfRuns; runNumber++) { 132 //System.Console.WriteLine(runNumber + ". Test");133 86 elapsedTime = (float)(MainCalc() / 1000); 134 87 meanTime = meanTime + (elapsedTime * 1000 / numberOfCycles); … … 142 95 meanRating = meanRating / numberOfRuns; 143 96 intRating = (int)meanRating; 144 //System.Console.WriteLine("Number of Runs " + numberOfRuns); 145 //System.Console.WriteLine("Average time per cycle " + meanTime + " ms."); 146 //System.Console.WriteLine("Average Whetstone Rating " + intRating + " KWIPS"); 147 //Results.Add(new Result("KWIPS", new IntValue(intRating))); 97 148 98 Results.Add(new Result("MWIPS", new IntValue(intRating / 1000))); 149 99 } … … 264 214 265 215 end_time = DateTime.Now.Ticks / 10000; // get ms 266 //System.Console.WriteLine(" (time for " + numberOfCycles + " cycles): " + (end_time - begin_time) + " millisec.");267 216 268 217 return (end_time - begin_time);
Note: See TracChangeset
for help on using the changeset viewer.