Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/05/16 16:06:18 (7 years ago)
Author:
abeham
Message:

#2701:

  • Worked on MemPR algorithm for permutations
  • Refactored TSP
Location:
branches/MemPRAlgorithm/HeuristicLab.Problems.TravelingSalesman.Views/3.3
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/MemPRAlgorithm/HeuristicLab.Problems.TravelingSalesman.Views/3.3/HeuristicLab.Problems.TravelingSalesman.Views-3.3.csproj

    r11623 r14454  
    230230    </ProjectReference>
    231231  </ItemGroup>
     232  <ItemGroup>
     233    <EmbeddedResource Include="TravelingSalesmanProblemView.resx">
     234      <DependentUpon>TravelingSalesmanProblemView.cs</DependentUpon>
     235    </EmbeddedResource>
     236  </ItemGroup>
    232237  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    233238  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
  • branches/MemPRAlgorithm/HeuristicLab.Problems.TravelingSalesman.Views/3.3/TravelingSalesmanProblemView.Designer.cs

    r14185 r14454  
    4545      this.visualizationTabPage = new System.Windows.Forms.TabPage();
    4646      this.pathTSPTourView = new HeuristicLab.Problems.TravelingSalesman.Views.PathTSPTourView();
     47      this.updateDistanceMatrixButton = new System.Windows.Forms.Button();
    4748      ((System.ComponentModel.ISupportInitialize)(this.problemInstanceSplitContainer)).BeginInit();
    4849      this.problemInstanceSplitContainer.Panel1.SuspendLayout();
     
    6061      // problemInstanceSplitContainer.Panel2
    6162      //
     63      this.problemInstanceSplitContainer.Panel2.Controls.Add(this.updateDistanceMatrixButton);
    6264      this.problemInstanceSplitContainer.Panel2.Controls.Add(this.tabControl);
    6365      //
     
    6769      this.parameterCollectionView.Dock = System.Windows.Forms.DockStyle.Fill;
    6870      this.parameterCollectionView.Location = new System.Drawing.Point(3, 3);
    69       this.parameterCollectionView.Size = new System.Drawing.Size(497, 274);
     71      this.parameterCollectionView.Size = new System.Drawing.Size(497, 245);
    7072      //
    7173      // nameTextBox
     
    7779      //
    7880      this.tabControl.AllowDrop = true;
    79       this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    80                   | System.Windows.Forms.AnchorStyles.Left)
    81                   | System.Windows.Forms.AnchorStyles.Right)));
     81      this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
     82            | System.Windows.Forms.AnchorStyles.Left)
     83            | System.Windows.Forms.AnchorStyles.Right)));
    8284      this.tabControl.Controls.Add(this.parametersTabPage);
    8385      this.tabControl.Controls.Add(this.visualizationTabPage);
    84       this.tabControl.Location = new System.Drawing.Point(0, 27);
     86      this.tabControl.Location = new System.Drawing.Point(0, 56);
    8587      this.tabControl.Name = "tabControl";
    8688      this.tabControl.SelectedIndex = 0;
    87       this.tabControl.Size = new System.Drawing.Size(511, 306);
     89      this.tabControl.Size = new System.Drawing.Size(511, 277);
    8890      this.tabControl.TabIndex = 4;
    8991      //
     
    9496      this.parametersTabPage.Name = "parametersTabPage";
    9597      this.parametersTabPage.Padding = new System.Windows.Forms.Padding(3);
    96       this.parametersTabPage.Size = new System.Drawing.Size(503, 280);
     98      this.parametersTabPage.Size = new System.Drawing.Size(503, 251);
    9799      this.parametersTabPage.TabIndex = 0;
    98100      this.parametersTabPage.Text = "Parameters";
     
    112114      // pathTSPTourView
    113115      //
    114       this.pathTSPTourView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    115                   | System.Windows.Forms.AnchorStyles.Left)
    116                   | System.Windows.Forms.AnchorStyles.Right)));
     116      this.pathTSPTourView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
     117            | System.Windows.Forms.AnchorStyles.Left)
     118            | System.Windows.Forms.AnchorStyles.Right)));
    117119      this.pathTSPTourView.Caption = "PathTSPTour View";
    118120      this.pathTSPTourView.Content = null;
     
    123125      this.pathTSPTourView.TabIndex = 0;
    124126      //
     127      // updateDistanceMatrixButton
     128      //
     129      this.updateDistanceMatrixButton.Location = new System.Drawing.Point(3, 27);
     130      this.updateDistanceMatrixButton.Name = "updateDistanceMatrixButton";
     131      this.updateDistanceMatrixButton.Size = new System.Drawing.Size(133, 23);
     132      this.updateDistanceMatrixButton.TabIndex = 5;
     133      this.updateDistanceMatrixButton.Text = "Update Distance Matrix";
     134      this.updateDistanceMatrixButton.UseVisualStyleBackColor = true;
     135      this.updateDistanceMatrixButton.Click += new System.EventHandler(this.updateDistanceMatrixButton_Click);
     136      //
    125137      // TravelingSalesmanProblemView
    126138      //
    127       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    128139      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    129140      this.Name = "TravelingSalesmanProblemView";
     
    148159    private System.Windows.Forms.TabPage visualizationTabPage;
    149160    private PathTSPTourView pathTSPTourView;
     161    private System.Windows.Forms.Button updateDistanceMatrixButton;
    150162  }
    151163}
  • branches/MemPRAlgorithm/HeuristicLab.Problems.TravelingSalesman.Views/3.3/TravelingSalesmanProblemView.cs

    r14185 r14454  
    2222using System;
    2323using System.Windows.Forms;
     24using HeuristicLab.Data;
    2425using HeuristicLab.MainForm;
    2526using HeuristicLab.Optimization.Views;
     
    4647    protected override void DeregisterContentEvents() {
    4748      Content.CoordinatesParameter.ValueChanged -= new EventHandler(CoordinatesParameter_ValueChanged);
    48       Content.BestKnownQualityParameter.ValueChanged -= new EventHandler(BestKnownQualityParameter_ValueChanged);
     49      //Content.BestKnownQualityParameter.ValueChanged -= new EventHandler(BestKnownQualityParameter_ValueChanged);
    4950      Content.BestKnownSolutionParameter.ValueChanged -= new EventHandler(BestKnownSolutionParameter_ValueChanged);
    5051      base.DeregisterContentEvents();
     
    5354      base.RegisterContentEvents();
    5455      Content.CoordinatesParameter.ValueChanged += new EventHandler(CoordinatesParameter_ValueChanged);
    55       Content.BestKnownQualityParameter.ValueChanged += new EventHandler(BestKnownQualityParameter_ValueChanged);
     56      //Content.BestKnownQualityParameter.ValueChanged += new EventHandler(BestKnownQualityParameter_ValueChanged);
    5657      Content.BestKnownSolutionParameter.ValueChanged += new EventHandler(BestKnownSolutionParameter_ValueChanged);
    5758    }
     
    6263        pathTSPTourView.Content = null;
    6364      } else {
    64         pathTSPTourView.Content = new PathTSPTour(Content.Coordinates, Content.BestKnownSolution, Content.BestKnownQuality);
     65        pathTSPTourView.Content = new PathTSPTour(Content.Coordinates, Content.BestKnownSolution, new DoubleValue(Content.BestKnownQuality));
    6566      }
    6667    }
     
    6970      base.SetEnabledStateOfControls();
    7071      pathTSPTourView.Enabled = Content != null;
     72      updateDistanceMatrixButton.Enabled = Content != null && !ReadOnly && !Locked;
    7173    }
    7274
     
    7577    }
    7678    private void BestKnownQualityParameter_ValueChanged(object sender, EventArgs e) {
    77       pathTSPTourView.Content.Quality = Content.BestKnownQuality;
     79      pathTSPTourView.Content.Quality = new DoubleValue(Content.BestKnownQuality);
    7880    }
    7981    private void BestKnownSolutionParameter_ValueChanged(object sender, EventArgs e) {
    8082      pathTSPTourView.Content.Permutation = Content.BestKnownSolution;
    8183    }
     84
     85    private void updateDistanceMatrixButton_Click(object sender, EventArgs e) {
     86      Content.UpdateDistanceMatrix();
     87    }
    8288  }
    8389}
Note: See TracChangeset for help on using the changeset viewer.