Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/08/16 17:51:43 (9 years ago)
Author:
abeham
Message:

#2457: Worked on expert system

Location:
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/ExpertSystemView.Designer.cs

    r13667 r13668  
    3838      System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
    3939      System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
     40      System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea2 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
     41      System.Windows.Forms.DataVisualization.Charting.Legend legend2 = new System.Windows.Forms.DataVisualization.Charting.Legend();
    4042      System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series();
     43      System.Windows.Forms.DataVisualization.Charting.Series series3 = new System.Windows.Forms.DataVisualization.Charting.Series();
    4144      this.evaluationsLimitabel = new System.Windows.Forms.Label();
    4245      this.maxEvaluationsTextBox = new System.Windows.Forms.TextBox();
     
    4548      this.problemViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    4649      this.algorithmTabPage = new System.Windows.Forms.TabPage();
     50      this.algorithmCloneButton = new System.Windows.Forms.Button();
    4751      this.algorithmStartButton = new System.Windows.Forms.Button();
    4852      this.algorithmViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
     
    6569      this.solutionsDiversityTabPage = new System.Windows.Forms.TabPage();
    6670      this.solutionsDiversityViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
     71      this.solutionsFdcTabPage = new System.Windows.Forms.TabPage();
     72      this.solutionsFdcViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    6773      this.solutionsLengthScaleTabPage = new System.Windows.Forms.TabPage();
    6874      this.solutionsLengthScaleViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    6975      this.solutionsNetworkTabPage = new System.Windows.Forms.TabPage();
    70       this.solutionsNetworkViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
     76      this.solutionsNetworkChart = new HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart();
    7177      this.okbTabPage = new System.Windows.Forms.TabPage();
    7278      this.kbViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
     
    8389      this.okbDownloadButton = new System.Windows.Forms.Button();
    8490      this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
    85       this.solutionsFdcTabPage = new System.Windows.Forms.TabPage();
    86       this.solutionsFdcViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    8791      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    8892      this.tabControl.SuspendLayout();
     
    9599      this.solutionsQualityTabPage.SuspendLayout();
    96100      this.solutionsDiversityTabPage.SuspendLayout();
     101      this.solutionsFdcTabPage.SuspendLayout();
    97102      this.solutionsLengthScaleTabPage.SuspendLayout();
    98103      this.solutionsNetworkTabPage.SuspendLayout();
     104      ((System.ComponentModel.ISupportInitialize)(this.solutionsNetworkChart)).BeginInit();
    99105      this.okbTabPage.SuspendLayout();
    100106      this.problemInstancesTabPage.SuspendLayout();
     
    103109      this.mapTabPage.SuspendLayout();
    104110      ((System.ComponentModel.ISupportInitialize)(this.instanceMapChart)).BeginInit();
    105       this.solutionsFdcTabPage.SuspendLayout();
    106111      this.SuspendLayout();
    107112      //
     
    182187      // algorithmTabPage
    183188      //
     189      this.algorithmTabPage.Controls.Add(this.algorithmCloneButton);
    184190      this.algorithmTabPage.Controls.Add(this.algorithmStartButton);
    185191      this.algorithmTabPage.Controls.Add(this.algorithmViewHost);
     
    194200      this.algorithmTabPage.UseVisualStyleBackColor = true;
    195201      //
     202      // algorithmCloneButton
     203      //
     204      this.algorithmCloneButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     205      this.algorithmCloneButton.Location = new System.Drawing.Point(649, 5);
     206      this.algorithmCloneButton.Name = "algorithmCloneButton";
     207      this.algorithmCloneButton.Size = new System.Drawing.Size(26, 23);
     208      this.algorithmCloneButton.TabIndex = 3;
     209      this.algorithmCloneButton.Text = "Clone";
     210      this.algorithmCloneButton.UseVisualStyleBackColor = true;
     211      this.algorithmCloneButton.Click += new System.EventHandler(this.AlgorithmCloneButtonOnClick);
     212      //
    196213      // algorithmStartButton
    197214      //
    198215      this.algorithmStartButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    199       this.algorithmStartButton.Location = new System.Drawing.Point(649, 5);
     216      this.algorithmStartButton.Location = new System.Drawing.Point(617, 5);
    200217      this.algorithmStartButton.Name = "algorithmStartButton";
    201218      this.algorithmStartButton.Size = new System.Drawing.Size(26, 23);
     
    238255      this.suggestedInstancesComboBox.Location = new System.Drawing.Point(178, 6);
    239256      this.suggestedInstancesComboBox.Name = "suggestedInstancesComboBox";
    240       this.suggestedInstancesComboBox.Size = new System.Drawing.Size(465, 21);
     257      this.suggestedInstancesComboBox.Size = new System.Drawing.Size(433, 21);
    241258      this.suggestedInstancesComboBox.TabIndex = 0;
    242259      this.suggestedInstancesComboBox.SelectedIndexChanged += new System.EventHandler(this.SuggestedInstancesComboBoxOnSelectedIndexChanged);
     
    431448      this.solutionsDiversityViewHost.ViewType = null;
    432449      //
     450      // solutionsFdcTabPage
     451      //
     452      this.solutionsFdcTabPage.Controls.Add(this.solutionsFdcViewHost);
     453      this.solutionsFdcTabPage.Location = new System.Drawing.Point(4, 22);
     454      this.solutionsFdcTabPage.Name = "solutionsFdcTabPage";
     455      this.solutionsFdcTabPage.Padding = new System.Windows.Forms.Padding(3);
     456      this.solutionsFdcTabPage.Size = new System.Drawing.Size(667, 366);
     457      this.solutionsFdcTabPage.TabIndex = 5;
     458      this.solutionsFdcTabPage.Text = "Fitness-Distance Analysis";
     459      this.solutionsFdcTabPage.UseVisualStyleBackColor = true;
     460      //
     461      // solutionsFdcViewHost
     462      //
     463      this.solutionsFdcViewHost.Caption = "View";
     464      this.solutionsFdcViewHost.Content = null;
     465      this.solutionsFdcViewHost.Dock = System.Windows.Forms.DockStyle.Fill;
     466      this.solutionsFdcViewHost.Enabled = false;
     467      this.solutionsFdcViewHost.Location = new System.Drawing.Point(3, 3);
     468      this.solutionsFdcViewHost.Name = "solutionsFdcViewHost";
     469      this.solutionsFdcViewHost.ReadOnly = false;
     470      this.solutionsFdcViewHost.Size = new System.Drawing.Size(661, 360);
     471      this.solutionsFdcViewHost.TabIndex = 0;
     472      this.solutionsFdcViewHost.ViewsLabelVisible = true;
     473      this.solutionsFdcViewHost.ViewType = null;
     474      //
    433475      // solutionsLengthScaleTabPage
    434476      //
     
    458500      // solutionsNetworkTabPage
    459501      //
    460       this.solutionsNetworkTabPage.Controls.Add(this.solutionsNetworkViewHost);
     502      this.solutionsNetworkTabPage.Controls.Add(this.solutionsNetworkChart);
    461503      this.solutionsNetworkTabPage.Location = new System.Drawing.Point(4, 22);
    462504      this.solutionsNetworkTabPage.Name = "solutionsNetworkTabPage";
     
    467509      this.solutionsNetworkTabPage.UseVisualStyleBackColor = true;
    468510      //
    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;
     511      // solutionsNetworkChart
     512      //
     513      chartArea1.AxisX.LabelStyle.Enabled = false;
     514      chartArea1.AxisX.LineWidth = 0;
     515      chartArea1.AxisX.MajorGrid.Enabled = false;
     516      chartArea1.AxisX.MajorTickMark.Enabled = false;
     517      chartArea1.AxisY.LabelStyle.Enabled = false;
     518      chartArea1.AxisY.LineWidth = 0;
     519      chartArea1.AxisY.MajorGrid.Enabled = false;
     520      chartArea1.AxisY.MajorTickMark.Enabled = false;
     521      chartArea1.Name = "SolutionsNetworkChartArea";
     522      this.solutionsNetworkChart.ChartAreas.Add(chartArea1);
     523      this.solutionsNetworkChart.Dock = System.Windows.Forms.DockStyle.Fill;
     524      legend1.Enabled = false;
     525      legend1.Name = "Legend1";
     526      this.solutionsNetworkChart.Legends.Add(legend1);
     527      this.solutionsNetworkChart.Location = new System.Drawing.Point(3, 3);
     528      this.solutionsNetworkChart.Name = "solutionsNetworkChart";
     529      series1.ChartArea = "SolutionsNetworkChartArea";
     530      series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Bubble;
     531      series1.IsValueShownAsLabel = true;
     532      series1.Label = "#LABEL";
     533      series1.Legend = "Legend1";
     534      series1.MarkerStyle = System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Circle;
     535      series1.Name = "SolutionSeries";
     536      series1.YValuesPerPoint = 2;
     537      this.solutionsNetworkChart.Series.Add(series1);
     538      this.solutionsNetworkChart.Size = new System.Drawing.Size(661, 360);
     539      this.solutionsNetworkChart.TabIndex = 0;
     540      this.solutionsNetworkChart.Text = "enhancedChart1";
    482541      //
    483542      // okbTabPage
     
    590649      // instanceMapChart
    591650      //
    592       chartArea1.AxisX.MajorGrid.LineColor = System.Drawing.Color.LightGray;
    593       chartArea1.AxisX.MajorGrid.LineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Dash;
    594       chartArea1.AxisY.MajorGrid.LineColor = System.Drawing.Color.LightGray;
    595       chartArea1.AxisY.MajorGrid.LineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Dash;
    596       chartArea1.Name = "Default";
    597       this.instanceMapChart.ChartAreas.Add(chartArea1);
     651      chartArea2.AxisX.MajorGrid.LineColor = System.Drawing.Color.LightGray;
     652      chartArea2.AxisX.MajorGrid.LineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Dash;
     653      chartArea2.AxisY.MajorGrid.LineColor = System.Drawing.Color.LightGray;
     654      chartArea2.AxisY.MajorGrid.LineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Dash;
     655      chartArea2.Name = "Default";
     656      this.instanceMapChart.ChartAreas.Add(chartArea2);
    598657      this.instanceMapChart.Dock = System.Windows.Forms.DockStyle.Fill;
    599       legend1.Docking = System.Windows.Forms.DataVisualization.Charting.Docking.Top;
    600       legend1.Enabled = false;
    601       legend1.Name = "Legend";
    602       this.instanceMapChart.Legends.Add(legend1);
     658      legend2.Docking = System.Windows.Forms.DataVisualization.Charting.Docking.Top;
     659      legend2.Enabled = false;
     660      legend2.Name = "Legend";
     661      this.instanceMapChart.Legends.Add(legend2);
    603662      this.instanceMapChart.Location = new System.Drawing.Point(3, 3);
    604663      this.instanceMapChart.Name = "instanceMapChart";
    605       series1.ChartArea = "Default";
    606       series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point;
    607       series1.Legend = "Legend";
    608       series1.MarkerSize = 10;
    609       series1.Name = "InstancesSeries";
    610664      series2.ChartArea = "Default";
    611665      series2.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point;
    612666      series2.Legend = "Legend";
    613       series2.MarkerColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
    614       series2.MarkerSize = 15;
    615       series2.MarkerStyle = System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Cross;
    616       series2.Name = "CurrentInstanceSeries";
    617       this.instanceMapChart.Series.Add(series1);
     667      series2.MarkerSize = 10;
     668      series2.Name = "InstancesSeries";
     669      series3.ChartArea = "Default";
     670      series3.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point;
     671      series3.Legend = "Legend";
     672      series3.MarkerColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
     673      series3.MarkerSize = 15;
     674      series3.MarkerStyle = System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Cross;
     675      series3.Name = "CurrentInstanceSeries";
    618676      this.instanceMapChart.Series.Add(series2);
     677      this.instanceMapChart.Series.Add(series3);
    619678      this.instanceMapChart.Size = new System.Drawing.Size(661, 358);
    620679      this.instanceMapChart.TabIndex = 0;
     
    659718      this.openFileDialog.Filter = "HeuristicLab Files|*.hl|All Files|*.*";
    660719      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;
    686720      //
    687721      // ExpertSystemView
     
    715749      this.solutionsQualityTabPage.ResumeLayout(false);
    716750      this.solutionsDiversityTabPage.ResumeLayout(false);
     751      this.solutionsFdcTabPage.ResumeLayout(false);
    717752      this.solutionsLengthScaleTabPage.ResumeLayout(false);
    718753      this.solutionsNetworkTabPage.ResumeLayout(false);
     754      ((System.ComponentModel.ISupportInitialize)(this.solutionsNetworkChart)).EndInit();
    719755      this.okbTabPage.ResumeLayout(false);
    720756      this.problemInstancesTabPage.ResumeLayout(false);
     
    724760      this.mapTabPage.ResumeLayout(false);
    725761      ((System.ComponentModel.ISupportInitialize)(this.instanceMapChart)).EndInit();
    726       this.solutionsFdcTabPage.ResumeLayout(false);
    727762      this.ResumeLayout(false);
    728763      this.PerformLayout();
     
    775810    private System.Windows.Forms.TabPage solutionsNetworkTabPage;
    776811    private MainForm.WindowsForms.ViewHost solutionsLengthScaleViewHost;
    777     private MainForm.WindowsForms.ViewHost solutionsNetworkViewHost;
    778812    private System.Windows.Forms.TabPage solutionsFdcTabPage;
    779813    private MainForm.WindowsForms.ViewHost solutionsFdcViewHost;
     814    private Visualization.ChartControlsExtensions.EnhancedChart solutionsNetworkChart;
     815    private System.Windows.Forms.Button algorithmCloneButton;
    780816  }
    781817}
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/ExpertSystemView.cs

    r13667 r13668  
    5757      algorithmStartButton.Text = string.Empty;
    5858      algorithmStartButton.Image = VSImageLibrary.Play;
     59      algorithmCloneButton.Text = string.Empty;
     60      algorithmCloneButton.Image = VSImageLibrary.Clone;
    5961      refreshMapButton.Text = string.Empty;
    6062      refreshMapButton.Image = VSImageLibrary.Refresh;
     
    134136      suggestedInstancesComboBox.Enabled = Content != null && !ReadOnly && !Locked && !okbDownloadInProgress;
    135137      algorithmStartButton.Enabled = Content != null && !ReadOnly && !Locked && suggestedInstancesComboBox.SelectedIndex >= 0;
     138      algorithmCloneButton.Enabled = Content != null && !ReadOnly && !Locked && suggestedInstancesComboBox.SelectedIndex >= 0;
    136139      algorithmViewHost.Enabled = Content != null && !ReadOnly && !Locked;
    137140      runsView.Enabled = Content != null;
     
    238241        UpdateSolutionFdcAnalysis(calculator);
    239242        UpdateSolutionLengthScaleAnalysis(calculator);
     243        UpdateSolutionNetworkAnalysis(calculator);
    240244      } else solutionsDiversityViewHost.Content = null;
    241245    }
     
    304308      if (suggestedInstancesComboBox.SelectedIndex >= 0)
    305309        Content.StartAlgorithmAsync(suggestedInstancesComboBox.SelectedIndex);
     310    }
     311
     312    private void AlgorithmCloneButtonOnClick(object sender, EventArgs e) {
     313      if (suggestedInstancesComboBox.SelectedIndex >= 0)
     314        MainFormManager.MainForm.ShowContent((IAlgorithm)Content.SuggestedInstances[suggestedInstancesComboBox.SelectedIndex].Clone());
    306315    }
    307316
     
    406415    }
    407416
     417    private void UpdateSolutionNetworkAnalysis(ISolutionSimilarityCalculator calculator) {
     418      try {
     419        var series = solutionsNetworkChart.Series["SolutionSeries"];
     420        series.Points.Clear();
     421        var dissimilarities = new DoubleMatrix(Content.SolutionPool.Count, Content.SolutionPool.Count);
     422        for (int i = 0; i < Content.SolutionPool.Count; i++) {
     423          for (int j = 0; j < Content.SolutionPool.Count; j++) {
     424            if (i == j) continue;
     425            dissimilarities[i, j] = 1.0 - calculator.CalculateSolutionSimilarity(Content.SolutionPool[i], Content.SolutionPool[j]);
     426          }
     427        }
     428        var coords = MultidimensionalScaling.KruskalShepard(dissimilarities);
     429        for (var i = 0; i < coords.Rows; i++) {
     430          var quality = ((DoubleValue)Content.SolutionPool[i].Variables[calculator.QualityVariableName].Value).Value;
     431          series.Points.Add(new DataPoint() {
     432            Name = i.ToString(),
     433            XValue = coords[i, 0],
     434            YValues = new[] { coords[i, 1], quality },
     435            Label = i + ": " + quality
     436          });
     437        }
     438      } catch { }
     439    }
     440
    408441    private void SuggestedInstancesComboBoxOnSelectedIndexChanged(object sender, EventArgs e) {
    409442      SetEnabledStateOfControls();
     
    421454      UpdateSolutionFdcAnalysis(calculator);
    422455      UpdateSolutionLengthScaleAnalysis(calculator);
     456      UpdateSolutionNetworkAnalysis(calculator);
    423457    }
    424458
     
    429463      UpdateSolutionFdcAnalysis(calculator);
    430464      UpdateSolutionLengthScaleAnalysis(calculator);
     465      UpdateSolutionNetworkAnalysis(calculator);
    431466    }
    432467
     
    440475      UpdateSolutionFdcAnalysis(calculator);
    441476      UpdateSolutionLengthScaleAnalysis(calculator);
     477      UpdateSolutionNetworkAnalysis(calculator);
    442478    }
    443479  }
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/HeuristicLab.OptimizationExpertSystem-3.3.csproj.user

    r13667 r13668  
    44    <StartAction>Program</StartAction>
    55    <StartProgram>C:\Users\P40311\Work\HL3\trunk\sources\bin\HeuristicLab 3.3.exe</StartProgram>
    6     <StartArguments>/start:"Optimization Expert System" /hideStarter</StartArguments>
     6    <StartArguments>/start:"Optimizer" /hideStarter</StartArguments>
    77  </PropertyGroup>
    88</Project>
Note: See TracChangeset for help on using the changeset viewer.