Free cookie consent management tool by TermsFeed Policy Generator

Changeset 6447


Ignore:
Timestamp:
06/20/11 13:31:50 (12 years ago)
Author:
svonolfe
Message:

Replaced tour data table with a text box as a tour visualization to prevent out of memory exceptions for large instances (#1561)

Location:
trunk/sources/HeuristicLab.Problems.VehicleRouting.Views/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.VehicleRouting.Views/3.3/VRPSolutionView.Designer.cs

    r5466 r6447  
    5050      this.valueTabPage = new System.Windows.Forms.TabPage();
    5151      this.tourGroupBox = new System.Windows.Forms.GroupBox();
    52       this.tourGridView = new System.Windows.Forms.DataGridView();
     52      this.valueTextBox = new System.Windows.Forms.TextBox();
    5353      this.tabControl.SuspendLayout();
    5454      this.visualizationTabPage.SuspendLayout();
     
    5656      this.valueTabPage.SuspendLayout();
    5757      this.tourGroupBox.SuspendLayout();
    58       ((System.ComponentModel.ISupportInitialize)(this.tourGridView)).BeginInit();
    5958      this.SuspendLayout();
    6059      //
    6160      // tabControl
    6261      //
     62      this.tabControl.AllowDrop = true;
    6363      this.tabControl.Controls.Add(this.visualizationTabPage);
    6464      this.tabControl.Controls.Add(this.valueTabPage);
     
    8383      // pictureBox
    8484      //
    85       this.pictureBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    86                   | System.Windows.Forms.AnchorStyles.Left)
    87                   | System.Windows.Forms.AnchorStyles.Right)));
     85      this.pictureBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
     86            | System.Windows.Forms.AnchorStyles.Left)
     87            | System.Windows.Forms.AnchorStyles.Right)));
    8888      this.pictureBox.BackColor = System.Drawing.Color.White;
    8989      this.pictureBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
     
    108108      // tourGroupBox
    109109      //
    110       this.tourGroupBox.Controls.Add(this.tourGridView);
     110      this.tourGroupBox.Controls.Add(this.valueTextBox);
    111111      this.tourGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
    112112      this.tourGroupBox.Location = new System.Drawing.Point(3, 3);
     
    117117      this.tourGroupBox.Text = "Tour";
    118118      //
    119       // tourGridView
     119      // valueTextBox
    120120      //
    121       this.tourGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
    122       this.tourGridView.Dock = System.Windows.Forms.DockStyle.Fill;
    123       this.tourGridView.Location = new System.Drawing.Point(3, 16);
    124       this.tourGridView.Name = "tourGridView";
    125       this.tourGridView.ReadOnly = true;
    126       this.tourGridView.Size = new System.Drawing.Size(403, 507);
    127       this.tourGridView.TabIndex = 0;
     121      this.valueTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
     122      this.valueTextBox.Location = new System.Drawing.Point(3, 16);
     123      this.valueTextBox.Multiline = true;
     124      this.valueTextBox.Name = "valueTextBox";
     125      this.valueTextBox.Size = new System.Drawing.Size(403, 507);
     126      this.valueTextBox.TabIndex = 0;
    128127      //
    129128      // VRPSolutionView
     
    139138      this.valueTabPage.ResumeLayout(false);
    140139      this.tourGroupBox.ResumeLayout(false);
    141       ((System.ComponentModel.ISupportInitialize)(this.tourGridView)).EndInit();
     140      this.tourGroupBox.PerformLayout();
    142141      this.ResumeLayout(false);
    143142
     
    151150    private System.Windows.Forms.TabPage valueTabPage;
    152151    private System.Windows.Forms.GroupBox tourGroupBox;
    153     private System.Windows.Forms.DataGridView tourGridView;
     152    private System.Windows.Forms.TextBox valueTextBox;
    154153
    155154
  • trunk/sources/HeuristicLab.Problems.VehicleRouting.Views/3.3/VRPSolutionView.cs

    r5445 r6447  
    2828using HeuristicLab.Parameters;
    2929using HeuristicLab.Problems.VehicleRouting.Encodings;
     30using System.Text;
    3031
    3132namespace HeuristicLab.Problems.VehicleRouting.Views {
     
    8485
    8586    private void UpdateTourView() {
    86       tourGridView.Rows.Clear();
    87       tourGridView.ColumnCount = Content.Coordinates.Rows - 1;
     87      StringBuilder sb = new StringBuilder();
    8888
    8989      if (Content != null && Content.Solution != null) {
    9090        foreach (Tour tour in Content.Solution.GetTours(new ValueLookupParameter<DoubleMatrix>("DistanceMatrix", Content.DistanceMatrix))) {
    91           int row = tourGridView.Rows.Add();
    92           int cell = 0;
    9391          foreach (int city in tour.Cities) {
    94             tourGridView.Rows[row].Cells[cell].Value = city;
    95             cell++;
     92            sb.Append(city);
     93            sb.Append(" ");
    9694          }
     95          sb.AppendLine();
    9796        }
    9897      }
     98
     99      valueTextBox.Text = sb.ToString();
    99100    }
    100101
Note: See TracChangeset for help on using the changeset viewer.