Free cookie consent management tool by TermsFeed Policy Generator

Changeset 10007


Ignore:
Timestamp:
09/26/13 10:30:44 (11 years ago)
Author:
ascheibe
Message:

#1886 started working on volume calculation

Location:
branches/HeuristicLab.Analysis.AlgorithmBehavior
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3/ConvexHullView.Designer.cs

    r9730 r10007  
    2525    private void InitializeComponent() {
    2626      this.testConvexHullButton = new System.Windows.Forms.Button();
     27      this.resultsTextBox = new System.Windows.Forms.TextBox();
    2728      this.SuspendLayout();
    2829      //
     
    3132      this.testConvexHullButton.Location = new System.Drawing.Point(3, 3);
    3233      this.testConvexHullButton.Name = "testConvexHullButton";
    33       this.testConvexHullButton.Size = new System.Drawing.Size(97, 23);
     34      this.testConvexHullButton.Size = new System.Drawing.Size(130, 23);
    3435      this.testConvexHullButton.TabIndex = 0;
    35       this.testConvexHullButton.Text = "Test Convex Hull";
     36      this.testConvexHullButton.Text = "Calculate Convex Hull";
    3637      this.testConvexHullButton.UseVisualStyleBackColor = true;
    3738      this.testConvexHullButton.Click += new System.EventHandler(this.testConvexHullButton_Click);
     39      //
     40      // resultsTextBox
     41      //
     42      this.resultsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     43            | System.Windows.Forms.AnchorStyles.Left)
     44            | System.Windows.Forms.AnchorStyles.Right)));
     45      this.resultsTextBox.Location = new System.Drawing.Point(3, 33);
     46      this.resultsTextBox.Multiline = true;
     47      this.resultsTextBox.Name = "resultsTextBox";
     48      this.resultsTextBox.Size = new System.Drawing.Size(638, 254);
     49      this.resultsTextBox.TabIndex = 1;
    3850      //
    3951      // ConvexHullView
     
    4153      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    4254      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     55      this.Controls.Add(this.resultsTextBox);
    4356      this.Controls.Add(this.testConvexHullButton);
    4457      this.Name = "ConvexHullView";
    45       this.Size = new System.Drawing.Size(486, 175);
     58      this.Size = new System.Drawing.Size(641, 290);
    4659      this.ResumeLayout(false);
     60      this.PerformLayout();
    4761
    4862    }
     
    5165
    5266    private System.Windows.Forms.Button testConvexHullButton;
     67    private System.Windows.Forms.TextBox resultsTextBox;
    5368
    5469  }
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3/ConvexHullView.cs

    r9945 r10007  
    2020#endregion
    2121
     22using System;
    2223using System.Linq;
    2324using System.Windows.Forms;
     
    2627using HeuristicLab.MainForm;
    2728using HeuristicLab.MainForm.WindowsForms;
    28 using MIConvexHull;
    2929
    3030namespace HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views {
     
    4848
    4949    private void testConvexHullButton_Click(object sender, System.EventArgs e) {
    50       var sols = Content.GetSolutionsFromGeneration(1);
    51       var input = sols.Select(x => ConvertPermutationToVertex(x.GetPermutation()));
    52       //TODO: HyperHull.Calculate(Content);
    53       //HyperHull.CalculateUsingSMO(Content.GetSolutionsFromGeneration(1));
     50      for (int i = 0; i < 20; i++) {
     51        var sols = Content.GetSolutionsFromGeneration(i);
    5452
    55 
    56       //var result = ConvexHull.Create(input);
    57 
    58       //TODO
     53        var input = sols.Select(x => ConvertPermutationToVertex(x.GetPermutation())).ToArray();
     54        var convexHull = HyperHull.CalculateUsingSMO(input);
     55        resultsTextBox.Text += "Nr. of Points in Generation " + i + ": " + convexHull.Count + Environment.NewLine;
     56        resultsTextBox.Text += "Volume of Convex Hull in Generation " + i + " is: " +
     57                               ConvexHullMeasures.CalculateVolume(convexHull) + Environment.NewLine;
     58      }
    5959    }
    6060
    61     private DefaultVertex ConvertPermutationToVertex(Permutation p) {
    62       DefaultVertex vertex = new DefaultVertex();
    63       vertex.Position = p.Select(x => (double)x).ToArray();
     61    private double[] ConvertPermutationToVertex(Permutation p) {
     62      double[] vertex = p.Select(x => (double)x).ToArray();
    6463      return vertex;
    6564    }
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers-3.3.csproj

    r9945 r10007  
    3838  </PropertyGroup>
    3939  <ItemGroup>
     40    <Reference Include="ALGLIB-3.7.0, Version=3.7.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     41      <SpecificVersion>False</SpecificVersion>
     42      <HintPath>..\..\..\..\trunk\sources\bin\ALGLIB-3.7.0.dll</HintPath>
     43      <Private>False</Private>
     44    </Reference>
    4045    <Reference Include="HeuristicLab.Algorithms.DataAnalysis-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    4146      <SpecificVersion>False</SpecificVersion>
     
    126131    <Compile Include="CombinedOperators\QAPAfterCrossoverCombinedOperator.cs" />
    127132    <Compile Include="HyperHull.cs" />
     133    <Compile Include="ConvexHullMeasures.cs" />
     134    <Compile Include="IntegerExtensions.cs" />
    128135    <Compile Include="SolutionsCaching\AfterCrossoverSolutionCachingAnalyzer.cs" />
    129136    <Compile Include="SolutionsCaching\SolutionCachingAnalyzer.cs" />
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/SolutionsCaching/PermutationInformation.cs

    r9789 r10007  
    7777    public override bool Equals(object obj) {
    7878      PermutationInformation pi = obj as PermutationInformation;
     79      if (pi == null) return false;
    7980
    8081      if (ProducedBy == pi.ProducedBy && Generation == pi.Generation) {
Note: See TracChangeset for help on using the changeset viewer.