Changeset 13722
- Timestamp:
- 03/23/16 22:51:27 (9 years ago)
- Location:
- branches/PerformanceComparison
- Files:
-
- 5 added
- 11 edited
- 23 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/PerformanceComparison/HeuristicLab.Analysis.Views/3.3/HeuristicLab.Analysis.Views-3.3.csproj
r12764 r13722 105 105 </PropertyGroup> 106 106 <ItemGroup> 107 <Reference Include="ALGLIB-3.7.0, Version=3.7.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 108 <SpecificVersion>False</SpecificVersion> 109 <HintPath>..\..\..\..\trunk\sources\bin\ALGLIB-3.7.0.dll</HintPath> 110 <Private>False</Private> 111 </Reference> 107 112 <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 108 113 <SpecificVersion>False</SpecificVersion> … … 309 314 <EmbeddedResource Include="HeatMapView.resx"> 310 315 <DependentUpon>HeatMapView.cs</DependentUpon> 316 </EmbeddedResource> 317 <EmbeddedResource Include="ScatterPlotDataRowVisualPropertiesControl.resx"> 318 <DependentUpon>ScatterPlotDataRowVisualPropertiesControl.cs</DependentUpon> 311 319 </EmbeddedResource> 312 320 </ItemGroup> -
branches/PerformanceComparison/HeuristicLab.Analysis.Views/3.3/Plugin.cs.frame
r13475 r13722 28 28 [Plugin("HeuristicLab.Analysis.Views", "3.3.13.$WCREV$")] 29 29 [PluginFile("HeuristicLab.Analysis.Views-3.3.dll", PluginFileType.Assembly)] 30 [PluginDependency("HeuristicLab.ALGLIB", "3.7.0")] 30 31 [PluginDependency("HeuristicLab.Analysis", "3.3")] 31 32 [PluginDependency("HeuristicLab.Collections", "3.3")] -
branches/PerformanceComparison/HeuristicLab.Analysis.Views/3.3/ScatterPlotDataRowVisualPropertiesControl.Designer.cs
r12012 r13722 56 56 this.label9 = new System.Windows.Forms.Label(); 57 57 this.label7 = new System.Windows.Forms.Label(); 58 this.label4 = new System.Windows.Forms.Label(); 59 this.regressionLineCheckBox = new System.Windows.Forms.CheckBox(); 58 60 ((System.ComponentModel.ISupportInitialize)(this.pointSizeNumericUpDown)).BeginInit(); 59 61 this.SuspendLayout(); … … 171 173 this.label7.Text = "&Visible in Legend:"; 172 174 // 175 // label4 176 // 177 this.label4.AutoSize = true; 178 this.label4.Location = new System.Drawing.Point(3, 136); 179 this.label4.Name = "label4"; 180 this.label4.Size = new System.Drawing.Size(86, 13); 181 this.label4.TabIndex = 2; 182 this.label4.Text = "&Regression Line:"; 183 // 184 // regressionLineCheckBox 185 // 186 this.regressionLineCheckBox.AutoSize = true; 187 this.regressionLineCheckBox.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; 188 this.regressionLineCheckBox.Location = new System.Drawing.Point(99, 136); 189 this.regressionLineCheckBox.Name = "regressionLineCheckBox"; 190 this.regressionLineCheckBox.Size = new System.Drawing.Size(15, 14); 191 this.regressionLineCheckBox.TabIndex = 3; 192 this.regressionLineCheckBox.UseVisualStyleBackColor = true; 193 this.regressionLineCheckBox.CheckedChanged += new System.EventHandler(this.regressionLineCheckBox_CheckedChanged); 194 // 173 195 // ScatterPlotDataRowVisualPropertiesControl 174 196 // 175 197 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 176 198 this.Controls.Add(this.pointSizeNumericUpDown); 199 this.Controls.Add(this.regressionLineCheckBox); 177 200 this.Controls.Add(this.isVisibleInLegendCheckBox); 178 201 this.Controls.Add(this.label9); 179 202 this.Controls.Add(this.label3); 203 this.Controls.Add(this.label4); 180 204 this.Controls.Add(this.pointStyleComboBox); 181 205 this.Controls.Add(this.label7); … … 185 209 this.Controls.Add(this.colorButton); 186 210 this.Name = "ScatterPlotDataRowVisualPropertiesControl"; 187 this.Size = new System.Drawing.Size(342, 1 35);211 this.Size = new System.Drawing.Size(342, 157); 188 212 ((System.ComponentModel.ISupportInitialize)(this.pointSizeNumericUpDown)).EndInit(); 189 213 this.ResumeLayout(false); … … 205 229 private System.Windows.Forms.Label label9; 206 230 private System.Windows.Forms.Label label3; 231 private System.Windows.Forms.Label label4; 232 private System.Windows.Forms.CheckBox regressionLineCheckBox; 207 233 } 208 234 } -
branches/PerformanceComparison/HeuristicLab.Analysis.Views/3.3/ScatterPlotDataRowVisualPropertiesControl.cs
r12012 r13722 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 20 20 #endregion 21 21 22 using HeuristicLab.MainForm; 22 23 using System; 23 24 using System.Drawing; 24 25 using System.Windows.Forms; 25 using HeuristicLab.MainForm;26 using HeuristicLab.MainForm.WindowsForms;27 26 28 27 namespace HeuristicLab.Analysis.Views { … … 57 56 pointSizeNumericUpDown.Value = 1; 58 57 displayNameTextBox.Text = String.Empty; 58 regressionLineCheckBox.Checked = false; 59 59 } else { 60 60 displayNameTextBox.Text = Content.DisplayName; … … 69 69 pointSizeNumericUpDown.Value = Content.PointSize; 70 70 isVisibleInLegendCheckBox.Checked = Content.IsVisibleInLegend; 71 regressionLineCheckBox.Checked = Content.ShowRegressionLine; 71 72 } 72 73 } … … 82 83 pointSizeNumericUpDown.Enabled = Content != null; 83 84 displayNameTextBox.Enabled = Content != null; 85 regressionLineCheckBox.Enabled = Content != null; 84 86 } 85 87 … … 121 123 } 122 124 } 125 126 private void regressionLineCheckBox_CheckedChanged(object sender, EventArgs e) { 127 if (!SuppressEvents && Content != null) { 128 Content.ShowRegressionLine = regressionLineCheckBox.Checked; 129 } 130 } 123 131 #endregion 124 132 } -
branches/PerformanceComparison/HeuristicLab.Analysis.Views/3.3/ScatterPlotView.cs
r12679 r13722 20 20 #endregion 21 21 22 using HeuristicLab.Collections; 23 using HeuristicLab.Common; 24 using HeuristicLab.Core.Views; 25 using HeuristicLab.MainForm; 22 26 using System; 23 27 using System.Collections.Generic; … … 26 30 using System.Windows.Forms; 27 31 using System.Windows.Forms.DataVisualization.Charting; 28 using HeuristicLab.Collections;29 using HeuristicLab.Common;30 using HeuristicLab.Core.Views;31 using HeuristicLab.MainForm;32 32 33 33 namespace HeuristicLab.Analysis.Views { … … 141 141 DeregisterScatterPlotDataRowEvents(row); 142 142 Series series = chart.Series[row.Name]; 143 if (chart.Series.IsUniqueName(series.Name + ".lr")) 144 chart.Series.Remove(chart.Series[series.Name + ".lr"]); 143 145 chart.Series.Remove(series); 144 146 if (invisibleSeries.Contains(series)) … … 460 462 461 463 private void FillSeriesWithRowValues(Series series, ScatterPlotDataRow row) { 464 if (row.VisualProperties.ShowRegressionLine) { 465 var xs = row.Points.Select(p => p.X).ToArray(); 466 var xsMin = xs.Min(); 467 var xsMax = xs.Max(); 468 var ys = row.Points.Select(p => p.Y).ToArray(); 469 var corr = alglib.pearsoncorr2(xs, ys); 470 var slope = corr * ys.StandardDeviation() / xs.StandardDeviation(); 471 if (!double.IsNaN(slope) && !double.IsInfinity(slope)) { 472 var off = ys.Average() - slope * xs.Average(); 473 474 Series lrSeries; 475 if (chart.Series.IsUniqueName(series.Name + ".lr")) { 476 lrSeries = new Series(series.Name + ".lr") {IsVisibleInLegend = false, ChartType = SeriesChartType.FastLine}; 477 chart.Series.Add(lrSeries); 478 } else lrSeries = chart.Series[series.Name + ".lr"]; 479 lrSeries.Points.Clear(); 480 lrSeries.Points.AddXY(xsMin, slope * xsMin + off); 481 lrSeries.Points.AddXY(xsMax, slope * xsMax + off); 482 } 483 } else if (!chart.Series.IsUniqueName(series.Name + ".lr")) 484 chart.Series.Remove(chart.Series[series.Name + ".lr"]); 485 462 486 for (int i = 0; i < row.Points.Count; i++) { 463 487 var value = row.Points[i]; -
branches/PerformanceComparison/HeuristicLab.Analysis/3.3/DataVisualization/ScatterPlotDataRowVisualProperties.cs
r12012 r13722 20 20 #endregion 21 21 22 using HeuristicLab.Common; 23 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 22 24 using System; 23 25 using System.ComponentModel; 24 26 using System.Drawing; 25 using HeuristicLab.Common;26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;27 27 28 28 namespace HeuristicLab.Analysis { … … 101 101 } 102 102 } 103 private bool showRegressionLine; 104 public bool ShowRegressionLine { 105 get { return showRegressionLine; } 106 set { 107 if (showRegressionLine == value) return; 108 showRegressionLine = value; 109 OnPropertyChanged("ShowRegressionLine"); 110 } 111 } 103 112 104 113 #region Persistence Properties … … 128 137 set { displayName = value; } 129 138 } 139 [Storable(Name = "ShowRegressionLine")] 140 private bool StorableShowRegressionLine { 141 get { return showRegressionLine; } 142 set { showRegressionLine = value; } 143 } 130 144 #endregion 131 145 … … 139 153 this.displayName = original.displayName; 140 154 this.isVisibleInLegend = original.isVisibleInLegend; 155 this.showRegressionLine = original.showRegressionLine; 141 156 } 142 157 public ScatterPlotDataRowVisualProperties() { … … 146 161 displayName = String.Empty; 147 162 isVisibleInLegend = true; 163 showRegressionLine = false; 148 164 } 149 165 public ScatterPlotDataRowVisualProperties(string displayName) -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Common/3.3/HeuristicLab.OptimizationExpertSystem.Common-3.3.csproj
r13713 r13722 143 143 </ItemGroup> 144 144 <ItemGroup> 145 <Compile Include=" ExpertSystem.cs" />145 <Compile Include="KnowledgeCenter.cs" /> 146 146 <Compile Include="Plugin.cs" /> 147 147 <Compile Include="SeedingStrategyTypes.cs" /> -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Common/3.3/KnowledgeCenter.cs
r13721 r13722 28 28 using HeuristicLab.MainForm; 29 29 using HeuristicLab.Optimization; 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;31 30 using HeuristicLab.Persistence.Default.Xml; 32 31 using System; 33 32 using System.Collections.Generic; 34 using System.ComponentModel;35 33 using System.Drawing; 36 34 using System.IO; … … 43 41 44 42 namespace HeuristicLab.OptimizationExpertSystem.Common { 45 [Item(" Expert-System", "Currently in experimental phase, an expert system that makes algorithm suggestions based on fitness landscape analysis features and an optimization knowledge base.")]43 [Item("Knowledge Center", "Currently in experimental phase, an expert system that makes algorithm suggestions based on fitness landscape analysis features and an optimization knowledge base.")] 46 44 [Creatable(CreatableAttribute.Categories.TestingAndAnalysis, Priority = 119)] 47 public sealed class ExpertSystem : NamedItem, IStorableContent, INotifyPropertyChanged{45 public sealed class KnowledgeCenter : IContent { 48 46 49 47 public string Filename { get; set; } … … 53 51 } 54 52 55 [Storable] 56 private int maximumEvaluations; 57 public int MaximumEvaluations { 53 private IntValue maximumEvaluations; 54 public IntValue MaximumEvaluations { 58 55 get { return maximumEvaluations; } 59 set { 60 if (maximumEvaluations == value) return; 61 maximumEvaluations = value; 62 OnPropertyChanged("MaximumEvaluations"); 63 UpdateSuggestions(); 64 } 65 } 66 67 [Storable] 68 private RunCollection runs; 69 public RunCollection Runs { 70 get { return runs; } 71 } 72 73 [Storable] 56 } 57 58 private RunCollection instanceRuns; 59 public RunCollection InstanceRuns { 60 get { return instanceRuns; } 61 } 62 63 private RunCollection seededRuns; 64 public RunCollection SeededRuns { 65 get { return seededRuns; } 66 } 67 74 68 private RunCollection knowledgeBase; 75 69 public RunCollection KnowledgeBase { 76 70 get { return knowledgeBase; } 77 set { 78 if (knowledgeBase == value) return; 79 knowledgeBase = value; 80 OnPropertyChanged("KnowledgeBase"); 81 } 82 } 83 84 [Storable] 71 } 72 85 73 private SingleObjectiveOKBProblem problem; 86 74 public SingleObjectiveOKBProblem Problem { 87 75 get { return problem; } 88 set { 89 if (problem == value) return; 90 problem = value; 91 OnPropertyChanged("Problem"); 92 UpdateSuggestions(); 93 } 94 } 95 96 [Storable] 76 } 77 97 78 private ItemList<IAlgorithm> suggestedInstances; 98 79 private ReadOnlyItemList<IAlgorithm> readOnlySuggestedInstances; … … 101 82 } 102 83 103 [Storable]104 84 private RunCollection problemInstances; 105 85 public RunCollection ProblemInstances { 106 86 get { return problemInstances; } 107 set { 108 if (problemInstances == value) return; 109 problemInstances = value; 110 OnPropertyChanged("ProblemInstances"); 111 } 112 } 113 114 [Storable] 115 private ResultCollection currentResult; 116 public ResultCollection CurrentResult { 117 get { return currentResult; } 118 set { 119 if (currentResult == value) return; 120 currentResult = value; 121 OnPropertyChanged("CurrentResult"); 122 } 123 } 124 125 [Storable] 87 } 88 126 89 private CheckedItemList<IScope> solutionSeedingPool; 127 90 public CheckedItemList<IScope> SolutionSeedingPool { 128 91 get { return solutionSeedingPool; } 129 set { solutionSeedingPool = value; } 130 } 131 132 [Storable] 92 } 93 133 94 private EnumValue<SeedingStrategyTypes> seedingStrategy; 134 95 public EnumValue<SeedingStrategyTypes> SeedingStrategy { 135 96 get { return seedingStrategy; } 136 set { seedingStrategy = value; }137 97 } 138 98 139 [Storable]140 99 private BidirectionalLookup<long, IRun> algorithmId2RunMapping; 141 [Storable]142 100 private BidirectionalDictionary<long, IAlgorithm> algorithmId2AlgorithmInstanceMapping; 143 101 144 [Storable]145 102 private Run currentInstance; 146 103 147 104 private bool Maximization { 148 get { 149 return Problem != null && Problem.ProblemId >= 0 && ((IValueParameter<BoolValue>)Problem.MaximizationParameter).Value.Value; 150 } 151 } 152 153 [StorableConstructor] 154 private ExpertSystem(bool deserializing) : base(deserializing) { } 155 private ExpertSystem(ExpertSystem original, Cloner cloner) 156 : base(original, cloner) { 157 runs = cloner.Clone(original.runs); 158 knowledgeBase = cloner.Clone(original.knowledgeBase); 159 suggestedInstances = cloner.Clone(original.suggestedInstances); 160 readOnlySuggestedInstances = suggestedInstances.AsReadOnly(); 161 problemInstances = cloner.Clone(original.problemInstances); 162 problem = cloner.Clone(original.problem); 163 algorithmId2RunMapping = new BidirectionalLookup<long, IRun>(); 164 foreach (var kvp in original.algorithmId2RunMapping.FirstEnumerable) { 165 algorithmId2RunMapping.AddRangeFirst(kvp.Key, kvp.Select(cloner.Clone)); 166 } 167 algorithmId2AlgorithmInstanceMapping = new BidirectionalDictionary<long, IAlgorithm>(); 168 foreach (var kvp in original.algorithmId2AlgorithmInstanceMapping) { 169 algorithmId2AlgorithmInstanceMapping.Add(kvp.Key, cloner.Clone(kvp.Value)); 170 } 171 currentResult = cloner.Clone(original.currentResult); 172 solutionSeedingPool = cloner.Clone(original.solutionSeedingPool); 173 seedingStrategy = cloner.Clone(original.seedingStrategy); 174 currentInstance = cloner.Clone(original.currentInstance); 175 RegisterEventHandlers(); 176 } 177 public ExpertSystem() { 178 Name = ItemName; 179 Description = ItemDescription; 180 runs = new RunCollection(); 105 get { return Problem != null && Problem.ProblemId >= 0 && ((IValueParameter<BoolValue>)Problem.MaximizationParameter).Value.Value; } 106 } 107 108 public KnowledgeCenter() { 109 maximumEvaluations = new IntValue(0); 110 instanceRuns = new RunCollection(); 181 111 knowledgeBase = new RunCollection(); 182 112 suggestedInstances = new ItemList<IAlgorithm>(); … … 195 125 } 196 126 197 public override IDeepCloneable Clone(Cloner cloner) {198 return new ExpertSystem(this, cloner);199 }200 201 [StorableHook(HookType.AfterDeserialization)]202 private void AfterDeserialization() {203 readOnlySuggestedInstances = suggestedInstances.AsReadOnly();204 RegisterEventHandlers();205 }206 207 127 private void RegisterEventHandlers() { 128 maximumEvaluations.ValueChanged += MaximumEvaluationsOnValueChanged; 208 129 problem.ProblemChanged += ProblemOnProblemChanged; 209 130 problem.Solutions.ItemsAdded += ProblemSolutionsChanged; … … 211 132 problem.Solutions.ItemsRemoved += ProblemSolutionsChanged; 212 133 problem.Solutions.CollectionReset += ProblemSolutionsChanged; 213 runs.CollectionReset += InformationChanged;214 runs.ItemsAdded += InformationChanged;215 runs.ItemsRemoved += InformationChanged;216 runs.Reset += InformationChanged;217 runs.UpdateOfRunsInProgressChanged += InformationChanged;134 instanceRuns.CollectionReset += InformationChanged; 135 instanceRuns.ItemsAdded += InformationChanged; 136 instanceRuns.ItemsRemoved += InformationChanged; 137 instanceRuns.Reset += InformationChanged; 138 instanceRuns.UpdateOfRunsInProgressChanged += InformationChanged; 218 139 knowledgeBase.CollectionReset += InformationChanged; 219 140 knowledgeBase.ItemsAdded += InformationChanged; 220 141 knowledgeBase.ItemsRemoved += InformationChanged; 142 } 143 144 private void MaximumEvaluationsOnValueChanged(object sender, EventArgs eventArgs) { 145 UpdateSuggestions(); 221 146 } 222 147 … … 372 297 }; 373 298 374 public Task StartAlgorithmAsync(int index) { 299 public Task<ResultCollection> StartAlgorithmAsync(int index) { 300 return StartAlgorithmAsync(index, CancellationToken.None); 301 } 302 303 public Task<ResultCollection> StartAlgorithmAsync(int index, CancellationToken cancellation) { 375 304 var selectedInstance = suggestedInstances[index]; 376 305 var algorithmClone = (IAlgorithm)selectedInstance.Clone(); … … 378 307 if (problemClone == null) throw new InvalidOperationException("Problem is not of type " + typeof(ISingleObjectiveHeuristicOptimizationProblem).FullName); 379 308 // TODO: It is assumed the problem instance by default is configured using no preexisting solution creator 380 if (SeedingStrategy.Value != SeedingStrategyTypes.NoSeeding) { 309 var seedingStrategyLocal = SeedingStrategy.Value; 310 if (seedingStrategyLocal != SeedingStrategyTypes.NoSeeding) { 381 311 if (!SolutionSeedingPool.CheckedItems.Any()) throw new InvalidOperationException("There are no solutions selected for seeding."); 382 312 // TODO: It would be necessary to specify the solution creator somewhere (property and GUI) … … 384 314 if (seedingCreator == null) throw new InvalidOperationException("The problem does not contain a solution creator that allows seeding."); 385 315 seedingCreator.PreexistingSolutionsParameter.Value.Replace(SolutionSeedingPool.CheckedItems.Select(x => x.Value)); 386 seedingCreator.SampleFromPreexistingParameter.Value.Value = SeedingStrategy.Value== SeedingStrategyTypes.SeedBySampling;316 seedingCreator.SampleFromPreexistingParameter.Value.Value = seedingStrategyLocal == SeedingStrategyTypes.SeedBySampling; 387 317 // TODO: WHY!? WHY??!? 388 318 ((dynamic)problemClone.SolutionCreatorParameter).Value = (dynamic)seedingCreator; … … 395 325 var maxEvalParam = stopParam as IValueParameter<Data.IntValue>; 396 326 if (maxEvalParam != null) { 397 maxEvalParam.Value.Value = MaximumEvaluations ;327 maxEvalParam.Value.Value = MaximumEvaluations.Value; 398 328 monitorStop = false; 399 329 } … … 406 336 #region EventHandler closures 407 337 EventHandler exeStateChanged = (sender, e) => { 408 if (algorithmClone.ExecutionState == ExecutionState.Started) { 409 CurrentResult = algorithmClone.Results; 410 } else if (algorithmClone.ExecutionState == ExecutionState.Stopped) { 338 if (algorithmClone.ExecutionState == ExecutionState.Stopped) { 411 339 foreach (var solution in algorithmClone.Results.Where(x => x.Name.ToLower().Contains("solution")).Select(x => x.Value).OfType<IScope>()) { 412 340 Problem.Solutions.Add(new SingleObjectiveOKBSolution(Problem.ProblemId) { … … 415 343 }); 416 344 } 417 Runs.Add(algorithmClone.Runs.Last()); 345 if (seedingStrategyLocal == SeedingStrategyTypes.NoSeeding) { 346 InstanceRuns.Add(algorithmClone.Runs.Last()); 347 } else SeededRuns.Add(algorithmClone.Runs.Last()); 418 348 waitHandle.Set(); 419 349 } … … 428 358 if (!algorithmClone.Results.TryGetValue("EvaluatedSolutions", out evalSolResult) || !(evalSolResult.Value is Data.IntValue)) return; 429 359 var evalSols = ((Data.IntValue)evalSolResult.Value).Value; 430 if (evalSols >= MaximumEvaluations && algorithmClone.ExecutionState == ExecutionState.Started)360 if (evalSols >= MaximumEvaluations.Value && algorithmClone.ExecutionState == ExecutionState.Started) 431 361 algorithmClone.Stop(); 432 362 }; … … 439 369 return Task.Factory.StartNew(() => { 440 370 algorithmClone.Start(); 441 waitHandle.WaitOne(); 371 OnAlgorithmInstanceStarted(algorithmClone); 372 var cancelRequested = false; 373 while (!waitHandle.WaitOne(200)) { 374 if (cancellation.IsCancellationRequested) { 375 cancelRequested = true; 376 break; 377 } 378 } 379 if (cancelRequested) { 380 try { algorithmClone.Stop(); } catch { } // ignore race condition if it is stopped in the meantime 381 waitHandle.WaitOne(); 382 } 442 383 waitHandle.Dispose(); 443 }); 444 } 445 446 public void StartAlgorithm(int index) { 447 StartAlgorithmAsync(index).Wait(); 384 return algorithmClone.Results; 385 }, TaskCreationOptions.LongRunning); 386 } 387 388 public ResultCollection StartAlgorithm(int index, CancellationToken cancellation) { 389 var task = StartAlgorithmAsync(index, cancellation); 390 task.Wait(cancellation); 391 return task.Result; 448 392 } 449 393 … … 597 541 } 598 542 } 599 KnowledgeBase = new RunCollection(runList); 543 try { 544 KnowledgeBase.UpdateOfRunsInProgress = true; 545 KnowledgeBase.Clear(); 546 KnowledgeBase.AddRange(runList); 547 } finally { KnowledgeBase.UpdateOfRunsInProgress = false; } 600 548 } finally { progress.Finish(); ProblemInstances.UpdateOfRunsInProgress = false; } 601 549 UpdateInstanceProjection(); … … 616 564 var performanceGraph = ((IndexedDataTable<double>)run.Results["QualityPerEvaluations"]); 617 565 try { 618 avgQuality += performanceGraph.Rows.First().Values.TakeWhile(x => x.Item1 < MaximumEvaluations ).Last().Item2 / bkQuality;566 avgQuality += performanceGraph.Rows.First().Values.TakeWhile(x => x.Item1 < MaximumEvaluations.Value).Last().Item2 / bkQuality; 619 567 counter++; 620 568 } catch { … … 632 580 } 633 581 634 public event PropertyChangedEventHandler PropertyChanged;635 private void OnPropertyChanged(string propertyName) {636 var handler = PropertyChanged;637 if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));638 }639 640 582 public event EventHandler<EventArgs<IProgress>> DownloadStarted; 641 583 private void OnDownloadStarted(IProgress progress) { … … 643 585 if (handler != null) handler(this, new EventArgs<IProgress>(progress)); 644 586 } 587 588 public event EventHandler<EventArgs<IAlgorithm>> AlgorithmInstanceStarted; 589 private void OnAlgorithmInstanceStarted(IAlgorithm instance) { 590 var handler = AlgorithmInstanceStarted; 591 if (handler != null) handler(this, new EventArgs<IAlgorithm>(instance)); 592 } 645 593 } 646 594 } -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/HeuristicLab.OptimizationExpertSystem-3.3.csproj
r13720 r13722 174 174 <Reference Include="System.Data" /> 175 175 <Reference Include="System.Xml" /> 176 </ItemGroup> 177 <ItemGroup> 178 <Compile Include="ExpertSystemView.cs"> 179 <SubType>UserControl</SubType> 180 </Compile> 181 <Compile Include="ExpertSystemView.Designer.cs"> 182 <DependentUpon>ExpertSystemView.cs</DependentUpon> 183 </Compile> 184 <Compile Include="Interfaces\IOptimizationExpertSystemUi.cs" /> 185 <Compile Include="KnowledgeBaseView.cs"> 186 <SubType>UserControl</SubType> 187 </Compile> 188 <Compile Include="KnowledgeBaseView.Designer.cs"> 176 <Reference Include="WeifenLuo.WinFormsUI.Docking-2.7.0, Version=2.7.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 177 <SpecificVersion>False</SpecificVersion> 178 <HintPath>..\..\..\..\trunk\sources\bin\WeifenLuo.WinFormsUI.Docking-2.7.0.dll</HintPath> 179 </Reference> 180 </ItemGroup> 181 <ItemGroup> 182 <Compile Include="Docking\AlgorithmControlForm.cs"> 183 <SubType>Form</SubType> 184 </Compile> 185 <Compile Include="Docking\AlgorithmControlForm.Designer.cs"> 186 <DependentUpon>AlgorithmControlForm.cs</DependentUpon> 187 </Compile> 188 <Compile Include="Views\KnowledgeCenterAllinOneView.cs"> 189 <SubType>UserControl</SubType> 190 </Compile> 191 <Compile Include="Views\KnowledgeCenterAllinOneView.Designer.cs"> 192 <DependentUpon>KnowledgeCenterAllinOneView.cs</DependentUpon> 193 </Compile> 194 <Compile Include="Interfaces\IOptimizationKnowledgeCenterUi.cs" /> 195 <Compile Include="Views\KnowledgeBaseView.cs"> 196 <SubType>UserControl</SubType> 197 </Compile> 198 <Compile Include="Views\KnowledgeBaseView.Designer.cs"> 189 199 <DependentUpon>KnowledgeBaseView.cs</DependentUpon> 190 200 </Compile> … … 203 213 <Compile Include="Menu\100_Understanding\120_SolutionsMenuItem.cs" /> 204 214 <Compile Include="Menu\100_Understanding\110_ProblemInstanceMenuItem.cs" /> 205 <Compile Include="Optimization ExpertSystem.cs">215 <Compile Include="OptimizationKnowledgeCenter.cs"> 206 216 <SubType>Form</SubType> 207 217 </Compile> 208 <Compile Include="Optimization ExpertSystem.Designer.cs">209 <DependentUpon>Optimization ExpertSystem.cs</DependentUpon>218 <Compile Include="OptimizationKnowledgeCenter.Designer.cs"> 219 <DependentUpon>OptimizationKnowledgeCenter.cs</DependentUpon> 210 220 </Compile> 211 221 <Compile Include="Plugin.cs" /> 212 <Compile Include=" SolverView.cs">213 <SubType>UserControl</SubType> 214 </Compile> 215 <Compile Include=" SolverView.Designer.cs">222 <Compile Include="Views\SolverView.cs"> 223 <SubType>UserControl</SubType> 224 </Compile> 225 <Compile Include="Views\SolverView.Designer.cs"> 216 226 <DependentUpon>SolverView.cs</DependentUpon> 217 227 </Compile> 218 <Compile Include=" UnderstandingProblemInstanceView.cs">219 <SubType>UserControl</SubType> 220 </Compile> 221 <Compile Include=" UnderstandingProblemInstanceView.Designer.cs">228 <Compile Include="Views\UnderstandingProblemInstanceView.cs"> 229 <SubType>UserControl</SubType> 230 </Compile> 231 <Compile Include="Views\UnderstandingProblemInstanceView.Designer.cs"> 222 232 <DependentUpon>UnderstandingProblemInstanceView.cs</DependentUpon> 223 233 </Compile> 224 <Compile Include=" UnderstandingSolutionsView.cs">225 <SubType>UserControl</SubType> 226 </Compile> 227 <Compile Include=" UnderstandingSolutionsView.Designer.cs">234 <Compile Include="Views\UnderstandingSolutionsView.cs"> 235 <SubType>UserControl</SubType> 236 </Compile> 237 <Compile Include="Views\UnderstandingSolutionsView.Designer.cs"> 228 238 <DependentUpon>UnderstandingSolutionsView.cs</DependentUpon> 229 239 </Compile> 230 <Compile Include="Views\ ExpertSystemViewBase.cs">231 <SubType>UserControl</SubType> 232 </Compile> 233 <Compile Include="Views\ ExpertSystemViewBase.Designer.cs">234 <DependentUpon> ExpertSystemViewBase.cs</DependentUpon>240 <Compile Include="Views\KnowledgeCenterViewBase.cs"> 241 <SubType>UserControl</SubType> 242 </Compile> 243 <Compile Include="Views\KnowledgeCenterViewBase.Designer.cs"> 244 <DependentUpon>KnowledgeCenterViewBase.cs</DependentUpon> 235 245 </Compile> 236 246 <None Include="Properties\AssemblyInfo.cs.frame" /> … … 269 279 </ItemGroup> 270 280 <ItemGroup> 271 <EmbeddedResource Include="ExpertSystemView.resx"> 272 <DependentUpon>ExpertSystemView.cs</DependentUpon> 273 </EmbeddedResource> 274 <EmbeddedResource Include="KnowledgeBaseView.resx"> 281 <EmbeddedResource Include="Docking\AlgorithmControlForm.resx"> 282 <DependentUpon>AlgorithmControlForm.cs</DependentUpon> 283 </EmbeddedResource> 284 <EmbeddedResource Include="Views\KnowledgeCenterAllinOneView.resx"> 285 <DependentUpon>KnowledgeCenterAllinOneView.cs</DependentUpon> 286 </EmbeddedResource> 287 <EmbeddedResource Include="Views\KnowledgeBaseView.resx"> 275 288 <DependentUpon>KnowledgeBaseView.cs</DependentUpon> 276 289 </EmbeddedResource> 277 <EmbeddedResource Include="Optimization ExpertSystem.resx">278 <DependentUpon>Optimization ExpertSystem.cs</DependentUpon>279 </EmbeddedResource> 280 <EmbeddedResource Include=" SolverView.resx">290 <EmbeddedResource Include="OptimizationKnowledgeCenter.resx"> 291 <DependentUpon>OptimizationKnowledgeCenter.cs</DependentUpon> 292 </EmbeddedResource> 293 <EmbeddedResource Include="Views\SolverView.resx"> 281 294 <DependentUpon>SolverView.cs</DependentUpon> 282 295 </EmbeddedResource> 283 <EmbeddedResource Include=" UnderstandingProblemInstanceView.resx">296 <EmbeddedResource Include="Views\UnderstandingProblemInstanceView.resx"> 284 297 <DependentUpon>UnderstandingProblemInstanceView.cs</DependentUpon> 285 298 </EmbeddedResource> 286 <EmbeddedResource Include=" UnderstandingSolutionsView.resx">299 <EmbeddedResource Include="Views\UnderstandingSolutionsView.resx"> 287 300 <DependentUpon>UnderstandingSolutionsView.cs</DependentUpon> 288 301 </EmbeddedResource> 289 <EmbeddedResource Include="Views\ExpertSystemViewBase.resx"> 290 <DependentUpon>ExpertSystemViewBase.cs</DependentUpon> 291 </EmbeddedResource> 292 </ItemGroup> 302 <EmbeddedResource Include="Views\KnowledgeCenterViewBase.resx"> 303 <DependentUpon>KnowledgeCenterViewBase.cs</DependentUpon> 304 </EmbeddedResource> 305 </ItemGroup> 306 <ItemGroup /> 293 307 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 294 308 <PropertyGroup> -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Interfaces/IOptimizationKnowledgeCenterUi.cs
r13721 r13722 21 21 22 22 namespace HeuristicLab.OptimizationExpertSystem { 23 public interface IOptimization ExpertSystemUi { }23 public interface IOptimizationKnowledgeCenterUi { } 24 24 } -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Menu/900_Tools/990_ShowAllInOneViewMenuItem.cs
r13720 r13722 25 25 internal class ShowAllInOneViewMenuItem : MenuItemBase { 26 26 public override void Execute() { 27 MainForm.ShowContent(MainForm.ExpertSystem, typeof( ExpertSystemView));27 MainForm.ShowContent(MainForm.ExpertSystem, typeof(KnowledgeCenterAllinOneView)); 28 28 } 29 29 -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Menu/MenuItemBase.cs
r13718 r13722 23 23 24 24 namespace HeuristicLab.OptimizationExpertSystem.Menu { 25 internal abstract class MenuItemBase : MenuItem, IOptimization ExpertSystemUi {26 public Optimization ExpertSystemMainForm {27 get { return (Optimization ExpertSystem)HeuristicLab.MainForm.MainFormManager.MainForm; }25 internal abstract class MenuItemBase : MenuItem, IOptimizationKnowledgeCenterUi { 26 public OptimizationKnowledgeCenter MainForm { 27 get { return (OptimizationKnowledgeCenter)HeuristicLab.MainForm.MainFormManager.MainForm; } 28 28 } 29 29 } -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/OptimizationKnowledgeCenter.Designer.cs
r13721 r13722 1 1 namespace HeuristicLab.OptimizationExpertSystem { 2 partial class Optimization ExpertSystem{2 partial class OptimizationKnowledgeCenter { 3 3 /// <summary> 4 4 /// Required designer variable. -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/OptimizationKnowledgeCenter.cs
r13721 r13722 28 28 29 29 namespace HeuristicLab.OptimizationExpertSystem { 30 public partial class Optimization ExpertSystem: DockingMainForm {30 public partial class OptimizationKnowledgeCenter : DockingMainForm { 31 31 private ToolStripProgressBar progressBar; 32 32 private ToolStripLabel progressLabel; 33 33 34 public ExpertSystemExpertSystem { get; private set; }34 public KnowledgeCenter ExpertSystem { get; private set; } 35 35 36 public Optimization ExpertSystem(Type userInterfaceType) : base(userInterfaceType) {36 public OptimizationKnowledgeCenter(Type userInterfaceType) : base(userInterfaceType) { 37 37 InitializeComponent(); 38 ExpertSystem = new ExpertSystem();38 ExpertSystem = new KnowledgeCenter(); 39 39 ExpertSystem.DownloadStarted += ExpertSystemOnDownloadStarted; 40 40 ShowContentInViewHost = false; -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Plugin.cs.frame
r13718 r13722 46 46 internal class HeuristicLabOptimizationKnowledgeCenterApplication : ApplicationBase { 47 47 public override void Run(ICommandLineArgument[] args) { 48 HeuristicLab.MainForm.WindowsForms.MainForm mainForm = new Optimization ExpertSystem(typeof(IOptimizationExpertSystemUi));48 HeuristicLab.MainForm.WindowsForms.MainForm mainForm = new OptimizationKnowledgeCenter(typeof(IOptimizationKnowledgeCenterUi)); 49 49 50 50 ClientInformation.InitializeAsync(); -
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.