- Timestamp:
- 03/23/16 22:51:27 (9 years ago)
- Location:
- branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views
- Files:
-
- 18 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views/KnowledgeBaseView.cs
r13721 r13722 25 25 namespace HeuristicLab.OptimizationExpertSystem { 26 26 [View("Knowledge Base View")] 27 [Content(typeof( ExpertSystem), IsDefaultView = false)]28 public partial class KnowledgeBaseView : ExpertSystemViewBase {27 [Content(typeof(KnowledgeCenter), IsDefaultView = false)] 28 public partial class KnowledgeBaseView : KnowledgeCenterViewBase { 29 29 public KnowledgeBaseView() { 30 30 InitializeComponent(); -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views/KnowledgeCenterAllinOneView.Designer.cs
r13721 r13722 21 21 22 22 namespace HeuristicLab.OptimizationExpertSystem { 23 partial class ExpertSystemView {23 partial class KnowledgeCenterAllinOneView { 24 24 /// <summary> 25 25 /// Required designer variable. -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views/KnowledgeCenterAllinOneView.cs
r13721 r13722 30 30 using HeuristicLab.Data.Views; 31 31 using HeuristicLab.MainForm; 32 using HeuristicLab.MainForm.WindowsForms; 32 33 using HeuristicLab.Optimization; 33 34 using HeuristicLab.Optimization.Views; … … 43 44 namespace HeuristicLab.OptimizationExpertSystem { 44 45 [View("Knowledge Center (all-in-one view)")] 45 [Content(typeof( ExpertSystem), IsDefaultView = true)]46 public partial class ExpertSystemView : ItemView {46 [Content(typeof(KnowledgeCenter), IsDefaultView = true)] 47 public partial class KnowledgeCenterAllinOneView : AsynchronousContentView { 47 48 private EnumValueView<SeedingStrategyTypes> seedingStrategyView; 48 49 private CheckedItemListView<IScope> seedingSolutionsView; … … 50 51 private bool okbDownloadInProgress; 51 52 52 public new ExpertSystemContent {53 get { return ( ExpertSystem)base.Content; }53 public new KnowledgeCenter Content { 54 get { return (KnowledgeCenter)base.Content; } 54 55 set { base.Content = value; } 55 56 } 56 57 57 public ExpertSystemView() {58 public KnowledgeCenterAllinOneView() { 58 59 InitializeComponent(); 59 60 // brings progress panel to front (it is not visible by default, but obstructs other elements in designer) … … 77 78 #region Event Registration 78 79 protected override void DeregisterContentEvents() { 79 Content.PropertyChanged -= ContentOnPropertyChanged;80 80 Content.SuggestedInstances.CollectionReset -= SuggestedInstancesOnChanged; 81 81 Content.SuggestedInstances.ItemsAdded -= SuggestedInstancesOnChanged; … … 94 94 protected override void RegisterContentEvents() { 95 95 base.RegisterContentEvents(); 96 Content.PropertyChanged += ContentOnPropertyChanged;97 96 Content.SuggestedInstances.CollectionReset += SuggestedInstancesOnChanged; 98 97 Content.SuggestedInstances.ItemsAdded += SuggestedInstancesOnChanged; … … 145 144 maxEvaluationsTextBox.Text = Content.MaximumEvaluations.ToString(); 146 145 problemViewHost.Content = Content.Problem; 147 runsView.Content = Content. Runs;146 runsView.Content = Content.InstanceRuns; 148 147 kbViewHost.ViewType = typeof(RunCollectionRLDView); 149 148 kbViewHost.Content = Content.KnowledgeBase; 150 149 problemInstancesView.Content = Content.ProblemInstances; 151 solverResultsView.Content = Content.CurrentResult;150 solverResultsView.Content = null; 152 151 seedingStrategyView.Content = Content.SeedingStrategy; 153 152 seedingSolutionsView.Content = Content.SolutionSeedingPool; … … 181 180 } 182 181 183 private void ContentOnPropertyChanged(object sender, PropertyChangedEventArgs e) {184 if (InvokeRequired) {185 Invoke((Action<object, PropertyChangedEventArgs>)ContentOnPropertyChanged, sender, e);186 return;187 }188 SuppressEvents = true;189 try {190 switch (e.PropertyName) {191 case "KnowledgeBase": kbViewHost.Content = Content.KnowledgeBase; break;192 case "MaximumEvaluations": maxEvaluationsTextBox.Text = Content.MaximumEvaluations.ToString(); break;193 case "Problem":194 DeregisterProblemEvents(problemViewHost.Content as OKBProblem);195 problemViewHost.Content = Content.Problem;196 RegisterProblemEvents(Content.Problem);197 UpdateNamesComboboxes();198 break;199 case "ProblemInstances": problemInstancesView.Content = Content.ProblemInstances; break;200 case "CurrentResult": solverResultsView.Content = Content.CurrentResult; break;201 }202 } finally { SuppressEvents = false; }203 SetEnabledStateOfControls();204 }205 206 182 private void SuggestedInstancesOnChanged(object sender, EventArgs e) { 207 183 UpdateSuggestedInstancesCombobox(); … … 230 206 //errorProvider.SetError(maxEvaluationsTextBox, "Please enter a valid integer number."); 231 207 } else { 232 Content.MaximumEvaluations = value;208 Content.MaximumEvaluations.Value = value; 233 209 e.Cancel = false; 234 210 //errorProvider.SetError(maxEvaluationsTextBox, null); … … 264 240 } 265 241 266 private void AlgorithmStartButtonOnClick(object sender, EventArgs e) { 267 if (suggestedInstancesComboBox.SelectedIndex >= 0) 268 Content.StartAlgorithmAsync(suggestedInstancesComboBox.SelectedIndex); 242 private async void AlgorithmStartButtonOnClick(object sender, EventArgs e) { 243 if (suggestedInstancesComboBox.SelectedIndex >= 0) { 244 solverResultsView.Content = await Content.StartAlgorithmAsync(suggestedInstancesComboBox.SelectedIndex); 245 } 269 246 } 270 247 -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views/KnowledgeCenterViewBase.Designer.cs
r13721 r13722 21 21 22 22 namespace HeuristicLab.OptimizationExpertSystem { 23 partial class ExpertSystemViewBase {23 partial class KnowledgeCenterViewBase { 24 24 /// <summary> 25 25 /// Required designer variable. -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views/KnowledgeCenterViewBase.cs
r13721 r13722 21 21 22 22 using HeuristicLab.Common; 23 using HeuristicLab.Core.Views;24 23 using HeuristicLab.MainForm; 24 using HeuristicLab.MainForm.WindowsForms; 25 using HeuristicLab.Optimization; 25 26 using HeuristicLab.OptimizationExpertSystem.Common; 26 27 using System; 27 using System.ComponentModel;28 28 29 29 namespace HeuristicLab.OptimizationExpertSystem { 30 30 [View("Expert-System View")] 31 public partial class ExpertSystemViewBase : ItemView {32 public Optimization ExpertSystemMainForm {33 get { return (Optimization ExpertSystem)HeuristicLab.MainForm.MainFormManager.MainForm; }31 public partial class KnowledgeCenterViewBase : AsynchronousContentView { 32 public OptimizationKnowledgeCenter MainForm { 33 get { return (OptimizationKnowledgeCenter)HeuristicLab.MainForm.MainFormManager.MainForm; } 34 34 } 35 35 36 public new ExpertSystemContent {37 get { return ( ExpertSystem)base.Content; }36 public new KnowledgeCenter Content { 37 get { return (KnowledgeCenter)base.Content; } 38 38 set { base.Content = value; } 39 39 } 40 40 41 protected ExpertSystemViewBase() {41 protected KnowledgeCenterViewBase() { 42 42 InitializeComponent(); 43 43 } … … 46 46 protected override void RegisterContentEvents() { 47 47 base.RegisterContentEvents(); 48 Content.PropertyChanged += ContentOnPropertyChanged;49 48 Content.DownloadStarted += ContentOnDownloadStarted; 49 Content.AlgorithmInstanceStarted += ContentOnAlgorithmInstanceStarted; 50 50 RegisterContentProblemEvents(); 51 51 RegisterContentProblemInstancesEvents(); … … 88 88 protected override void DeregisterContentEvents() { 89 89 base.DeregisterContentEvents(); 90 Content.PropertyChanged -= ContentOnPropertyChanged;91 90 Content.DownloadStarted -= ContentOnDownloadStarted; 91 Content.AlgorithmInstanceStarted -= ContentOnAlgorithmInstanceStarted; 92 92 DeregisterContentProblemEvents(); 93 93 DeregisterContentProblemInstancesEvents(); … … 129 129 #endregion 130 130 131 private void ContentOnPropertyChanged(object sender, PropertyChangedEventArgs e) {132 if (InvokeRequired) Invoke((Action<string>)OnPropertyChanged, e.PropertyName);133 else {134 switch (e.PropertyName) {135 case "Problem": RegisterContentProblemEvents(); break;136 case "ProblemInstances": RegisterContentProblemInstancesEvents(); break;137 case "SolutionSeedingPool": RegisterContentSolutionSeedingPoolEvents(); break;138 case "SuggestedInstances": RegisterContentSuggestedInstancesEvents(); break;139 }140 OnPropertyChanged(e.PropertyName);141 }142 }143 144 131 protected virtual void OnDownloadStarted(IProgress progress) { } 145 132 protected virtual void OnDownloadEnded() { } 133 protected virtual void OnAlgorithmInstanceStarted(IAlgorithm algorithm) { } 146 134 protected virtual void OnPropertyChanged(string propertyName) { } 147 135 protected virtual void OnProblemChanged() { } … … 150 138 protected virtual void OnSolutionSeedingPoolChanged() { } 151 139 protected virtual void OnSuggestedInstancesChanged() { } 140 protected virtual void OnKnowledgeBaseChanged() { } 152 141 153 142 #region Content Event Handlers … … 157 146 e.Value.ProgressStateChanged += ProgressOnStateChanged; 158 147 OnDownloadStarted(e.Value); 148 } 149 150 private void ContentOnAlgorithmInstanceStarted(object sender, EventArgs<IAlgorithm> e) { 151 if (InvokeRequired) { Invoke((Action<object, EventArgs<IAlgorithm>>)ContentOnAlgorithmInstanceStarted, sender, e); return; } 152 OnAlgorithmInstanceStarted(e.Value); 159 153 } 160 154 -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views/SolverView.Designer.cs
r13721 r13722 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 WeifenLuo.WinFormsUI.Docking.DockPanelSkin dockPanelSkin1 = new WeifenLuo.WinFormsUI.Docking.DockPanelSkin(); 48 WeifenLuo.WinFormsUI.Docking.AutoHideStripSkin autoHideStripSkin1 = new WeifenLuo.WinFormsUI.Docking.AutoHideStripSkin(); 49 WeifenLuo.WinFormsUI.Docking.DockPanelGradient dockPanelGradient1 = new WeifenLuo.WinFormsUI.Docking.DockPanelGradient(); 50 WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient1 = new WeifenLuo.WinFormsUI.Docking.TabGradient(); 51 WeifenLuo.WinFormsUI.Docking.DockPaneStripSkin dockPaneStripSkin1 = new WeifenLuo.WinFormsUI.Docking.DockPaneStripSkin(); 52 WeifenLuo.WinFormsUI.Docking.DockPaneStripGradient dockPaneStripGradient1 = new WeifenLuo.WinFormsUI.Docking.DockPaneStripGradient(); 53 WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient2 = new WeifenLuo.WinFormsUI.Docking.TabGradient(); 54 WeifenLuo.WinFormsUI.Docking.DockPanelGradient dockPanelGradient2 = new WeifenLuo.WinFormsUI.Docking.DockPanelGradient(); 55 WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient3 = new WeifenLuo.WinFormsUI.Docking.TabGradient(); 56 WeifenLuo.WinFormsUI.Docking.DockPaneStripToolWindowGradient dockPaneStripToolWindowGradient1 = new WeifenLuo.WinFormsUI.Docking.DockPaneStripToolWindowGradient(); 57 WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient4 = new WeifenLuo.WinFormsUI.Docking.TabGradient(); 58 WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient5 = new WeifenLuo.WinFormsUI.Docking.TabGradient(); 59 WeifenLuo.WinFormsUI.Docking.DockPanelGradient dockPanelGradient3 = new WeifenLuo.WinFormsUI.Docking.DockPanelGradient(); 60 WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient6 = new WeifenLuo.WinFormsUI.Docking.TabGradient(); 61 WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient7 = new WeifenLuo.WinFormsUI.Docking.TabGradient(); 47 62 this.seedingStrategyPanel = new System.Windows.Forms.Panel(); 48 63 this.solverTabControl = new HeuristicLab.MainForm.WindowsForms.DragOverTabControl(); 49 64 this.resultsTabPage = new System.Windows.Forms.TabPage(); 50 this.solverResultsView = new HeuristicLab.Optimization.Views.ResultCollectionView(); 65 this.showOnlyFinalResultCheckBox = new System.Windows.Forms.CheckBox(); 66 this.resultsDockPanel = new WeifenLuo.WinFormsUI.Docking.DockPanel(); 67 this.runsTabPage = new System.Windows.Forms.TabPage(); 68 this.runsView = new HeuristicLab.Optimization.Views.RunCollectionView(); 51 69 this.solutionSeedingTabPage = new System.Windows.Forms.TabPage(); 52 70 this.parametersTabPage = new System.Windows.Forms.TabPage(); … … 58 76 this.evaluationsLimitabel = new System.Windows.Forms.Label(); 59 77 this.algorithmSuggestionLabel = new System.Windows.Forms.Label(); 60 this.maxEvaluationsTextBox = new System.Windows.Forms.TextBox();61 78 this.suggestedInstancesComboBox = new System.Windows.Forms.ComboBox(); 62 79 this.algorithmCloneButton = new System.Windows.Forms.Button(); 63 this.runsTabPage = new System.Windows.Forms.TabPage(); 64 this.runsView = new HeuristicLab.Optimization.Views.RunCollectionView(); 80 this.maxEvaluationsView = new HeuristicLab.Data.Views.StringConvertibleValueView(); 81 this.seededRunsTabPage = new System.Windows.Forms.TabPage(); 82 this.seededRunsView = new HeuristicLab.Optimization.Views.RunCollectionView(); 65 83 this.solverTabControl.SuspendLayout(); 66 84 this.resultsTabPage.SuspendLayout(); 85 this.runsTabPage.SuspendLayout(); 67 86 this.parametersTabPage.SuspendLayout(); 68 87 this.operatorGraphTabPage.SuspendLayout(); 69 this. runsTabPage.SuspendLayout();88 this.seededRunsTabPage.SuspendLayout(); 70 89 this.SuspendLayout(); 71 90 // … … 87 106 this.solverTabControl.Controls.Add(this.resultsTabPage); 88 107 this.solverTabControl.Controls.Add(this.runsTabPage); 108 this.solverTabControl.Controls.Add(this.seededRunsTabPage); 89 109 this.solverTabControl.Controls.Add(this.solutionSeedingTabPage); 90 110 this.solverTabControl.Controls.Add(this.parametersTabPage); … … 98 118 // resultsTabPage 99 119 // 100 this.resultsTabPage.Controls.Add(this.solverResultsView); 120 this.resultsTabPage.Controls.Add(this.showOnlyFinalResultCheckBox); 121 this.resultsTabPage.Controls.Add(this.resultsDockPanel); 101 122 this.resultsTabPage.Location = new System.Drawing.Point(4, 22); 102 123 this.resultsTabPage.Name = "resultsTabPage"; … … 107 128 this.resultsTabPage.UseVisualStyleBackColor = true; 108 129 // 109 // solverResultsView 110 // 111 this.solverResultsView.Caption = "ResultCollection View"; 112 this.solverResultsView.Content = null; 113 this.solverResultsView.Dock = System.Windows.Forms.DockStyle.Fill; 114 this.solverResultsView.Location = new System.Drawing.Point(3, 3); 115 this.solverResultsView.Name = "solverResultsView"; 116 this.solverResultsView.ReadOnly = true; 117 this.solverResultsView.ShowDetails = true; 118 this.solverResultsView.Size = new System.Drawing.Size(835, 448); 119 this.solverResultsView.TabIndex = 1; 130 // showOnlyFinalResultCheckBox 131 // 132 this.showOnlyFinalResultCheckBox.AutoSize = true; 133 this.showOnlyFinalResultCheckBox.Location = new System.Drawing.Point(6, 6); 134 this.showOnlyFinalResultCheckBox.Name = "showOnlyFinalResultCheckBox"; 135 this.showOnlyFinalResultCheckBox.Size = new System.Drawing.Size(158, 17); 136 this.showOnlyFinalResultCheckBox.TabIndex = 1; 137 this.showOnlyFinalResultCheckBox.Text = "show only final result (faster)"; 138 this.showOnlyFinalResultCheckBox.UseVisualStyleBackColor = true; 139 // 140 // resultsDockPanel 141 // 142 this.resultsDockPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 143 | System.Windows.Forms.AnchorStyles.Left) 144 | System.Windows.Forms.AnchorStyles.Right))); 145 this.resultsDockPanel.DocumentStyle = WeifenLuo.WinFormsUI.Docking.DocumentStyle.DockingWindow; 146 this.resultsDockPanel.Location = new System.Drawing.Point(3, 29); 147 this.resultsDockPanel.Name = "resultsDockPanel"; 148 this.resultsDockPanel.Size = new System.Drawing.Size(835, 422); 149 dockPanelGradient1.EndColor = System.Drawing.SystemColors.ControlLight; 150 dockPanelGradient1.StartColor = System.Drawing.SystemColors.ControlLight; 151 autoHideStripSkin1.DockStripGradient = dockPanelGradient1; 152 tabGradient1.EndColor = System.Drawing.SystemColors.Control; 153 tabGradient1.StartColor = System.Drawing.SystemColors.Control; 154 tabGradient1.TextColor = System.Drawing.SystemColors.ControlDarkDark; 155 autoHideStripSkin1.TabGradient = tabGradient1; 156 autoHideStripSkin1.TextFont = new System.Drawing.Font("Segoe UI", 9F); 157 dockPanelSkin1.AutoHideStripSkin = autoHideStripSkin1; 158 tabGradient2.EndColor = System.Drawing.SystemColors.ControlLightLight; 159 tabGradient2.StartColor = System.Drawing.SystemColors.ControlLightLight; 160 tabGradient2.TextColor = System.Drawing.SystemColors.ControlText; 161 dockPaneStripGradient1.ActiveTabGradient = tabGradient2; 162 dockPanelGradient2.EndColor = System.Drawing.SystemColors.Control; 163 dockPanelGradient2.StartColor = System.Drawing.SystemColors.Control; 164 dockPaneStripGradient1.DockStripGradient = dockPanelGradient2; 165 tabGradient3.EndColor = System.Drawing.SystemColors.ControlLight; 166 tabGradient3.StartColor = System.Drawing.SystemColors.ControlLight; 167 tabGradient3.TextColor = System.Drawing.SystemColors.ControlText; 168 dockPaneStripGradient1.InactiveTabGradient = tabGradient3; 169 dockPaneStripSkin1.DocumentGradient = dockPaneStripGradient1; 170 dockPaneStripSkin1.TextFont = new System.Drawing.Font("Segoe UI", 9F); 171 tabGradient4.EndColor = System.Drawing.SystemColors.ActiveCaption; 172 tabGradient4.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical; 173 tabGradient4.StartColor = System.Drawing.SystemColors.GradientActiveCaption; 174 tabGradient4.TextColor = System.Drawing.SystemColors.ActiveCaptionText; 175 dockPaneStripToolWindowGradient1.ActiveCaptionGradient = tabGradient4; 176 tabGradient5.EndColor = System.Drawing.SystemColors.Control; 177 tabGradient5.StartColor = System.Drawing.SystemColors.Control; 178 tabGradient5.TextColor = System.Drawing.SystemColors.ControlText; 179 dockPaneStripToolWindowGradient1.ActiveTabGradient = tabGradient5; 180 dockPanelGradient3.EndColor = System.Drawing.SystemColors.ControlLight; 181 dockPanelGradient3.StartColor = System.Drawing.SystemColors.ControlLight; 182 dockPaneStripToolWindowGradient1.DockStripGradient = dockPanelGradient3; 183 tabGradient6.EndColor = System.Drawing.SystemColors.InactiveCaption; 184 tabGradient6.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical; 185 tabGradient6.StartColor = System.Drawing.SystemColors.GradientInactiveCaption; 186 tabGradient6.TextColor = System.Drawing.SystemColors.InactiveCaptionText; 187 dockPaneStripToolWindowGradient1.InactiveCaptionGradient = tabGradient6; 188 tabGradient7.EndColor = System.Drawing.Color.Transparent; 189 tabGradient7.StartColor = System.Drawing.Color.Transparent; 190 tabGradient7.TextColor = System.Drawing.SystemColors.ControlDarkDark; 191 dockPaneStripToolWindowGradient1.InactiveTabGradient = tabGradient7; 192 dockPaneStripSkin1.ToolWindowGradient = dockPaneStripToolWindowGradient1; 193 dockPanelSkin1.DockPaneStripSkin = dockPaneStripSkin1; 194 this.resultsDockPanel.Skin = dockPanelSkin1; 195 this.resultsDockPanel.TabIndex = 0; 196 // 197 // runsTabPage 198 // 199 this.runsTabPage.Controls.Add(this.runsView); 200 this.runsTabPage.Location = new System.Drawing.Point(4, 22); 201 this.runsTabPage.Name = "runsTabPage"; 202 this.runsTabPage.Padding = new System.Windows.Forms.Padding(3); 203 this.runsTabPage.Size = new System.Drawing.Size(841, 454); 204 this.runsTabPage.TabIndex = 4; 205 this.runsTabPage.Text = "Runs"; 206 this.runsTabPage.UseVisualStyleBackColor = true; 207 // 208 // runsView 209 // 210 this.runsView.Caption = "RunCollection View"; 211 this.runsView.Content = null; 212 this.runsView.Dock = System.Windows.Forms.DockStyle.Fill; 213 this.runsView.Location = new System.Drawing.Point(3, 3); 214 this.runsView.Name = "runsView"; 215 this.runsView.ReadOnly = false; 216 this.runsView.Size = new System.Drawing.Size(835, 448); 217 this.runsView.TabIndex = 0; 120 218 // 121 219 // solutionSeedingTabPage … … 216 314 this.algorithmSuggestionLabel.Text = "Suggested Solvers:"; 217 315 // 218 // maxEvaluationsTextBox219 //220 this.maxEvaluationsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)221 | System.Windows.Forms.AnchorStyles.Right)));222 this.maxEvaluationsTextBox.Location = new System.Drawing.Point(108, 3);223 this.maxEvaluationsTextBox.Name = "maxEvaluationsTextBox";224 this.maxEvaluationsTextBox.Size = new System.Drawing.Size(741, 20);225 this.maxEvaluationsTextBox.TabIndex = 14;226 this.maxEvaluationsTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.MaxEvaluationsTextBoxOnValidating);227 //228 316 // suggestedInstancesComboBox 229 317 // … … 249 337 this.algorithmCloneButton.Click += new System.EventHandler(this.AlgorithmCloneButtonOnClick); 250 338 // 251 // runsTabPage 252 // 253 this.runsTabPage.Controls.Add(this.runsView); 254 this.runsTabPage.Location = new System.Drawing.Point(4, 22); 255 this.runsTabPage.Name = "runsTabPage"; 256 this.runsTabPage.Padding = new System.Windows.Forms.Padding(3); 257 this.runsTabPage.Size = new System.Drawing.Size(841, 454); 258 this.runsTabPage.TabIndex = 4; 259 this.runsTabPage.Text = "Runs"; 260 this.runsTabPage.UseVisualStyleBackColor = true; 261 // 262 // runsView 263 // 264 this.runsView.Caption = "RunCollection View"; 265 this.runsView.Content = null; 266 this.runsView.Dock = System.Windows.Forms.DockStyle.Fill; 267 this.runsView.Location = new System.Drawing.Point(3, 3); 268 this.runsView.Name = "runsView"; 269 this.runsView.ReadOnly = false; 270 this.runsView.Size = new System.Drawing.Size(835, 448); 271 this.runsView.TabIndex = 0; 339 // maxEvaluationsView 340 // 341 this.maxEvaluationsView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 342 | System.Windows.Forms.AnchorStyles.Right))); 343 this.maxEvaluationsView.Caption = "StringConvertibleValue View"; 344 this.maxEvaluationsView.Content = null; 345 this.maxEvaluationsView.LabelVisible = false; 346 this.maxEvaluationsView.Location = new System.Drawing.Point(91, 3); 347 this.maxEvaluationsView.Name = "maxEvaluationsView"; 348 this.maxEvaluationsView.ReadOnly = false; 349 this.maxEvaluationsView.Size = new System.Drawing.Size(758, 21); 350 this.maxEvaluationsView.TabIndex = 16; 351 // 352 // seededRunsTabPage 353 // 354 this.seededRunsTabPage.Controls.Add(this.seededRunsView); 355 this.seededRunsTabPage.Location = new System.Drawing.Point(4, 22); 356 this.seededRunsTabPage.Name = "seededRunsTabPage"; 357 this.seededRunsTabPage.Padding = new System.Windows.Forms.Padding(3); 358 this.seededRunsTabPage.Size = new System.Drawing.Size(841, 454); 359 this.seededRunsTabPage.TabIndex = 5; 360 this.seededRunsTabPage.Text = "Seeded Runs"; 361 this.seededRunsTabPage.UseVisualStyleBackColor = true; 362 // 363 // seededRunsView 364 // 365 this.seededRunsView.Caption = "RunCollection View"; 366 this.seededRunsView.Content = null; 367 this.seededRunsView.Dock = System.Windows.Forms.DockStyle.Fill; 368 this.seededRunsView.Location = new System.Drawing.Point(3, 3); 369 this.seededRunsView.Name = "seededRunsView"; 370 this.seededRunsView.ReadOnly = false; 371 this.seededRunsView.Size = new System.Drawing.Size(835, 448); 372 this.seededRunsView.TabIndex = 1; 272 373 // 273 374 // SolverView … … 275 376 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 276 377 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 378 this.Controls.Add(this.maxEvaluationsView); 277 379 this.Controls.Add(this.algorithmCloneButton); 278 380 this.Controls.Add(this.seedingStrategyPanel); … … 282 384 this.Controls.Add(this.evaluationsLimitabel); 283 385 this.Controls.Add(this.algorithmSuggestionLabel); 284 this.Controls.Add(this.maxEvaluationsTextBox);285 386 this.Controls.Add(this.suggestedInstancesComboBox); 286 387 this.Name = "SolverView"; … … 288 389 this.solverTabControl.ResumeLayout(false); 289 390 this.resultsTabPage.ResumeLayout(false); 391 this.resultsTabPage.PerformLayout(); 392 this.runsTabPage.ResumeLayout(false); 290 393 this.parametersTabPage.ResumeLayout(false); 291 394 this.operatorGraphTabPage.ResumeLayout(false); 292 this. runsTabPage.ResumeLayout(false);395 this.seededRunsTabPage.ResumeLayout(false); 293 396 this.ResumeLayout(false); 294 397 this.PerformLayout(); … … 301 404 private MainForm.WindowsForms.DragOverTabControl solverTabControl; 302 405 private System.Windows.Forms.TabPage resultsTabPage; 303 private Optimization.Views.ResultCollectionView solverResultsView;304 406 private System.Windows.Forms.TabPage solutionSeedingTabPage; 305 407 private System.Windows.Forms.TabPage parametersTabPage; … … 311 413 private System.Windows.Forms.Label evaluationsLimitabel; 312 414 private System.Windows.Forms.Label algorithmSuggestionLabel; 313 private System.Windows.Forms.TextBox maxEvaluationsTextBox;314 415 private System.Windows.Forms.ComboBox suggestedInstancesComboBox; 315 416 private System.Windows.Forms.Button algorithmCloneButton; 316 417 private System.Windows.Forms.TabPage runsTabPage; 317 418 private Optimization.Views.RunCollectionView runsView; 419 private Data.Views.StringConvertibleValueView maxEvaluationsView; 420 private WeifenLuo.WinFormsUI.Docking.DockPanel resultsDockPanel; 421 private System.Windows.Forms.CheckBox showOnlyFinalResultCheckBox; 422 private System.Windows.Forms.TabPage seededRunsTabPage; 423 private Optimization.Views.RunCollectionView seededRunsView; 318 424 } 319 425 } -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views/SolverView.cs
r13721 r13722 28 28 using HeuristicLab.OptimizationExpertSystem.Common; 29 29 using System; 30 using System.ComponentModel;31 30 using System.Windows.Forms; 32 31 33 32 namespace HeuristicLab.OptimizationExpertSystem { 34 33 [View("Solver View")] 35 [Content(typeof( ExpertSystem), IsDefaultView = false)]36 public partial class SolverView : ExpertSystemViewBase {34 [Content(typeof(KnowledgeCenter), IsDefaultView = false)] 35 public partial class SolverView : KnowledgeCenterViewBase { 37 36 private EnumValueView<SeedingStrategyTypes> seedingStrategyView; 38 37 private CheckedItemListView<IScope> seedingSolutionsView; … … 60 59 try { 61 60 if (Content == null) { 62 maxEvaluations TextBox.Text = string.Empty;61 maxEvaluationsView.Content = null; 63 62 solverParametersView.Content = null; 64 solverResultsView.Content = null;65 63 runsView.Content = null; 64 seededRunsView.Content = null; 66 65 seedingStrategyView.Content = null; 67 66 seedingSolutionsView.Content = null; 68 67 } else { 69 maxEvaluations TextBox.Text = Content.MaximumEvaluations.ToString();70 runsView.Content = Content. Runs;71 s olverResultsView.Content = Content.CurrentResult;68 maxEvaluationsView.Content = Content.MaximumEvaluations; 69 runsView.Content = Content.InstanceRuns; 70 seededRunsView.Content = Content.SeededRuns; 72 71 seedingStrategyView.Content = Content.SeedingStrategy; 73 72 seedingSolutionsView.Content = Content.SolutionSeedingPool; … … 79 78 protected override void SetEnabledStateOfControls() { 80 79 base.SetEnabledStateOfControls(); 81 maxEvaluationsTextBox.Enabled = Content != null && !ReadOnly && !Locked;82 80 suggestedInstancesComboBox.Enabled = Content != null && !ReadOnly && !Locked; 83 81 algorithmStartButton.Enabled = Content != null && !ReadOnly && !Locked && suggestedInstancesComboBox.SelectedIndex >= 0; … … 86 84 } 87 85 88 protected override void OnPropertyChanged(string propertyName) { 89 base.OnPropertyChanged(propertyName); 90 SuppressEvents = true; 91 try { 92 switch (propertyName) { 93 case "MaximumEvaluations": maxEvaluationsTextBox.Text = Content.MaximumEvaluations.ToString(); break; 94 case "CurrentResult": solverResultsView.Content = Content.CurrentResult; break; 95 } 96 } finally { SuppressEvents = false; } 97 SetEnabledStateOfControls(); 86 protected override void OnAlgorithmInstanceStarted(IAlgorithm algorithm) { 87 base.OnAlgorithmInstanceStarted(algorithm); 88 var form = new AlgorithmControlForm(algorithm, showOnlyFinalResultCheckBox.Checked); 89 form.Show(resultsDockPanel); 98 90 } 99 91 … … 116 108 if (prevNewIndex >= 0) { 117 109 suggestedInstancesComboBox.SelectedIndex = prevNewIndex; 118 }119 }120 121 private void MaxEvaluationsTextBoxOnValidating(object sender, CancelEventArgs e) {122 if (SuppressEvents) return;123 if (InvokeRequired) {124 Invoke((Action<object, CancelEventArgs>)MaxEvaluationsTextBoxOnValidating, sender, e);125 return;126 }127 int value;128 if (!int.TryParse(maxEvaluationsTextBox.Text, out value)) {129 e.Cancel = !maxEvaluationsTextBox.ReadOnly && maxEvaluationsTextBox.Enabled;130 //errorProvider.SetError(maxEvaluationsTextBox, "Please enter a valid integer number.");131 } else {132 Content.MaximumEvaluations = value;133 e.Cancel = false;134 //errorProvider.SetError(maxEvaluationsTextBox, null);135 110 } 136 111 } -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views/UnderstandingProblemInstanceView.cs
r13721 r13722 30 30 namespace HeuristicLab.OptimizationExpertSystem { 31 31 [View("Understanding Problem Instance")] 32 [Content(typeof( ExpertSystem), IsDefaultView = false)]33 public partial class UnderstandingProblemInstanceView : ExpertSystemViewBase {32 [Content(typeof(KnowledgeCenter), IsDefaultView = false)] 33 public partial class UnderstandingProblemInstanceView : KnowledgeCenterViewBase { 34 34 public UnderstandingProblemInstanceView() { 35 35 InitializeComponent(); -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views/UnderstandingSolutionsView.Designer.cs
r13721 r13722 66 66 this.solutionsNetworkTabPage = new System.Windows.Forms.TabPage(); 67 67 this.solutionsNetworkChart = new HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart(); 68 this.pearsonsRSquaredLabel = new System.Windows.Forms.Label(); 69 this.fdcPearsonLabel = new System.Windows.Forms.Label(); 70 this.spearmansRankLabel = new System.Windows.Forms.Label(); 71 this.fdcSpearmanLabel = new System.Windows.Forms.Label(); 68 72 this.solutionsTabControl.SuspendLayout(); 69 73 this.solutionsQualityTabPage.SuspendLayout(); … … 209 213 // solutionsFdcTabPage 210 214 // 215 this.solutionsFdcTabPage.Controls.Add(this.fdcSpearmanLabel); 216 this.solutionsFdcTabPage.Controls.Add(this.fdcPearsonLabel); 217 this.solutionsFdcTabPage.Controls.Add(this.spearmansRankLabel); 218 this.solutionsFdcTabPage.Controls.Add(this.pearsonsRSquaredLabel); 211 219 this.solutionsFdcTabPage.Controls.Add(this.fdcBetweenBestCheckBox); 212 220 this.solutionsFdcTabPage.Controls.Add(this.solutionsFdcViewHost); … … 301 309 this.solutionsNetworkChart.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.SolutionsNetworkChartOnMouseDoubleClick); 302 310 // 303 // UnderstandingSolutions 311 // pearsonsRSquaredLabel 312 // 313 this.pearsonsRSquaredLabel.AutoSize = true; 314 this.pearsonsRSquaredLabel.Location = new System.Drawing.Point(436, 7); 315 this.pearsonsRSquaredLabel.Name = "pearsonsRSquaredLabel"; 316 this.pearsonsRSquaredLabel.Size = new System.Drawing.Size(65, 13); 317 this.pearsonsRSquaredLabel.TabIndex = 3; 318 this.pearsonsRSquaredLabel.Text = "Pearson\'s r²:"; 319 // 320 // fdcPearsonLabel 321 // 322 this.fdcPearsonLabel.AutoSize = true; 323 this.fdcPearsonLabel.Location = new System.Drawing.Point(512, 7); 324 this.fdcPearsonLabel.Name = "fdcPearsonLabel"; 325 this.fdcPearsonLabel.Size = new System.Drawing.Size(10, 13); 326 this.fdcPearsonLabel.TabIndex = 4; 327 this.fdcPearsonLabel.Text = "-"; 328 // 329 // spearmansRankLabel 330 // 331 this.spearmansRankLabel.AutoSize = true; 332 this.spearmansRankLabel.Location = new System.Drawing.Point(281, 7); 333 this.spearmansRankLabel.Name = "spearmansRankLabel"; 334 this.spearmansRankLabel.Size = new System.Drawing.Size(74, 13); 335 this.spearmansRankLabel.TabIndex = 3; 336 this.spearmansRankLabel.Text = "Spearman\'s ρ:"; 337 // 338 // fdcSpearmanLabel 339 // 340 this.fdcSpearmanLabel.AutoSize = true; 341 this.fdcSpearmanLabel.Location = new System.Drawing.Point(357, 7); 342 this.fdcSpearmanLabel.Name = "fdcSpearmanLabel"; 343 this.fdcSpearmanLabel.Size = new System.Drawing.Size(10, 13); 344 this.fdcSpearmanLabel.TabIndex = 4; 345 this.fdcSpearmanLabel.Text = "-"; 346 // 347 // UnderstandingSolutionsView 304 348 // 305 349 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); … … 310 354 this.Controls.Add(this.similarityComboBox); 311 355 this.Controls.Add(this.solutionsTabControl); 312 this.Name = "UnderstandingSolutions ";356 this.Name = "UnderstandingSolutionsView"; 313 357 this.Size = new System.Drawing.Size(732, 505); 314 358 this.solutionsTabControl.ResumeLayout(false); … … 343 387 private System.Windows.Forms.TabPage solutionsNetworkTabPage; 344 388 private Visualization.ChartControlsExtensions.EnhancedChart solutionsNetworkChart; 389 private System.Windows.Forms.Label fdcPearsonLabel; 390 private System.Windows.Forms.Label pearsonsRSquaredLabel; 391 private System.Windows.Forms.Label fdcSpearmanLabel; 392 private System.Windows.Forms.Label spearmansRankLabel; 345 393 } 346 394 } -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views/UnderstandingSolutionsView.cs
r13721 r13722 36 36 namespace HeuristicLab.OptimizationExpertSystem { 37 37 [View("Understanding Solutions")] 38 [Content(typeof( ExpertSystem), IsDefaultView = false)]39 public partial class UnderstandingSolutionsView : ExpertSystemViewBase {38 [Content(typeof(KnowledgeCenter), IsDefaultView = false)] 39 public partial class UnderstandingSolutionsView : KnowledgeCenterViewBase { 40 40 protected virtual bool SuppressEvents { get; set; } 41 41 … … 143 143 try { 144 144 solutionsFdcViewHost.Content = null; 145 fdcSpearmanLabel.Text = "-"; 146 fdcPearsonLabel.Text = "-"; 145 147 var solutionScopes = GetSolutionScopes(); 146 148 var points = new List<Point2D<double>>(); … … 166 168 } 167 169 } 170 var xs = points.Select(p => p.X).ToArray(); 171 var ys = points.Select(p => p.Y).ToArray(); 172 var scorr = alglib.spearmancorr2(xs, ys); 173 var pcorr = alglib.pearsoncorr2(xs, ys); 174 pcorr = pcorr * pcorr; 175 fdcSpearmanLabel.Text = scorr.ToString("F2"); 176 fdcPearsonLabel.Text = pcorr.ToString("F2"); 177 168 178 var splot = new ScatterPlot("Fitness-Distance", ""); 169 179 splot.VisualProperties.XAxisTitle = "Absolute Fitness Difference"; 180 splot.VisualProperties.XAxisMinimumAuto = false; 170 181 splot.VisualProperties.XAxisMinimumFixedValue = 0.0; 171 splot.VisualProperties.XAxisMinimumAuto = false;172 182 splot.VisualProperties.YAxisTitle = "Solution Distance"; 183 splot.VisualProperties.YAxisMinimumAuto = false; 173 184 splot.VisualProperties.YAxisMinimumFixedValue = 0.0; 174 splot.VisualProperties.YAxisM inimumAuto = false;185 splot.VisualProperties.YAxisMaximumAuto = false; 175 186 splot.VisualProperties.YAxisMaximumFixedValue = 1.0; 176 splot.VisualProperties.YAxisMaximumAuto = false;177 187 var row = new ScatterPlotDataRow("Fdc", "", points); 178 row.VisualProperties.PointSize = 7; 188 row.VisualProperties.PointSize = 10; 189 row.VisualProperties.ShowRegressionLine = true; 179 190 splot.Rows.Add(row); 180 191 solutionsFdcViewHost.Content = splot;
Note: See TracChangeset
for help on using the changeset viewer.