- Timestamp:
- 03/07/16 21:29:00 (9 years ago)
- Location:
- branches/PerformanceComparison
- Files:
-
- 6 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/PerformanceComparison/HeuristicLab.Analysis/3.3/QualityAnalysis/QualityDistributionAnalyzer.cs
r12012 r13663 20 20 #endregion 21 21 22 using System.Linq;23 22 using HeuristicLab.Common; 24 23 using HeuristicLab.Core; … … 28 27 using HeuristicLab.Parameters; 29 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 using System.Collections.Generic; 30 using System.Linq; 30 31 31 32 namespace HeuristicLab.Analysis.QualityAnalysis { … … 33 34 [StorableClass] 34 35 public class QualityDistributionAnalyzer : SingleSuccessorOperator, IAnalyzer, IIterationBasedOperator, ISingleObjectiveOperator { 36 private const string TableDescription = "Shows the quality distributions in the current population."; 35 37 36 38 #region Parameter properties … … 93 95 } 94 96 97 public static DataTable PrepareTable(string qualityName = "Quality") { 98 var result = new DataTable("Population Quality Distribution", TableDescription); 99 result.VisualProperties.XAxisTitle = qualityName; 100 result.VisualProperties.YAxisTitle = "Frequency"; 101 102 var row = new DataRow("QualityDistribution"); 103 row.VisualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Histogram; 104 result.Rows.Add(row); 105 106 return result; 107 } 108 109 public static void UpdateTable(DataTable table, IEnumerable<double> qualities) { 110 var row = table.Rows["QualityDistribution"]; 111 row.Values.Replace(qualities); 112 } 113 95 114 public override IOperation Apply() { 96 115 DataTable qualityDistribution = null; 97 ResultCollection results = ResultsParameter.ActualValue; 98 string description = "Shows the quality distributions in the current population."; 116 var results = ResultsParameter.ActualValue; 99 117 if (results.ContainsKey(HistogramName)) { 100 qualityDistribution = results[HistogramName].Value as DataTable;118 qualityDistribution = (DataTable)results[HistogramName].Value; 101 119 } else { 102 qualityDistribution = new DataTable("Population Quality Distribution", description); 103 qualityDistribution.VisualProperties.XAxisTitle = QualityParameter.ActualName; 104 qualityDistribution.VisualProperties.YAxisTitle = "Frequency"; 105 results.Add(new Result(HistogramName, description, qualityDistribution)); 120 qualityDistribution = PrepareTable(QualityParameter.ActualName); 121 results.Add(new Result(HistogramName, TableDescription, qualityDistribution)); 106 122 } 107 DataRow row; 108 if (!qualityDistribution.Rows.TryGetValue("QualityDistribution", out row)) { 109 row = new DataRow("QualityDistribution"); 110 row.VisualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Histogram; 111 qualityDistribution.Rows.Add(row); 112 } 113 var qualities = QualityParameter.ActualValue; 114 row.Values.Replace(qualities.Select(x => x.Value)); 123 124 UpdateTable(qualityDistribution, QualityParameter.ActualValue.Select(x => x.Value)); 115 125 116 126 if (StoreHistory) { 117 stringhistoryResultName = HistogramName + " History";127 var historyResultName = HistogramName + " History"; 118 128 DataTableHistory qdHistory = null; 119 129 if (results.ContainsKey(historyResultName)) { 120 qdHistory = results[historyResultName].Value as DataTableHistory;130 qdHistory = (DataTableHistory)results[historyResultName].Value; 121 131 } else { 122 132 qdHistory = new DataTableHistory(); 123 133 results.Add(new Result(historyResultName, qdHistory)); 124 134 } 125 DataTabletable = (DataTable)qualityDistribution.Clone();126 IntValueiteration = IterationsParameter.ActualValue;135 var table = (DataTable)qualityDistribution.Clone(); 136 var iteration = IterationsParameter.ActualValue; 127 137 if (iteration != null) { 128 stringiterationName = IterationsParameter.ActualName;138 var iterationName = IterationsParameter.ActualName; 129 139 if (iterationName.EndsWith("s")) iterationName = iterationName.Remove(iterationName.Length - 1); 130 stringappendix = " at " + iterationName + " " + iteration.Value.ToString();140 var appendix = " at " + iterationName + " " + iteration.Value.ToString(); 131 141 table.Name += appendix; 132 142 table.Rows["QualityDistribution"].VisualProperties.DisplayName += appendix; -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Views/3.3/ExpertSystemView.Designer.cs
r13649 r13663 51 51 this.runsTabPage = new System.Windows.Forms.TabPage(); 52 52 this.runsView = new HeuristicLab.Optimization.Views.RunCollectionView(); 53 this.solutionsTabPage = new System.Windows.Forms.TabPage(); 54 this.qualityNameLabel = new System.Windows.Forms.Label(); 55 this.solutionDiversitySimilarityLabel = new System.Windows.Forms.Label(); 56 this.solutionNameLabel = new System.Windows.Forms.Label(); 57 this.similarityComboBox = new System.Windows.Forms.ComboBox(); 58 this.qualityNameComboBox = new System.Windows.Forms.ComboBox(); 59 this.solutionNameComboBox = new System.Windows.Forms.ComboBox(); 60 this.solutionsTabControl = new System.Windows.Forms.TabControl(); 61 this.solutionsListTabPage = new System.Windows.Forms.TabPage(); 62 this.solutionsViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 63 this.solutionsQualityTabPage = new System.Windows.Forms.TabPage(); 64 this.solutionsQualityViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 65 this.solutionsDiversityTabPage = new System.Windows.Forms.TabPage(); 66 this.solutionsDiversityViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 67 this.solutionsLengthScaleTabPage = new System.Windows.Forms.TabPage(); 68 this.solutionsLengthScaleViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 69 this.solutionsNetworkTabPage = new System.Windows.Forms.TabPage(); 70 this.solutionsNetworkViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 53 71 this.okbTabPage = new System.Windows.Forms.TabPage(); 54 72 this.kbViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); … … 65 83 this.okbDownloadButton = new System.Windows.Forms.Button(); 66 84 this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); 85 this.solutionsFdcTabPage = new System.Windows.Forms.TabPage(); 86 this.solutionsFdcViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 67 87 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 68 88 this.tabControl.SuspendLayout(); … … 70 90 this.algorithmTabPage.SuspendLayout(); 71 91 this.runsTabPage.SuspendLayout(); 92 this.solutionsTabPage.SuspendLayout(); 93 this.solutionsTabControl.SuspendLayout(); 94 this.solutionsListTabPage.SuspendLayout(); 95 this.solutionsQualityTabPage.SuspendLayout(); 96 this.solutionsDiversityTabPage.SuspendLayout(); 97 this.solutionsLengthScaleTabPage.SuspendLayout(); 98 this.solutionsNetworkTabPage.SuspendLayout(); 72 99 this.okbTabPage.SuspendLayout(); 73 100 this.problemInstancesTabPage.SuspendLayout(); … … 76 103 this.mapTabPage.SuspendLayout(); 77 104 ((System.ComponentModel.ISupportInitialize)(this.instanceMapChart)).BeginInit(); 105 this.solutionsFdcTabPage.SuspendLayout(); 78 106 this.SuspendLayout(); 79 107 // … … 83 111 this.errorProvider.SetIconPadding(this.nameTextBox, 2); 84 112 this.nameTextBox.Location = new System.Drawing.Point(75, 0); 85 this.nameTextBox.Size = new System.Drawing.Size( 449, 20);113 this.nameTextBox.Size = new System.Drawing.Size(592, 20); 86 114 // 87 115 // infoLabel 88 116 // 89 this.infoLabel.Location = new System.Drawing.Point( 530, 3);117 this.infoLabel.Location = new System.Drawing.Point(673, 3); 90 118 // 91 119 // evaluationsLimitabel … … 104 132 this.maxEvaluationsTextBox.Location = new System.Drawing.Point(75, 26); 105 133 this.maxEvaluationsTextBox.Name = "maxEvaluationsTextBox"; 106 this.maxEvaluationsTextBox.Size = new System.Drawing.Size( 449, 20);134 this.maxEvaluationsTextBox.Size = new System.Drawing.Size(592, 20); 107 135 this.maxEvaluationsTextBox.TabIndex = 6; 108 136 this.maxEvaluationsTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.MaxEvaluationsTextBoxOnValidating); … … 117 145 this.tabControl.Controls.Add(this.algorithmTabPage); 118 146 this.tabControl.Controls.Add(this.runsTabPage); 147 this.tabControl.Controls.Add(this.solutionsTabPage); 119 148 this.tabControl.Controls.Add(this.okbTabPage); 120 149 this.tabControl.Controls.Add(this.problemInstancesTabPage); … … 122 151 this.tabControl.Name = "tabControl"; 123 152 this.tabControl.SelectedIndex = 0; 124 this.tabControl.Size = new System.Drawing.Size( 546, 332);153 this.tabControl.Size = new System.Drawing.Size(689, 454); 125 154 this.tabControl.TabIndex = 17; 126 155 // … … 132 161 this.problemTabPage.Name = "problemTabPage"; 133 162 this.problemTabPage.Padding = new System.Windows.Forms.Padding(3); 134 this.problemTabPage.Size = new System.Drawing.Size( 538, 306);163 this.problemTabPage.Size = new System.Drawing.Size(681, 428); 135 164 this.problemTabPage.TabIndex = 1; 136 165 this.problemTabPage.Text = "Problem"; … … 146 175 this.problemViewHost.Name = "problemViewHost"; 147 176 this.problemViewHost.ReadOnly = false; 148 this.problemViewHost.Size = new System.Drawing.Size( 532, 300);177 this.problemViewHost.Size = new System.Drawing.Size(675, 422); 149 178 this.problemViewHost.TabIndex = 2; 150 179 this.problemViewHost.ViewsLabelVisible = false; … … 160 189 this.algorithmTabPage.Name = "algorithmTabPage"; 161 190 this.algorithmTabPage.Padding = new System.Windows.Forms.Padding(3); 162 this.algorithmTabPage.Size = new System.Drawing.Size( 538, 306);191 this.algorithmTabPage.Size = new System.Drawing.Size(681, 428); 163 192 this.algorithmTabPage.TabIndex = 4; 164 193 this.algorithmTabPage.Text = "Algorithm"; … … 168 197 // 169 198 this.algorithmStartButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 170 this.algorithmStartButton.Location = new System.Drawing.Point( 506, 5);199 this.algorithmStartButton.Location = new System.Drawing.Point(649, 5); 171 200 this.algorithmStartButton.Name = "algorithmStartButton"; 172 201 this.algorithmStartButton.Size = new System.Drawing.Size(26, 23); … … 187 216 this.algorithmViewHost.Name = "algorithmViewHost"; 188 217 this.algorithmViewHost.ReadOnly = false; 189 this.algorithmViewHost.Size = new System.Drawing.Size( 526, 264);218 this.algorithmViewHost.Size = new System.Drawing.Size(669, 386); 190 219 this.algorithmViewHost.TabIndex = 2; 191 220 this.algorithmViewHost.ViewsLabelVisible = true; … … 209 238 this.suggestedInstancesComboBox.Location = new System.Drawing.Point(178, 6); 210 239 this.suggestedInstancesComboBox.Name = "suggestedInstancesComboBox"; 211 this.suggestedInstancesComboBox.Size = new System.Drawing.Size( 322, 21);240 this.suggestedInstancesComboBox.Size = new System.Drawing.Size(465, 21); 212 241 this.suggestedInstancesComboBox.TabIndex = 0; 213 242 this.suggestedInstancesComboBox.SelectedIndexChanged += new System.EventHandler(this.SuggestedInstancesComboBoxOnSelectedIndexChanged); … … 219 248 this.runsTabPage.Name = "runsTabPage"; 220 249 this.runsTabPage.Padding = new System.Windows.Forms.Padding(3); 221 this.runsTabPage.Size = new System.Drawing.Size( 538, 306);250 this.runsTabPage.Size = new System.Drawing.Size(681, 428); 222 251 this.runsTabPage.TabIndex = 3; 223 252 this.runsTabPage.Text = "Runs"; … … 232 261 this.runsView.Name = "runsView"; 233 262 this.runsView.ReadOnly = false; 234 this.runsView.Size = new System.Drawing.Size( 532, 300);263 this.runsView.Size = new System.Drawing.Size(675, 422); 235 264 this.runsView.TabIndex = 1; 265 // 266 // solutionsTabPage 267 // 268 this.solutionsTabPage.Controls.Add(this.qualityNameLabel); 269 this.solutionsTabPage.Controls.Add(this.solutionDiversitySimilarityLabel); 270 this.solutionsTabPage.Controls.Add(this.solutionNameLabel); 271 this.solutionsTabPage.Controls.Add(this.similarityComboBox); 272 this.solutionsTabPage.Controls.Add(this.qualityNameComboBox); 273 this.solutionsTabPage.Controls.Add(this.solutionNameComboBox); 274 this.solutionsTabPage.Controls.Add(this.solutionsTabControl); 275 this.solutionsTabPage.Location = new System.Drawing.Point(4, 22); 276 this.solutionsTabPage.Name = "solutionsTabPage"; 277 this.solutionsTabPage.Padding = new System.Windows.Forms.Padding(3); 278 this.solutionsTabPage.Size = new System.Drawing.Size(681, 428); 279 this.solutionsTabPage.TabIndex = 7; 280 this.solutionsTabPage.Text = "Solutions"; 281 this.solutionsTabPage.UseVisualStyleBackColor = true; 282 // 283 // qualityNameLabel 284 // 285 this.qualityNameLabel.AutoSize = true; 286 this.qualityNameLabel.Location = new System.Drawing.Point(227, 9); 287 this.qualityNameLabel.Name = "qualityNameLabel"; 288 this.qualityNameLabel.Size = new System.Drawing.Size(42, 13); 289 this.qualityNameLabel.TabIndex = 2; 290 this.qualityNameLabel.Text = "Quality:"; 291 // 292 // solutionDiversitySimilarityLabel 293 // 294 this.solutionDiversitySimilarityLabel.AutoSize = true; 295 this.solutionDiversitySimilarityLabel.Location = new System.Drawing.Point(449, 9); 296 this.solutionDiversitySimilarityLabel.Name = "solutionDiversitySimilarityLabel"; 297 this.solutionDiversitySimilarityLabel.Size = new System.Drawing.Size(50, 13); 298 this.solutionDiversitySimilarityLabel.TabIndex = 2; 299 this.solutionDiversitySimilarityLabel.Text = "Similarity:"; 300 // 301 // solutionNameLabel 302 // 303 this.solutionNameLabel.AutoSize = true; 304 this.solutionNameLabel.Location = new System.Drawing.Point(6, 9); 305 this.solutionNameLabel.Name = "solutionNameLabel"; 306 this.solutionNameLabel.Size = new System.Drawing.Size(48, 13); 307 this.solutionNameLabel.TabIndex = 2; 308 this.solutionNameLabel.Text = "Solution:"; 309 // 310 // similarityComboBox 311 // 312 this.similarityComboBox.DisplayMember = "ItemName"; 313 this.similarityComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 314 this.similarityComboBox.FormattingEnabled = true; 315 this.similarityComboBox.Location = new System.Drawing.Point(505, 6); 316 this.similarityComboBox.Name = "similarityComboBox"; 317 this.similarityComboBox.Size = new System.Drawing.Size(150, 21); 318 this.similarityComboBox.TabIndex = 1; 319 this.similarityComboBox.SelectedIndexChanged += new System.EventHandler(this.similarityComboBox_SelectedIndexChanged); 320 // 321 // qualityNameComboBox 322 // 323 this.qualityNameComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 324 this.qualityNameComboBox.FormattingEnabled = true; 325 this.qualityNameComboBox.Location = new System.Drawing.Point(281, 6); 326 this.qualityNameComboBox.Name = "qualityNameComboBox"; 327 this.qualityNameComboBox.Size = new System.Drawing.Size(150, 21); 328 this.qualityNameComboBox.TabIndex = 1; 329 this.qualityNameComboBox.SelectedIndexChanged += new System.EventHandler(this.qualityNameComboBox_SelectedIndexChanged); 330 // 331 // solutionNameComboBox 332 // 333 this.solutionNameComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 334 this.solutionNameComboBox.FormattingEnabled = true; 335 this.solutionNameComboBox.Location = new System.Drawing.Point(60, 6); 336 this.solutionNameComboBox.Name = "solutionNameComboBox"; 337 this.solutionNameComboBox.Size = new System.Drawing.Size(150, 21); 338 this.solutionNameComboBox.TabIndex = 1; 339 this.solutionNameComboBox.SelectedIndexChanged += new System.EventHandler(this.solutionNameComboBox_SelectedIndexChanged); 340 // 341 // solutionsTabControl 342 // 343 this.solutionsTabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 344 | System.Windows.Forms.AnchorStyles.Left) 345 | System.Windows.Forms.AnchorStyles.Right))); 346 this.solutionsTabControl.Controls.Add(this.solutionsListTabPage); 347 this.solutionsTabControl.Controls.Add(this.solutionsQualityTabPage); 348 this.solutionsTabControl.Controls.Add(this.solutionsDiversityTabPage); 349 this.solutionsTabControl.Controls.Add(this.solutionsFdcTabPage); 350 this.solutionsTabControl.Controls.Add(this.solutionsLengthScaleTabPage); 351 this.solutionsTabControl.Controls.Add(this.solutionsNetworkTabPage); 352 this.solutionsTabControl.Location = new System.Drawing.Point(3, 33); 353 this.solutionsTabControl.Name = "solutionsTabControl"; 354 this.solutionsTabControl.SelectedIndex = 0; 355 this.solutionsTabControl.Size = new System.Drawing.Size(675, 392); 356 this.solutionsTabControl.TabIndex = 0; 357 // 358 // solutionsListTabPage 359 // 360 this.solutionsListTabPage.Controls.Add(this.solutionsViewHost); 361 this.solutionsListTabPage.Location = new System.Drawing.Point(4, 22); 362 this.solutionsListTabPage.Name = "solutionsListTabPage"; 363 this.solutionsListTabPage.Padding = new System.Windows.Forms.Padding(3); 364 this.solutionsListTabPage.Size = new System.Drawing.Size(667, 366); 365 this.solutionsListTabPage.TabIndex = 0; 366 this.solutionsListTabPage.Text = "List"; 367 this.solutionsListTabPage.UseVisualStyleBackColor = true; 368 // 369 // solutionsViewHost 370 // 371 this.solutionsViewHost.Caption = "View"; 372 this.solutionsViewHost.Content = null; 373 this.solutionsViewHost.Dock = System.Windows.Forms.DockStyle.Fill; 374 this.solutionsViewHost.Enabled = false; 375 this.solutionsViewHost.Location = new System.Drawing.Point(3, 3); 376 this.solutionsViewHost.Name = "solutionsViewHost"; 377 this.solutionsViewHost.ReadOnly = false; 378 this.solutionsViewHost.Size = new System.Drawing.Size(661, 360); 379 this.solutionsViewHost.TabIndex = 0; 380 this.solutionsViewHost.ViewsLabelVisible = true; 381 this.solutionsViewHost.ViewType = null; 382 // 383 // solutionsQualityTabPage 384 // 385 this.solutionsQualityTabPage.Controls.Add(this.solutionsQualityViewHost); 386 this.solutionsQualityTabPage.Location = new System.Drawing.Point(4, 22); 387 this.solutionsQualityTabPage.Name = "solutionsQualityTabPage"; 388 this.solutionsQualityTabPage.Padding = new System.Windows.Forms.Padding(3); 389 this.solutionsQualityTabPage.Size = new System.Drawing.Size(667, 366); 390 this.solutionsQualityTabPage.TabIndex = 1; 391 this.solutionsQualityTabPage.Text = "Quality Analysis"; 392 this.solutionsQualityTabPage.UseVisualStyleBackColor = true; 393 // 394 // solutionsQualityViewHost 395 // 396 this.solutionsQualityViewHost.Caption = "View"; 397 this.solutionsQualityViewHost.Content = null; 398 this.solutionsQualityViewHost.Dock = System.Windows.Forms.DockStyle.Fill; 399 this.solutionsQualityViewHost.Enabled = false; 400 this.solutionsQualityViewHost.Location = new System.Drawing.Point(3, 3); 401 this.solutionsQualityViewHost.Name = "solutionsQualityViewHost"; 402 this.solutionsQualityViewHost.ReadOnly = false; 403 this.solutionsQualityViewHost.Size = new System.Drawing.Size(661, 360); 404 this.solutionsQualityViewHost.TabIndex = 0; 405 this.solutionsQualityViewHost.ViewsLabelVisible = true; 406 this.solutionsQualityViewHost.ViewType = null; 407 // 408 // solutionsDiversityTabPage 409 // 410 this.solutionsDiversityTabPage.Controls.Add(this.solutionsDiversityViewHost); 411 this.solutionsDiversityTabPage.Location = new System.Drawing.Point(4, 22); 412 this.solutionsDiversityTabPage.Name = "solutionsDiversityTabPage"; 413 this.solutionsDiversityTabPage.Padding = new System.Windows.Forms.Padding(3); 414 this.solutionsDiversityTabPage.Size = new System.Drawing.Size(667, 366); 415 this.solutionsDiversityTabPage.TabIndex = 2; 416 this.solutionsDiversityTabPage.Text = "Diversity Analysis"; 417 this.solutionsDiversityTabPage.UseVisualStyleBackColor = true; 418 // 419 // solutionsDiversityViewHost 420 // 421 this.solutionsDiversityViewHost.Caption = "View"; 422 this.solutionsDiversityViewHost.Content = null; 423 this.solutionsDiversityViewHost.Dock = System.Windows.Forms.DockStyle.Fill; 424 this.solutionsDiversityViewHost.Enabled = false; 425 this.solutionsDiversityViewHost.Location = new System.Drawing.Point(3, 3); 426 this.solutionsDiversityViewHost.Name = "solutionsDiversityViewHost"; 427 this.solutionsDiversityViewHost.ReadOnly = false; 428 this.solutionsDiversityViewHost.Size = new System.Drawing.Size(661, 360); 429 this.solutionsDiversityViewHost.TabIndex = 1; 430 this.solutionsDiversityViewHost.ViewsLabelVisible = true; 431 this.solutionsDiversityViewHost.ViewType = null; 432 // 433 // solutionsLengthScaleTabPage 434 // 435 this.solutionsLengthScaleTabPage.Controls.Add(this.solutionsLengthScaleViewHost); 436 this.solutionsLengthScaleTabPage.Location = new System.Drawing.Point(4, 22); 437 this.solutionsLengthScaleTabPage.Name = "solutionsLengthScaleTabPage"; 438 this.solutionsLengthScaleTabPage.Padding = new System.Windows.Forms.Padding(3); 439 this.solutionsLengthScaleTabPage.Size = new System.Drawing.Size(667, 366); 440 this.solutionsLengthScaleTabPage.TabIndex = 3; 441 this.solutionsLengthScaleTabPage.Text = "Length-Scale Analysis"; 442 this.solutionsLengthScaleTabPage.UseVisualStyleBackColor = true; 443 // 444 // solutionsLengthScaleViewHost 445 // 446 this.solutionsLengthScaleViewHost.Caption = "View"; 447 this.solutionsLengthScaleViewHost.Content = null; 448 this.solutionsLengthScaleViewHost.Dock = System.Windows.Forms.DockStyle.Fill; 449 this.solutionsLengthScaleViewHost.Enabled = false; 450 this.solutionsLengthScaleViewHost.Location = new System.Drawing.Point(3, 3); 451 this.solutionsLengthScaleViewHost.Name = "solutionsLengthScaleViewHost"; 452 this.solutionsLengthScaleViewHost.ReadOnly = false; 453 this.solutionsLengthScaleViewHost.Size = new System.Drawing.Size(661, 360); 454 this.solutionsLengthScaleViewHost.TabIndex = 0; 455 this.solutionsLengthScaleViewHost.ViewsLabelVisible = true; 456 this.solutionsLengthScaleViewHost.ViewType = null; 457 // 458 // solutionsNetworkTabPage 459 // 460 this.solutionsNetworkTabPage.Controls.Add(this.solutionsNetworkViewHost); 461 this.solutionsNetworkTabPage.Location = new System.Drawing.Point(4, 22); 462 this.solutionsNetworkTabPage.Name = "solutionsNetworkTabPage"; 463 this.solutionsNetworkTabPage.Padding = new System.Windows.Forms.Padding(3); 464 this.solutionsNetworkTabPage.Size = new System.Drawing.Size(667, 366); 465 this.solutionsNetworkTabPage.TabIndex = 4; 466 this.solutionsNetworkTabPage.Text = "Network Analysis"; 467 this.solutionsNetworkTabPage.UseVisualStyleBackColor = true; 468 // 469 // solutionsNetworkViewHost 470 // 471 this.solutionsNetworkViewHost.Caption = "View"; 472 this.solutionsNetworkViewHost.Content = null; 473 this.solutionsNetworkViewHost.Dock = System.Windows.Forms.DockStyle.Fill; 474 this.solutionsNetworkViewHost.Enabled = false; 475 this.solutionsNetworkViewHost.Location = new System.Drawing.Point(3, 3); 476 this.solutionsNetworkViewHost.Name = "solutionsNetworkViewHost"; 477 this.solutionsNetworkViewHost.ReadOnly = false; 478 this.solutionsNetworkViewHost.Size = new System.Drawing.Size(661, 360); 479 this.solutionsNetworkViewHost.TabIndex = 0; 480 this.solutionsNetworkViewHost.ViewsLabelVisible = true; 481 this.solutionsNetworkViewHost.ViewType = null; 236 482 // 237 483 // okbTabPage … … 241 487 this.okbTabPage.Name = "okbTabPage"; 242 488 this.okbTabPage.Padding = new System.Windows.Forms.Padding(3); 243 this.okbTabPage.Size = new System.Drawing.Size( 538, 306);489 this.okbTabPage.Size = new System.Drawing.Size(681, 428); 244 490 this.okbTabPage.TabIndex = 5; 245 491 this.okbTabPage.Text = "Knowledge Base"; … … 255 501 this.kbViewHost.Name = "kbViewHost"; 256 502 this.kbViewHost.ReadOnly = true; 257 this.kbViewHost.Size = new System.Drawing.Size( 532, 300);503 this.kbViewHost.Size = new System.Drawing.Size(675, 422); 258 504 this.kbViewHost.TabIndex = 3; 259 505 this.kbViewHost.ViewsLabelVisible = true; … … 269 515 this.problemInstancesTabPage.Name = "problemInstancesTabPage"; 270 516 this.problemInstancesTabPage.Padding = new System.Windows.Forms.Padding(3); 271 this.problemInstancesTabPage.Size = new System.Drawing.Size( 538, 306);517 this.problemInstancesTabPage.Size = new System.Drawing.Size(681, 428); 272 518 this.problemInstancesTabPage.TabIndex = 6; 273 519 this.problemInstancesTabPage.Text = "Problem Instances"; … … 303 549 this.problemInstancesTabControl.Name = "problemInstancesTabControl"; 304 550 this.problemInstancesTabControl.SelectedIndex = 0; 305 this.problemInstancesTabControl.Size = new System.Drawing.Size( 532, 268);551 this.problemInstancesTabControl.Size = new System.Drawing.Size(675, 390); 306 552 this.problemInstancesTabControl.TabIndex = 4; 307 553 // … … 312 558 this.instancesTabPage.Name = "instancesTabPage"; 313 559 this.instancesTabPage.Padding = new System.Windows.Forms.Padding(3); 314 this.instancesTabPage.Size = new System.Drawing.Size( 524, 242);560 this.instancesTabPage.Size = new System.Drawing.Size(667, 364); 315 561 this.instancesTabPage.TabIndex = 0; 316 562 this.instancesTabPage.Text = "Instances"; … … 326 572 this.problemInstancesView.Name = "problemInstancesView"; 327 573 this.problemInstancesView.ReadOnly = false; 328 this.problemInstancesView.Size = new System.Drawing.Size( 518, 236);574 this.problemInstancesView.Size = new System.Drawing.Size(661, 358); 329 575 this.problemInstancesView.TabIndex = 0; 330 576 this.problemInstancesView.ViewsLabelVisible = true; … … 337 583 this.mapTabPage.Name = "mapTabPage"; 338 584 this.mapTabPage.Padding = new System.Windows.Forms.Padding(3); 339 this.mapTabPage.Size = new System.Drawing.Size( 524, 242);585 this.mapTabPage.Size = new System.Drawing.Size(667, 364); 340 586 this.mapTabPage.TabIndex = 1; 341 587 this.mapTabPage.Text = "Map"; … … 371 617 this.instanceMapChart.Series.Add(series1); 372 618 this.instanceMapChart.Series.Add(series2); 373 this.instanceMapChart.Size = new System.Drawing.Size( 518, 236);619 this.instanceMapChart.Size = new System.Drawing.Size(661, 358); 374 620 this.instanceMapChart.TabIndex = 0; 375 621 // … … 391 637 this.progressPanel.Location = new System.Drawing.Point(0, 81); 392 638 this.progressPanel.Name = "progressPanel"; 393 this.progressPanel.Size = new System.Drawing.Size( 549, 332);639 this.progressPanel.Size = new System.Drawing.Size(692, 454); 394 640 this.progressPanel.TabIndex = 2; 395 641 this.progressPanel.Visible = false; … … 401 647 this.okbDownloadButton.Location = new System.Drawing.Point(6, 52); 402 648 this.okbDownloadButton.Name = "okbDownloadButton"; 403 this.okbDownloadButton.Size = new System.Drawing.Size( 518, 23);649 this.okbDownloadButton.Size = new System.Drawing.Size(661, 23); 404 650 this.okbDownloadButton.TabIndex = 1; 405 651 this.okbDownloadButton.Text = "Download from OKB"; … … 413 659 this.openFileDialog.Filter = "HeuristicLab Files|*.hl|All Files|*.*"; 414 660 this.openFileDialog.Title = "Open Optimizer"; 661 // 662 // solutionsFdcTabPage 663 // 664 this.solutionsFdcTabPage.Controls.Add(this.solutionsFdcViewHost); 665 this.solutionsFdcTabPage.Location = new System.Drawing.Point(4, 22); 666 this.solutionsFdcTabPage.Name = "solutionsFdcTabPage"; 667 this.solutionsFdcTabPage.Padding = new System.Windows.Forms.Padding(3); 668 this.solutionsFdcTabPage.Size = new System.Drawing.Size(667, 366); 669 this.solutionsFdcTabPage.TabIndex = 5; 670 this.solutionsFdcTabPage.Text = "Fitness-Distance Analysis"; 671 this.solutionsFdcTabPage.UseVisualStyleBackColor = true; 672 // 673 // solutionsFdcViewHost 674 // 675 this.solutionsFdcViewHost.Caption = "View"; 676 this.solutionsFdcViewHost.Content = null; 677 this.solutionsFdcViewHost.Dock = System.Windows.Forms.DockStyle.Fill; 678 this.solutionsFdcViewHost.Enabled = false; 679 this.solutionsFdcViewHost.Location = new System.Drawing.Point(3, 3); 680 this.solutionsFdcViewHost.Name = "solutionsFdcViewHost"; 681 this.solutionsFdcViewHost.ReadOnly = false; 682 this.solutionsFdcViewHost.Size = new System.Drawing.Size(661, 360); 683 this.solutionsFdcViewHost.TabIndex = 0; 684 this.solutionsFdcViewHost.ViewsLabelVisible = true; 685 this.solutionsFdcViewHost.ViewType = null; 415 686 // 416 687 // ExpertSystemView … … 423 694 this.Controls.Add(this.progressPanel); 424 695 this.Name = "ExpertSystemView"; 425 this.Size = new System.Drawing.Size( 549, 413);696 this.Size = new System.Drawing.Size(692, 535); 426 697 this.Controls.SetChildIndex(this.progressPanel, 0); 427 698 this.Controls.SetChildIndex(this.maxEvaluationsTextBox, 0); … … 438 709 this.algorithmTabPage.PerformLayout(); 439 710 this.runsTabPage.ResumeLayout(false); 711 this.solutionsTabPage.ResumeLayout(false); 712 this.solutionsTabPage.PerformLayout(); 713 this.solutionsTabControl.ResumeLayout(false); 714 this.solutionsListTabPage.ResumeLayout(false); 715 this.solutionsQualityTabPage.ResumeLayout(false); 716 this.solutionsDiversityTabPage.ResumeLayout(false); 717 this.solutionsLengthScaleTabPage.ResumeLayout(false); 718 this.solutionsNetworkTabPage.ResumeLayout(false); 440 719 this.okbTabPage.ResumeLayout(false); 441 720 this.problemInstancesTabPage.ResumeLayout(false); … … 445 724 this.mapTabPage.ResumeLayout(false); 446 725 ((System.ComponentModel.ISupportInitialize)(this.instanceMapChart)).EndInit(); 726 this.solutionsFdcTabPage.ResumeLayout(false); 447 727 this.ResumeLayout(false); 448 728 this.PerformLayout(); … … 478 758 private System.Windows.Forms.Label label1; 479 759 private System.Windows.Forms.ComboBox projectionComboBox; 760 private System.Windows.Forms.TabPage solutionsTabPage; 761 private System.Windows.Forms.TabControl solutionsTabControl; 762 private System.Windows.Forms.TabPage solutionsListTabPage; 763 private System.Windows.Forms.TabPage solutionsQualityTabPage; 764 private System.Windows.Forms.TabPage solutionsDiversityTabPage; 765 private System.Windows.Forms.Label qualityNameLabel; 766 private System.Windows.Forms.Label solutionNameLabel; 767 private System.Windows.Forms.ComboBox qualityNameComboBox; 768 private System.Windows.Forms.ComboBox solutionNameComboBox; 769 private MainForm.WindowsForms.ViewHost solutionsQualityViewHost; 770 private MainForm.WindowsForms.ViewHost solutionsViewHost; 771 private MainForm.WindowsForms.ViewHost solutionsDiversityViewHost; 772 private System.Windows.Forms.Label solutionDiversitySimilarityLabel; 773 private System.Windows.Forms.ComboBox similarityComboBox; 774 private System.Windows.Forms.TabPage solutionsLengthScaleTabPage; 775 private System.Windows.Forms.TabPage solutionsNetworkTabPage; 776 private MainForm.WindowsForms.ViewHost solutionsLengthScaleViewHost; 777 private MainForm.WindowsForms.ViewHost solutionsNetworkViewHost; 778 private System.Windows.Forms.TabPage solutionsFdcTabPage; 779 private MainForm.WindowsForms.ViewHost solutionsFdcViewHost; 480 780 } 481 781 } -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Views/3.3/ExpertSystemView.cs
r13649 r13663 20 20 #endregion 21 21 22 using HeuristicLab.Analysis; 23 using HeuristicLab.Analysis.QualityAnalysis; 24 using HeuristicLab.Common; 22 25 using HeuristicLab.Common.Resources; 23 26 using HeuristicLab.Core.Views; 27 using HeuristicLab.Data; 24 28 using HeuristicLab.MainForm; 25 29 using HeuristicLab.Optimization; 26 30 using HeuristicLab.Optimization.Views; 27 31 using System; 32 using System.Collections.Generic; 28 33 using System.ComponentModel; 29 34 using System.Linq; … … 70 75 Content.SuggestedInstances.ItemsRemoved -= SuggestedInstancesOnChanged; 71 76 Content.SuggestedInstances.ItemsReplaced -= SuggestedInstancesOnChanged; 77 Content.SolutionPool.ItemsAdded -= SolutionPoolOnChanged; 78 Content.SolutionPool.ItemsRemoved -= SolutionPoolOnChanged; 79 Content.SolutionPool.ItemsReplaced -= SolutionPoolOnChanged; 80 Content.SolutionPool.CollectionReset -= SolutionPoolOnChanged; 72 81 if (Content.Problem != null) Content.Problem.ProblemChanged -= ContentOnProblemChanged; 73 82 base.DeregisterContentEvents(); … … 81 90 Content.SuggestedInstances.ItemsRemoved += SuggestedInstancesOnChanged; 82 91 Content.SuggestedInstances.ItemsReplaced += SuggestedInstancesOnChanged; 92 Content.SolutionPool.ItemsAdded += SolutionPoolOnChanged; 93 Content.SolutionPool.ItemsRemoved += SolutionPoolOnChanged; 94 Content.SolutionPool.ItemsReplaced += SolutionPoolOnChanged; 95 Content.SolutionPool.CollectionReset += SolutionPoolOnChanged; 83 96 if (Content.Problem != null) Content.Problem.ProblemChanged += ContentOnProblemChanged; 84 97 } … … 95 108 algorithmViewHost.Content = null; 96 109 runsView.Content = null; 110 solutionsViewHost.Content = null; 97 111 kbViewHost.Content = null; 98 112 problemInstancesView.Content = null; … … 101 115 problemViewHost.Content = Content.Problem; 102 116 runsView.Content = Content.Runs; 117 solutionsViewHost.Content = Content.SolutionPool; 103 118 kbViewHost.ViewType = typeof(RunCollectionRLDView); 104 119 kbViewHost.Content = Content.KnowledgeBase; … … 108 123 } finally { SuppressEvents = false; } 109 124 UpdateSuggestedInstancesCombobox(); 125 UpdateNamesComboboxes(); 126 UpdateSimilarityCalculators(); 110 127 } 111 128 … … 140 157 } 141 158 159 private void UpdateNamesComboboxes() { 160 var selectedSolutionName = solutionNameComboBox.SelectedIndex >= 0 ? (string)solutionNameComboBox.SelectedItem : string.Empty; 161 var selectedQualityName = qualityNameComboBox.SelectedIndex >= 0 ? (string)qualityNameComboBox.SelectedItem : string.Empty; 162 163 solutionNameComboBox.Items.Clear(); 164 qualityNameComboBox.Items.Clear(); 165 if (Content == null) return; 166 var qualityNames = new HashSet<string>(Content.SolutionPool.SelectMany(x => x.Variables).Where(x => x.Value is DoubleValue).Select(x => x.Name)); 167 var solutionNames = Content.SolutionPool.SelectMany(x => x.Variables).Where(x => !qualityNames.Contains(x.Name)); 168 169 foreach (var sn in solutionNames.GroupBy(x => x.Name).OrderBy(x => x.Key)) { 170 solutionNameComboBox.Items.Add(sn.Key); 171 // either it was previously selected, or the variable value is defined in the HeuristicLab.Encodings sub-namespace 172 if (sn.Key == selectedSolutionName || (string.IsNullOrEmpty(selectedSolutionName) && sn.All(x => x.Value != null && x.Value.GetType().FullName.StartsWith("HeuristicLab.Encodings.")))) 173 solutionNameComboBox.SelectedItem = sn.Key; 174 } 175 foreach (var qn in qualityNames.OrderBy(x => x)) { 176 qualityNameComboBox.Items.Add(qn); 177 if (qn == selectedQualityName || string.IsNullOrEmpty(selectedQualityName)) qualityNameComboBox.SelectedItem = qn; 178 } 179 } 180 181 private void UpdateSimilarityCalculators() { 182 var selected = (ISolutionSimilarityCalculator)(similarityComboBox.SelectedIndex >= 0 ? similarityComboBox.SelectedItem : null); 183 similarityComboBox.Items.Clear(); 184 185 if (Content == null || Content.Problem == null) return; 186 187 foreach (var calc in Content.Problem.Operators.OfType<ISolutionSimilarityCalculator>()) { 188 similarityComboBox.Items.Add(calc); 189 if (selected != null && calc.ItemName == selected.ItemName) similarityComboBox.SelectedItem = calc; 190 } 191 if (selected == null && similarityComboBox.Items.Count > 0) 192 similarityComboBox.SelectedIndex = 0; 193 } 194 142 195 #region Event Handlers 143 196 #region Content events 144 197 private void ContentOnProblemChanged(object sender, EventArgs eventArgs) { 145 198 UpdateSuggestedInstancesCombobox(); 199 UpdateSimilarityCalculators(); 146 200 SetEnabledStateOfControls(); 147 201 } … … 171 225 UpdateSuggestedInstancesCombobox(); 172 226 } 227 228 private void SolutionPoolOnChanged(object sender, EventArgs e) { 229 UpdateNamesComboboxes(); 230 if (qualityNameComboBox.SelectedIndex >= 0) { 231 var qualityName = (string)qualityNameComboBox.SelectedItem; 232 UpdateSolutionQualityAnalysis(qualityName); 233 } 234 if (similarityComboBox.SelectedIndex >= 0) { 235 var calculator = (ISolutionSimilarityCalculator)similarityComboBox.SelectedItem; 236 UpdateSolutionDiversityAnalysis(calculator); 237 UpdateSolutionFdcAnalysis(calculator); 238 UpdateSolutionLengthScaleAnalysis(calculator); 239 } else solutionsDiversityViewHost.Content = null; 240 } 173 241 #endregion 174 242 … … 217 285 progress.ProgressStateChanged += OkbDownloadProgressOnStateChanged; 218 286 Content.UpdateKnowledgeBaseAsync(progress); 219 MainFormManager.GetMainForm< MainForm.WindowsForms.MainForm>().AddOperationProgressToView(progressPanel, progress);287 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(progressPanel, progress); 220 288 progressPanel.Visible = true; 221 289 SetEnabledStateOfControls(); … … 268 336 } 269 337 338 private void UpdateSolutionQualityAnalysis(string qualityName) { 339 var dt = solutionsQualityViewHost.Content as DataTable; 340 if (dt == null) { 341 dt = QualityDistributionAnalyzer.PrepareTable(qualityName); 342 solutionsQualityViewHost.Content = dt; 343 } 344 QualityDistributionAnalyzer.UpdateTable(dt, Content.SolutionPool.Where(x => x.Variables.ContainsKey(qualityName)).Select(x => x.Variables[qualityName].Value).OfType<DoubleValue>().Select(x => x.Value)); 345 } 346 347 private void UpdateSolutionDiversityAnalysis(ISolutionSimilarityCalculator calculator) { 348 try { 349 solutionsDiversityViewHost.Content = null; 350 if (Content.SolutionPool == null) return; 351 var similarities = new double[Content.SolutionPool.Count, Content.SolutionPool.Count]; 352 for (int i = 0; i < Content.SolutionPool.Count; i++) { 353 for (int j = 0; j < Content.SolutionPool.Count; j++) 354 similarities[i, j] = calculator.CalculateSolutionSimilarity(Content.SolutionPool[i], Content.SolutionPool[j]); 355 } 356 var hm = new HeatMap(similarities, "Solution Similarities", 0.0, 1.0); 357 solutionsDiversityViewHost.Content = hm; 358 } catch { } 359 } 360 361 private void UpdateSolutionFdcAnalysis(ISolutionSimilarityCalculator calculator) { 362 try { 363 solutionsFdcViewHost.Content = null; 364 if (Content.SolutionPool == null) return; 365 var points = new List<Point2D<double>>(); 366 for (int i = 0; i < Content.SolutionPool.Count; i++) { 367 for (int j = 0; j < Content.SolutionPool.Count; j++) { 368 if (i == j) continue; 369 var qDiff = Math.Abs(((DoubleValue)Content.SolutionPool[i].Variables[calculator.QualityVariableName].Value).Value - ((DoubleValue)Content.SolutionPool[j].Variables[calculator.QualityVariableName].Value).Value); 370 points.Add(new Point2D<double>(qDiff, 1.0 - calculator.CalculateSolutionSimilarity(Content.SolutionPool[i], Content.SolutionPool[j]))); 371 } 372 } 373 var splot = new ScatterPlot("Fitness-Distance", ""); 374 var row = new ScatterPlotDataRow("Fdc", "", points); 375 row.VisualProperties.PointSize = 7; 376 splot.Rows.Add(row); 377 solutionsFdcViewHost.Content = splot; 378 } catch { } 379 } 380 381 private void UpdateSolutionLengthScaleAnalysis(ISolutionSimilarityCalculator calculator) { 382 try { 383 solutionsLengthScaleViewHost.Content = null; 384 if (Content.SolutionPool == null) return; 385 var dt = solutionsLengthScaleViewHost.Content as DataTable; 386 if (dt == null) { 387 dt = QualityDistributionAnalyzer.PrepareTable("Length Scale"); 388 solutionsLengthScaleViewHost.Content = dt; 389 } 390 391 QualityDistributionAnalyzer.UpdateTable(dt, CalculateLengthScale(calculator)); 392 } catch { } 393 } 394 395 private IEnumerable<double> CalculateLengthScale(ISolutionSimilarityCalculator calculator) { 396 for (int i = 0; i < Content.SolutionPool.Count; i++) { 397 for (int j = 0; j < Content.SolutionPool.Count; j++) { 398 if (i == j) continue; 399 var sim = calculator.CalculateSolutionSimilarity(Content.SolutionPool[i], Content.SolutionPool[j]); 400 if (sim.IsAlmost(0)) continue; 401 var qDiff = Math.Abs(((DoubleValue)Content.SolutionPool[i].Variables[calculator.QualityVariableName].Value).Value - ((DoubleValue)Content.SolutionPool[j].Variables[calculator.QualityVariableName].Value).Value); 402 yield return qDiff / sim; 403 } 404 } 405 } 406 270 407 private void SuggestedInstancesComboBoxOnSelectedIndexChanged(object sender, EventArgs e) { 271 408 SetEnabledStateOfControls(); 272 409 } 410 411 private void qualityNameComboBox_SelectedIndexChanged(object sender, EventArgs e) { 412 if (qualityNameComboBox.SelectedIndex < 0) return; 413 solutionsQualityViewHost.Content = null; 414 solutionsDiversityViewHost.Content = null; 415 var qualityName = (string)qualityNameComboBox.SelectedItem; 416 UpdateSolutionQualityAnalysis(qualityName); 417 var calculator = (ISolutionSimilarityCalculator)similarityComboBox.SelectedItem; 418 if (calculator != null) calculator.QualityVariableName = qualityName; 419 UpdateSolutionDiversityAnalysis(calculator); 420 UpdateSolutionFdcAnalysis(calculator); 421 UpdateSolutionLengthScaleAnalysis(calculator); 422 } 423 424 private void solutionNameComboBox_SelectedIndexChanged(object sender, EventArgs e) { 425 var calculator = (ISolutionSimilarityCalculator)similarityComboBox.SelectedItem; 426 if (calculator != null) calculator.SolutionVariableName = (string)solutionNameComboBox.SelectedItem; 427 UpdateSolutionDiversityAnalysis(calculator); 428 UpdateSolutionFdcAnalysis(calculator); 429 UpdateSolutionLengthScaleAnalysis(calculator); 430 } 431 432 private void similarityComboBox_SelectedIndexChanged(object sender, EventArgs e) { 433 var calculator = (ISolutionSimilarityCalculator)similarityComboBox.SelectedItem; 434 if (calculator != null) { 435 calculator.SolutionVariableName = (string)solutionNameComboBox.SelectedItem; 436 calculator.QualityVariableName = (string)qualityNameComboBox.SelectedItem; 437 } 438 UpdateSolutionDiversityAnalysis(calculator); 439 UpdateSolutionFdcAnalysis(calculator); 440 UpdateSolutionLengthScaleAnalysis(calculator); 441 } 273 442 } 274 443 } -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Views/3.3/HeuristicLab.OptimizationExpertSystem.Views-3.3.csproj
r13561 r13663 126 126 <SpecificVersion>False</SpecificVersion> 127 127 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath> 128 <Private>False</Private> 129 </Reference> 130 <Reference Include="HeuristicLab.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 131 <SpecificVersion>False</SpecificVersion> 132 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Operators-3.3.dll</HintPath> 128 133 <Private>False</Private> 129 134 </Reference> -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/ExpertSystem.cs
r13649 r13663 41 41 using SingleObjectiveOKBProblem = HeuristicLab.Clients.OKB.RunCreation.SingleObjectiveOKBProblem; 42 42 43 namespace HeuristicLab.OptimizationExpertSystem {43 namespace HeuristicLab.OptimizationExpertSystem.Common { 44 44 [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.")] 45 45 [StorableClass] … … 123 123 } 124 124 125 [Storable(Name = "solutionPool")] 126 private ItemList<IScope> oldBackwardsCompatible; 127 [Storable(Name = "newSolutionPool")] 128 private CheckedItemList<IScope> solutionPool; 129 public CheckedItemList<IScope> SolutionPool { 130 get { return solutionPool; } 131 set { 132 if (solutionPool == value) return; 133 solutionPool = value; 134 OnPropertyChanged("SolutionPool"); 135 } 136 } 137 125 138 [Storable] 126 139 private BidirectionalLookup<long, IRun> algorithmId2RunMapping; … … 155 168 algorithmId2AlgorithmInstanceMapping.Add(kvp.Key, cloner.Clone(kvp.Value)); 156 169 } 170 currentResult = cloner.Clone(original.currentResult); 171 solutionPool = cloner.Clone(original.solutionPool); 157 172 currentInstance = cloner.Clone(original.currentInstance); 158 173 RegisterEventHandlers(); … … 167 182 problemInstances = new RunCollection(); 168 183 problem = new SingleObjectiveOKBProblem(); 184 solutionPool = new CheckedItemList<IScope>(); 169 185 algorithmId2RunMapping = new BidirectionalLookup<long, IRun>(); 170 186 algorithmId2AlgorithmInstanceMapping = new BidirectionalDictionary<long, IAlgorithm>(); … … 183 199 private void AfterDeserialization() { 184 200 readOnlySuggestedInstances = suggestedInstances.AsReadOnly(); 201 // BackwardsCompatibility3.3 202 #region Backwards compatible code, remove with trunk integration 203 if (oldBackwardsCompatible != null) solutionPool = new CheckedItemList<IScope>(solutionPool); 204 else if (solutionPool == null) solutionPool = new CheckedItemList<IScope>(); 205 #endregion 185 206 RegisterEventHandlers(); 186 207 } … … 395 416 alg.ExceptionOccurred -= AlgorithmOnExceptionOccurred; 396 417 alg.ExecutionTimeChanged -= AlgorithmOnExecutionTimeChanged; 418 foreach (var solution in alg.Results.Where(x => x.Name.ToLower().Contains("solution")).Select(x => x.Value).OfType<IScope>()) { 419 solutionPool.Add(solution); 420 } 421 Runs.Add(alg.Runs.Last()); 397 422 if (algWh != null) algWh.Set(); 398 423 } -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/HeuristicLab.OptimizationExpertSystem.Common-3.3.csproj
r13662 r13663 8 8 <OutputType>Library</OutputType> 9 9 <AppDesignerFolder>Properties</AppDesignerFolder> 10 <RootNamespace>HeuristicLab.OptimizationExpertSystem </RootNamespace>11 <AssemblyName>HeuristicLab.OptimizationExpertSystem -3.3</AssemblyName>10 <RootNamespace>HeuristicLab.OptimizationExpertSystem.Common</RootNamespace> 11 <AssemblyName>HeuristicLab.OptimizationExpertSystem.Common-3.3</AssemblyName> 12 12 <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> 13 13 <FileAlignment>512</FileAlignment> -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Plugin.cs.frame
r12847 r13663 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. … … 22 22 using HeuristicLab.PluginInfrastructure; 23 23 24 namespace HeuristicLab.OptimizationExpertSystem {24 namespace HeuristicLab.OptimizationExpertSystem.Common { 25 25 /// <summary> 26 26 /// Plugin class for HeuristicLab.OptimizationExpertSystem plugin. 27 27 /// </summary> 28 [Plugin("HeuristicLab.OptimizationExpertSystem ", "3.3.12.$WCREV$")]29 [PluginFile("HeuristicLab.OptimizationExpertSystem -3.3.dll", PluginFileType.Assembly)]28 [Plugin("HeuristicLab.OptimizationExpertSystem.Common", "3.3.12.$WCREV$")] 29 [PluginFile("HeuristicLab.OptimizationExpertSystem.Common-3.3.dll", PluginFileType.Assembly)] 30 30 [PluginDependency("HeuristicLab.Analysis", "3.3")] 31 31 [PluginDependency("HeuristicLab.Collections", "3.3")]
Note: See TracChangeset
for help on using the changeset viewer.