Changeset 13663


Ignore:
Timestamp:
03/07/16 21:29:00 (5 years ago)
Author:
abeham
Message:

#2457: worked on expert system

Location:
branches/PerformanceComparison
Files:
6 edited
1 moved

Legend:

Unmodified
Added
Removed
  • branches/PerformanceComparison/HeuristicLab.Analysis/3.3/QualityAnalysis/QualityDistributionAnalyzer.cs

    r12012 r13663  
    2020#endregion
    2121
    22 using System.Linq;
    2322using HeuristicLab.Common;
    2423using HeuristicLab.Core;
     
    2827using HeuristicLab.Parameters;
    2928using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     29using System.Collections.Generic;
     30using System.Linq;
    3031
    3132namespace HeuristicLab.Analysis.QualityAnalysis {
     
    3334  [StorableClass]
    3435  public class QualityDistributionAnalyzer : SingleSuccessorOperator, IAnalyzer, IIterationBasedOperator, ISingleObjectiveOperator {
     36    private const string TableDescription = "Shows the quality distributions in the current population.";
    3537
    3638    #region Parameter properties
     
    9395    }
    9496
     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
    95114    public override IOperation Apply() {
    96115      DataTable qualityDistribution = null;
    97       ResultCollection results = ResultsParameter.ActualValue;
    98       string description = "Shows the quality distributions in the current population.";
     116      var results = ResultsParameter.ActualValue;
    99117      if (results.ContainsKey(HistogramName)) {
    100         qualityDistribution = results[HistogramName].Value as DataTable;
     118        qualityDistribution = (DataTable)results[HistogramName].Value;
    101119      } 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));
    106122      }
    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));
    115125
    116126      if (StoreHistory) {
    117         string historyResultName = HistogramName + " History";
     127        var historyResultName = HistogramName + " History";
    118128        DataTableHistory qdHistory = null;
    119129        if (results.ContainsKey(historyResultName)) {
    120           qdHistory = results[historyResultName].Value as DataTableHistory;
     130          qdHistory = (DataTableHistory)results[historyResultName].Value;
    121131        } else {
    122132          qdHistory = new DataTableHistory();
    123133          results.Add(new Result(historyResultName, qdHistory));
    124134        }
    125         DataTable table = (DataTable)qualityDistribution.Clone();
    126         IntValue iteration = IterationsParameter.ActualValue;
     135        var table = (DataTable)qualityDistribution.Clone();
     136        var iteration = IterationsParameter.ActualValue;
    127137        if (iteration != null) {
    128           string iterationName = IterationsParameter.ActualName;
     138          var iterationName = IterationsParameter.ActualName;
    129139          if (iterationName.EndsWith("s")) iterationName = iterationName.Remove(iterationName.Length - 1);
    130           string appendix = " at " + iterationName + " " + iteration.Value.ToString();
     140          var appendix = " at " + iterationName + " " + iteration.Value.ToString();
    131141          table.Name += appendix;
    132142          table.Rows["QualityDistribution"].VisualProperties.DisplayName += appendix;
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Views/3.3/ExpertSystemView.Designer.cs

    r13649 r13663  
    5151      this.runsTabPage = new System.Windows.Forms.TabPage();
    5252      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();
    5371      this.okbTabPage = new System.Windows.Forms.TabPage();
    5472      this.kbViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
     
    6583      this.okbDownloadButton = new System.Windows.Forms.Button();
    6684      this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
     85      this.solutionsFdcTabPage = new System.Windows.Forms.TabPage();
     86      this.solutionsFdcViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    6787      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    6888      this.tabControl.SuspendLayout();
     
    7090      this.algorithmTabPage.SuspendLayout();
    7191      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();
    7299      this.okbTabPage.SuspendLayout();
    73100      this.problemInstancesTabPage.SuspendLayout();
     
    76103      this.mapTabPage.SuspendLayout();
    77104      ((System.ComponentModel.ISupportInitialize)(this.instanceMapChart)).BeginInit();
     105      this.solutionsFdcTabPage.SuspendLayout();
    78106      this.SuspendLayout();
    79107      //
     
    83111      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
    84112      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);
    86114      //
    87115      // infoLabel
    88116      //
    89       this.infoLabel.Location = new System.Drawing.Point(530, 3);
     117      this.infoLabel.Location = new System.Drawing.Point(673, 3);
    90118      //
    91119      // evaluationsLimitabel
     
    104132      this.maxEvaluationsTextBox.Location = new System.Drawing.Point(75, 26);
    105133      this.maxEvaluationsTextBox.Name = "maxEvaluationsTextBox";
    106       this.maxEvaluationsTextBox.Size = new System.Drawing.Size(449, 20);
     134      this.maxEvaluationsTextBox.Size = new System.Drawing.Size(592, 20);
    107135      this.maxEvaluationsTextBox.TabIndex = 6;
    108136      this.maxEvaluationsTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.MaxEvaluationsTextBoxOnValidating);
     
    117145      this.tabControl.Controls.Add(this.algorithmTabPage);
    118146      this.tabControl.Controls.Add(this.runsTabPage);
     147      this.tabControl.Controls.Add(this.solutionsTabPage);
    119148      this.tabControl.Controls.Add(this.okbTabPage);
    120149      this.tabControl.Controls.Add(this.problemInstancesTabPage);
     
    122151      this.tabControl.Name = "tabControl";
    123152      this.tabControl.SelectedIndex = 0;
    124       this.tabControl.Size = new System.Drawing.Size(546, 332);
     153      this.tabControl.Size = new System.Drawing.Size(689, 454);
    125154      this.tabControl.TabIndex = 17;
    126155      //
     
    132161      this.problemTabPage.Name = "problemTabPage";
    133162      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);
    135164      this.problemTabPage.TabIndex = 1;
    136165      this.problemTabPage.Text = "Problem";
     
    146175      this.problemViewHost.Name = "problemViewHost";
    147176      this.problemViewHost.ReadOnly = false;
    148       this.problemViewHost.Size = new System.Drawing.Size(532, 300);
     177      this.problemViewHost.Size = new System.Drawing.Size(675, 422);
    149178      this.problemViewHost.TabIndex = 2;
    150179      this.problemViewHost.ViewsLabelVisible = false;
     
    160189      this.algorithmTabPage.Name = "algorithmTabPage";
    161190      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);
    163192      this.algorithmTabPage.TabIndex = 4;
    164193      this.algorithmTabPage.Text = "Algorithm";
     
    168197      //
    169198      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);
    171200      this.algorithmStartButton.Name = "algorithmStartButton";
    172201      this.algorithmStartButton.Size = new System.Drawing.Size(26, 23);
     
    187216      this.algorithmViewHost.Name = "algorithmViewHost";
    188217      this.algorithmViewHost.ReadOnly = false;
    189       this.algorithmViewHost.Size = new System.Drawing.Size(526, 264);
     218      this.algorithmViewHost.Size = new System.Drawing.Size(669, 386);
    190219      this.algorithmViewHost.TabIndex = 2;
    191220      this.algorithmViewHost.ViewsLabelVisible = true;
     
    209238      this.suggestedInstancesComboBox.Location = new System.Drawing.Point(178, 6);
    210239      this.suggestedInstancesComboBox.Name = "suggestedInstancesComboBox";
    211       this.suggestedInstancesComboBox.Size = new System.Drawing.Size(322, 21);
     240      this.suggestedInstancesComboBox.Size = new System.Drawing.Size(465, 21);
    212241      this.suggestedInstancesComboBox.TabIndex = 0;
    213242      this.suggestedInstancesComboBox.SelectedIndexChanged += new System.EventHandler(this.SuggestedInstancesComboBoxOnSelectedIndexChanged);
     
    219248      this.runsTabPage.Name = "runsTabPage";
    220249      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);
    222251      this.runsTabPage.TabIndex = 3;
    223252      this.runsTabPage.Text = "Runs";
     
    232261      this.runsView.Name = "runsView";
    233262      this.runsView.ReadOnly = false;
    234       this.runsView.Size = new System.Drawing.Size(532, 300);
     263      this.runsView.Size = new System.Drawing.Size(675, 422);
    235264      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;
    236482      //
    237483      // okbTabPage
     
    241487      this.okbTabPage.Name = "okbTabPage";
    242488      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);
    244490      this.okbTabPage.TabIndex = 5;
    245491      this.okbTabPage.Text = "Knowledge Base";
     
    255501      this.kbViewHost.Name = "kbViewHost";
    256502      this.kbViewHost.ReadOnly = true;
    257       this.kbViewHost.Size = new System.Drawing.Size(532, 300);
     503      this.kbViewHost.Size = new System.Drawing.Size(675, 422);
    258504      this.kbViewHost.TabIndex = 3;
    259505      this.kbViewHost.ViewsLabelVisible = true;
     
    269515      this.problemInstancesTabPage.Name = "problemInstancesTabPage";
    270516      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);
    272518      this.problemInstancesTabPage.TabIndex = 6;
    273519      this.problemInstancesTabPage.Text = "Problem Instances";
     
    303549      this.problemInstancesTabControl.Name = "problemInstancesTabControl";
    304550      this.problemInstancesTabControl.SelectedIndex = 0;
    305       this.problemInstancesTabControl.Size = new System.Drawing.Size(532, 268);
     551      this.problemInstancesTabControl.Size = new System.Drawing.Size(675, 390);
    306552      this.problemInstancesTabControl.TabIndex = 4;
    307553      //
     
    312558      this.instancesTabPage.Name = "instancesTabPage";
    313559      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);
    315561      this.instancesTabPage.TabIndex = 0;
    316562      this.instancesTabPage.Text = "Instances";
     
    326572      this.problemInstancesView.Name = "problemInstancesView";
    327573      this.problemInstancesView.ReadOnly = false;
    328       this.problemInstancesView.Size = new System.Drawing.Size(518, 236);
     574      this.problemInstancesView.Size = new System.Drawing.Size(661, 358);
    329575      this.problemInstancesView.TabIndex = 0;
    330576      this.problemInstancesView.ViewsLabelVisible = true;
     
    337583      this.mapTabPage.Name = "mapTabPage";
    338584      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);
    340586      this.mapTabPage.TabIndex = 1;
    341587      this.mapTabPage.Text = "Map";
     
    371617      this.instanceMapChart.Series.Add(series1);
    372618      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);
    374620      this.instanceMapChart.TabIndex = 0;
    375621      //
     
    391637      this.progressPanel.Location = new System.Drawing.Point(0, 81);
    392638      this.progressPanel.Name = "progressPanel";
    393       this.progressPanel.Size = new System.Drawing.Size(549, 332);
     639      this.progressPanel.Size = new System.Drawing.Size(692, 454);
    394640      this.progressPanel.TabIndex = 2;
    395641      this.progressPanel.Visible = false;
     
    401647      this.okbDownloadButton.Location = new System.Drawing.Point(6, 52);
    402648      this.okbDownloadButton.Name = "okbDownloadButton";
    403       this.okbDownloadButton.Size = new System.Drawing.Size(518, 23);
     649      this.okbDownloadButton.Size = new System.Drawing.Size(661, 23);
    404650      this.okbDownloadButton.TabIndex = 1;
    405651      this.okbDownloadButton.Text = "Download from OKB";
     
    413659      this.openFileDialog.Filter = "HeuristicLab Files|*.hl|All Files|*.*";
    414660      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;
    415686      //
    416687      // ExpertSystemView
     
    423694      this.Controls.Add(this.progressPanel);
    424695      this.Name = "ExpertSystemView";
    425       this.Size = new System.Drawing.Size(549, 413);
     696      this.Size = new System.Drawing.Size(692, 535);
    426697      this.Controls.SetChildIndex(this.progressPanel, 0);
    427698      this.Controls.SetChildIndex(this.maxEvaluationsTextBox, 0);
     
    438709      this.algorithmTabPage.PerformLayout();
    439710      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);
    440719      this.okbTabPage.ResumeLayout(false);
    441720      this.problemInstancesTabPage.ResumeLayout(false);
     
    445724      this.mapTabPage.ResumeLayout(false);
    446725      ((System.ComponentModel.ISupportInitialize)(this.instanceMapChart)).EndInit();
     726      this.solutionsFdcTabPage.ResumeLayout(false);
    447727      this.ResumeLayout(false);
    448728      this.PerformLayout();
     
    478758    private System.Windows.Forms.Label label1;
    479759    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;
    480780  }
    481781}
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Views/3.3/ExpertSystemView.cs

    r13649 r13663  
    2020#endregion
    2121
     22using HeuristicLab.Analysis;
     23using HeuristicLab.Analysis.QualityAnalysis;
     24using HeuristicLab.Common;
    2225using HeuristicLab.Common.Resources;
    2326using HeuristicLab.Core.Views;
     27using HeuristicLab.Data;
    2428using HeuristicLab.MainForm;
    2529using HeuristicLab.Optimization;
    2630using HeuristicLab.Optimization.Views;
    2731using System;
     32using System.Collections.Generic;
    2833using System.ComponentModel;
    2934using System.Linq;
     
    7075      Content.SuggestedInstances.ItemsRemoved -= SuggestedInstancesOnChanged;
    7176      Content.SuggestedInstances.ItemsReplaced -= SuggestedInstancesOnChanged;
     77      Content.SolutionPool.ItemsAdded -= SolutionPoolOnChanged;
     78      Content.SolutionPool.ItemsRemoved -= SolutionPoolOnChanged;
     79      Content.SolutionPool.ItemsReplaced -= SolutionPoolOnChanged;
     80      Content.SolutionPool.CollectionReset -= SolutionPoolOnChanged;
    7281      if (Content.Problem != null) Content.Problem.ProblemChanged -= ContentOnProblemChanged;
    7382      base.DeregisterContentEvents();
     
    8190      Content.SuggestedInstances.ItemsRemoved += SuggestedInstancesOnChanged;
    8291      Content.SuggestedInstances.ItemsReplaced += SuggestedInstancesOnChanged;
     92      Content.SolutionPool.ItemsAdded += SolutionPoolOnChanged;
     93      Content.SolutionPool.ItemsRemoved += SolutionPoolOnChanged;
     94      Content.SolutionPool.ItemsReplaced += SolutionPoolOnChanged;
     95      Content.SolutionPool.CollectionReset += SolutionPoolOnChanged;
    8396      if (Content.Problem != null) Content.Problem.ProblemChanged += ContentOnProblemChanged;
    8497    }
     
    95108          algorithmViewHost.Content = null;
    96109          runsView.Content = null;
     110          solutionsViewHost.Content = null;
    97111          kbViewHost.Content = null;
    98112          problemInstancesView.Content = null;
     
    101115          problemViewHost.Content = Content.Problem;
    102116          runsView.Content = Content.Runs;
     117          solutionsViewHost.Content = Content.SolutionPool;
    103118          kbViewHost.ViewType = typeof(RunCollectionRLDView);
    104119          kbViewHost.Content = Content.KnowledgeBase;
     
    108123      } finally { SuppressEvents = false; }
    109124      UpdateSuggestedInstancesCombobox();
     125      UpdateNamesComboboxes();
     126      UpdateSimilarityCalculators();
    110127    }
    111128
     
    140157    }
    141158
     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
    142195    #region Event Handlers
    143196    #region Content events
    144197    private void ContentOnProblemChanged(object sender, EventArgs eventArgs) {
    145198      UpdateSuggestedInstancesCombobox();
     199      UpdateSimilarityCalculators();
    146200      SetEnabledStateOfControls();
    147201    }
     
    171225      UpdateSuggestedInstancesCombobox();
    172226    }
     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    }
    173241    #endregion
    174242
     
    217285      progress.ProgressStateChanged += OkbDownloadProgressOnStateChanged;
    218286      Content.UpdateKnowledgeBaseAsync(progress);
    219       MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().AddOperationProgressToView(progressPanel, progress);
     287      MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(progressPanel, progress);
    220288      progressPanel.Visible = true;
    221289      SetEnabledStateOfControls();
     
    268336    }
    269337
     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
    270407    private void SuggestedInstancesComboBoxOnSelectedIndexChanged(object sender, EventArgs e) {
    271408      SetEnabledStateOfControls();
    272409    }
     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    }
    273442  }
    274443}
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Views/3.3/HeuristicLab.OptimizationExpertSystem.Views-3.3.csproj

    r13561 r13663  
    126126      <SpecificVersion>False</SpecificVersion>
    127127      <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>
    128133      <Private>False</Private>
    129134    </Reference>
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/ExpertSystem.cs

    r13649 r13663  
    4141using SingleObjectiveOKBProblem = HeuristicLab.Clients.OKB.RunCreation.SingleObjectiveOKBProblem;
    4242
    43 namespace HeuristicLab.OptimizationExpertSystem {
     43namespace HeuristicLab.OptimizationExpertSystem.Common {
    4444  [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.")]
    4545  [StorableClass]
     
    123123    }
    124124
     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   
    125138    [Storable]
    126139    private BidirectionalLookup<long, IRun> algorithmId2RunMapping;
     
    155168        algorithmId2AlgorithmInstanceMapping.Add(kvp.Key, cloner.Clone(kvp.Value));
    156169      }
     170      currentResult = cloner.Clone(original.currentResult);
     171      solutionPool = cloner.Clone(original.solutionPool);
    157172      currentInstance = cloner.Clone(original.currentInstance);
    158173      RegisterEventHandlers();
     
    167182      problemInstances = new RunCollection();
    168183      problem = new SingleObjectiveOKBProblem();
     184      solutionPool = new CheckedItemList<IScope>();
    169185      algorithmId2RunMapping = new BidirectionalLookup<long, IRun>();
    170186      algorithmId2AlgorithmInstanceMapping = new BidirectionalDictionary<long, IAlgorithm>();
     
    183199    private void AfterDeserialization() {
    184200      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
    185206      RegisterEventHandlers();
    186207    }
     
    395416        alg.ExceptionOccurred -= AlgorithmOnExceptionOccurred;
    396417        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());
    397422        if (algWh != null) algWh.Set();
    398423      }
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/HeuristicLab.OptimizationExpertSystem.Common-3.3.csproj

    r13662 r13663  
    88    <OutputType>Library</OutputType>
    99    <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>
    1212    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    1313    <FileAlignment>512</FileAlignment>
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Plugin.cs.frame

    r12847 r13663  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2222using HeuristicLab.PluginInfrastructure;
    2323
    24 namespace HeuristicLab.OptimizationExpertSystem {
     24namespace HeuristicLab.OptimizationExpertSystem.Common {
    2525  /// <summary>
    2626  /// Plugin class for HeuristicLab.OptimizationExpertSystem plugin.
    2727  /// </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)]
    3030  [PluginDependency("HeuristicLab.Analysis", "3.3")]
    3131  [PluginDependency("HeuristicLab.Collections", "3.3")]
Note: See TracChangeset for help on using the changeset viewer.