Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4185


Ignore:
Timestamp:
08/10/10 11:32:52 (12 years ago)
Author:
svonolfe
Message:

Improved VRP visualization (#1039)

Location:
trunk/sources
Files:
6 edited

Legend:

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

    r4015 r4185  
    4545    /// </summary>
    4646    private void InitializeComponent() {
    47       this.pictureBox = new System.Windows.Forms.PictureBox();
    4847      this.tabControl = new System.Windows.Forms.TabControl();
    4948      this.visualizationTabPage = new System.Windows.Forms.TabPage();
     49      this.pictureBox = new System.Windows.Forms.PictureBox();
    5050      this.valueTabPage = new System.Windows.Forms.TabPage();
    5151      this.tourGroupBox = new System.Windows.Forms.GroupBox();
    5252      this.tourViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    53       this.splitContainer = new System.Windows.Forms.SplitContainer();
    54       this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
    55       this.travelTimeViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    56       this.label6 = new System.Windows.Forms.Label();
    57       this.tardinessViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    58       this.label5 = new System.Windows.Forms.Label();
    59       this.overloadViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    60       this.label4 = new System.Windows.Forms.Label();
    61       this.vehicleUtilizationViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    62       this.label3 = new System.Windows.Forms.Label();
    63       this.label2 = new System.Windows.Forms.Label();
    64       this.qualityViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    65       this.label1 = new System.Windows.Forms.Label();
    66       this.distanceViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    67       ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit();
    6853      this.tabControl.SuspendLayout();
    6954      this.visualizationTabPage.SuspendLayout();
     55      ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit();
    7056      this.valueTabPage.SuspendLayout();
    7157      this.tourGroupBox.SuspendLayout();
    72       this.splitContainer.Panel1.SuspendLayout();
    73       this.splitContainer.Panel2.SuspendLayout();
    74       this.splitContainer.SuspendLayout();
    75       this.tableLayoutPanel1.SuspendLayout();
    7658      this.SuspendLayout();
     59      //
     60      // tabControl
     61      //
     62      this.tabControl.Controls.Add(this.visualizationTabPage);
     63      this.tabControl.Controls.Add(this.valueTabPage);
     64      this.tabControl.Dock = System.Windows.Forms.DockStyle.Fill;
     65      this.tabControl.Location = new System.Drawing.Point(0, 0);
     66      this.tabControl.Name = "tabControl";
     67      this.tabControl.SelectedIndex = 0;
     68      this.tabControl.Size = new System.Drawing.Size(423, 558);
     69      this.tabControl.TabIndex = 1;
     70      //
     71      // visualizationTabPage
     72      //
     73      this.visualizationTabPage.Controls.Add(this.pictureBox);
     74      this.visualizationTabPage.Location = new System.Drawing.Point(4, 22);
     75      this.visualizationTabPage.Name = "visualizationTabPage";
     76      this.visualizationTabPage.Padding = new System.Windows.Forms.Padding(3);
     77      this.visualizationTabPage.Size = new System.Drawing.Size(415, 532);
     78      this.visualizationTabPage.TabIndex = 0;
     79      this.visualizationTabPage.Text = "Visualization";
     80      this.visualizationTabPage.UseVisualStyleBackColor = true;
    7781      //
    7882      // pictureBox
     
    8589      this.pictureBox.Location = new System.Drawing.Point(6, 6);
    8690      this.pictureBox.Name = "pictureBox";
    87       this.pictureBox.Size = new System.Drawing.Size(403, 386);
     91      this.pictureBox.Size = new System.Drawing.Size(403, 520);
    8892      this.pictureBox.TabIndex = 0;
    8993      this.pictureBox.TabStop = false;
    9094      this.pictureBox.SizeChanged += new System.EventHandler(this.pictureBox_SizeChanged);
    91       //
    92       // tabControl
    93       //
    94       this.tabControl.Controls.Add(this.visualizationTabPage);
    95       this.tabControl.Controls.Add(this.valueTabPage);
    96       this.tabControl.Dock = System.Windows.Forms.DockStyle.Fill;
    97       this.tabControl.Location = new System.Drawing.Point(0, 0);
    98       this.tabControl.Name = "tabControl";
    99       this.tabControl.SelectedIndex = 0;
    100       this.tabControl.Size = new System.Drawing.Size(423, 424);
    101       this.tabControl.TabIndex = 0;
    102       //
    103       // visualizationTabPage
    104       //
    105       this.visualizationTabPage.Controls.Add(this.pictureBox);
    106       this.visualizationTabPage.Location = new System.Drawing.Point(4, 22);
    107       this.visualizationTabPage.Name = "visualizationTabPage";
    108       this.visualizationTabPage.Padding = new System.Windows.Forms.Padding(3);
    109       this.visualizationTabPage.Size = new System.Drawing.Size(415, 398);
    110       this.visualizationTabPage.TabIndex = 0;
    111       this.visualizationTabPage.Text = "Visualization";
    112       this.visualizationTabPage.UseVisualStyleBackColor = true;
    11395      //
    11496      // valueTabPage
     
    148130      this.tourViewHost.ViewType = null;
    149131      //
    150       // splitContainer
    151       //
    152       this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
    153       this.splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
    154       this.splitContainer.IsSplitterFixed = true;
    155       this.splitContainer.Location = new System.Drawing.Point(0, 0);
    156       this.splitContainer.Name = "splitContainer";
    157       this.splitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal;
    158       //
    159       // splitContainer.Panel1
    160       //
    161       this.splitContainer.Panel1.Controls.Add(this.tableLayoutPanel1);
    162       //
    163       // splitContainer.Panel2
    164       //
    165       this.splitContainer.Panel2.Controls.Add(this.tabControl);
    166       this.splitContainer.Size = new System.Drawing.Size(423, 558);
    167       this.splitContainer.SplitterDistance = 130;
    168       this.splitContainer.TabIndex = 0;
    169       //
    170       // tableLayoutPanel1
    171       //
    172       this.tableLayoutPanel1.ColumnCount = 2;
    173       this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 23.64066F));
    174       this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 76.35934F));
    175       this.tableLayoutPanel1.Controls.Add(this.travelTimeViewHost, 1, 5);
    176       this.tableLayoutPanel1.Controls.Add(this.label6, 0, 5);
    177       this.tableLayoutPanel1.Controls.Add(this.tardinessViewHost, 1, 4);
    178       this.tableLayoutPanel1.Controls.Add(this.label5, 0, 4);
    179       this.tableLayoutPanel1.Controls.Add(this.overloadViewHost, 1, 3);
    180       this.tableLayoutPanel1.Controls.Add(this.label4, 0, 3);
    181       this.tableLayoutPanel1.Controls.Add(this.vehicleUtilizationViewHost, 1, 2);
    182       this.tableLayoutPanel1.Controls.Add(this.label3, 0, 2);
    183       this.tableLayoutPanel1.Controls.Add(this.label2, 0, 1);
    184       this.tableLayoutPanel1.Controls.Add(this.qualityViewHost, 1, 0);
    185       this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0);
    186       this.tableLayoutPanel1.Controls.Add(this.distanceViewHost, 1, 1);
    187       this.tableLayoutPanel1.GrowStyle = System.Windows.Forms.TableLayoutPanelGrowStyle.FixedSize;
    188       this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
    189       this.tableLayoutPanel1.Name = "tableLayoutPanel1";
    190       this.tableLayoutPanel1.RowCount = 6;
    191       this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
    192       this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
    193       this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
    194       this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
    195       this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
    196       this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
    197       this.tableLayoutPanel1.Size = new System.Drawing.Size(423, 121);
    198       this.tableLayoutPanel1.TabIndex = 2;
    199       //
    200       // travelTimeViewHost
    201       //
    202       this.travelTimeViewHost.Caption = "View";
    203       this.travelTimeViewHost.Content = null;
    204       this.travelTimeViewHost.Dock = System.Windows.Forms.DockStyle.Left;
    205       this.travelTimeViewHost.Location = new System.Drawing.Point(102, 103);
    206       this.travelTimeViewHost.Name = "travelTimeViewHost";
    207       this.travelTimeViewHost.ReadOnly = false;
    208       this.travelTimeViewHost.Size = new System.Drawing.Size(281, 15);
    209       this.travelTimeViewHost.TabIndex = 17;
    210       this.travelTimeViewHost.ViewType = null;
    211       //
    212       // label6
    213       //
    214       this.label6.AutoSize = true;
    215       this.label6.Dock = System.Windows.Forms.DockStyle.Fill;
    216       this.label6.Location = new System.Drawing.Point(3, 100);
    217       this.label6.Name = "label6";
    218       this.label6.Size = new System.Drawing.Size(93, 21);
    219       this.label6.TabIndex = 16;
    220       this.label6.Text = "Travel Time";
    221       this.label6.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
    222       //
    223       // tardinessViewHost
    224       //
    225       this.tardinessViewHost.Caption = "View";
    226       this.tardinessViewHost.Content = null;
    227       this.tardinessViewHost.Dock = System.Windows.Forms.DockStyle.Left;
    228       this.tardinessViewHost.Location = new System.Drawing.Point(102, 83);
    229       this.tardinessViewHost.Name = "tardinessViewHost";
    230       this.tardinessViewHost.ReadOnly = false;
    231       this.tardinessViewHost.Size = new System.Drawing.Size(281, 14);
    232       this.tardinessViewHost.TabIndex = 15;
    233       this.tardinessViewHost.ViewType = null;
    234       //
    235       // label5
    236       //
    237       this.label5.AutoSize = true;
    238       this.label5.Dock = System.Windows.Forms.DockStyle.Fill;
    239       this.label5.Location = new System.Drawing.Point(3, 80);
    240       this.label5.Name = "label5";
    241       this.label5.Size = new System.Drawing.Size(93, 20);
    242       this.label5.TabIndex = 14;
    243       this.label5.Text = "Tardiness";
    244       this.label5.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
    245       //
    246       // overloadViewHost
    247       //
    248       this.overloadViewHost.BackColor = System.Drawing.Color.Transparent;
    249       this.overloadViewHost.Caption = "View";
    250       this.overloadViewHost.Content = null;
    251       this.overloadViewHost.Dock = System.Windows.Forms.DockStyle.Left;
    252       this.overloadViewHost.Location = new System.Drawing.Point(102, 63);
    253       this.overloadViewHost.Name = "overloadViewHost";
    254       this.overloadViewHost.ReadOnly = false;
    255       this.overloadViewHost.Size = new System.Drawing.Size(281, 14);
    256       this.overloadViewHost.TabIndex = 13;
    257       this.overloadViewHost.ViewType = null;
    258       //
    259       // label4
    260       //
    261       this.label4.AutoSize = true;
    262       this.label4.Dock = System.Windows.Forms.DockStyle.Fill;
    263       this.label4.Location = new System.Drawing.Point(3, 60);
    264       this.label4.Name = "label4";
    265       this.label4.Size = new System.Drawing.Size(93, 20);
    266       this.label4.TabIndex = 12;
    267       this.label4.Text = "Overload";
    268       this.label4.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
    269       //
    270       // vehicleUtilizationViewHost
    271       //
    272       this.vehicleUtilizationViewHost.Caption = "View";
    273       this.vehicleUtilizationViewHost.Content = null;
    274       this.vehicleUtilizationViewHost.Dock = System.Windows.Forms.DockStyle.Left;
    275       this.vehicleUtilizationViewHost.Location = new System.Drawing.Point(102, 43);
    276       this.vehicleUtilizationViewHost.Name = "vehicleUtilizationViewHost";
    277       this.vehicleUtilizationViewHost.ReadOnly = false;
    278       this.vehicleUtilizationViewHost.Size = new System.Drawing.Size(281, 14);
    279       this.vehicleUtilizationViewHost.TabIndex = 11;
    280       this.vehicleUtilizationViewHost.ViewType = null;
    281       //
    282       // label3
    283       //
    284       this.label3.AutoSize = true;
    285       this.label3.Dock = System.Windows.Forms.DockStyle.Fill;
    286       this.label3.Location = new System.Drawing.Point(3, 40);
    287       this.label3.Name = "label3";
    288       this.label3.Size = new System.Drawing.Size(93, 20);
    289       this.label3.TabIndex = 10;
    290       this.label3.Text = "Vehicle utilization";
    291       this.label3.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
    292       //
    293       // label2
    294       //
    295       this.label2.AutoSize = true;
    296       this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
    297       this.label2.Location = new System.Drawing.Point(3, 20);
    298       this.label2.Name = "label2";
    299       this.label2.Size = new System.Drawing.Size(93, 20);
    300       this.label2.TabIndex = 9;
    301       this.label2.Text = "Distance";
    302       this.label2.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
    303       //
    304       // qualityViewHost
    305       //
    306       this.qualityViewHost.BackColor = System.Drawing.Color.Transparent;
    307       this.qualityViewHost.Caption = "View";
    308       this.qualityViewHost.Content = null;
    309       this.qualityViewHost.Dock = System.Windows.Forms.DockStyle.Left;
    310       this.qualityViewHost.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
    311       this.qualityViewHost.Location = new System.Drawing.Point(102, 3);
    312       this.qualityViewHost.Name = "qualityViewHost";
    313       this.qualityViewHost.ReadOnly = false;
    314       this.qualityViewHost.Size = new System.Drawing.Size(281, 14);
    315       this.qualityViewHost.TabIndex = 8;
    316       this.qualityViewHost.ViewType = null;
    317       //
    318       // label1
    319       //
    320       this.label1.AutoSize = true;
    321       this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
    322       this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
    323       this.label1.Location = new System.Drawing.Point(3, 0);
    324       this.label1.Name = "label1";
    325       this.label1.Size = new System.Drawing.Size(93, 20);
    326       this.label1.TabIndex = 0;
    327       this.label1.Text = "Quality";
    328       this.label1.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
    329       //
    330       // distanceViewHost
    331       //
    332       this.distanceViewHost.BackColor = System.Drawing.Color.Transparent;
    333       this.distanceViewHost.Caption = "View";
    334       this.distanceViewHost.Content = null;
    335       this.distanceViewHost.Dock = System.Windows.Forms.DockStyle.Left;
    336       this.distanceViewHost.Location = new System.Drawing.Point(102, 23);
    337       this.distanceViewHost.Name = "distanceViewHost";
    338       this.distanceViewHost.ReadOnly = false;
    339       this.distanceViewHost.Size = new System.Drawing.Size(281, 14);
    340       this.distanceViewHost.TabIndex = 7;
    341       this.distanceViewHost.ViewType = null;
    342       //
    343132      // VRPSolutionView
    344133      //
    345134      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    346135      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    347       this.Controls.Add(this.splitContainer);
     136      this.Controls.Add(this.tabControl);
    348137      this.Name = "VRPSolutionView";
    349138      this.Size = new System.Drawing.Size(423, 558);
    350       ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit();
    351139      this.tabControl.ResumeLayout(false);
    352140      this.visualizationTabPage.ResumeLayout(false);
     141      ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit();
    353142      this.valueTabPage.ResumeLayout(false);
    354143      this.tourGroupBox.ResumeLayout(false);
    355       this.splitContainer.Panel1.ResumeLayout(false);
    356       this.splitContainer.Panel2.ResumeLayout(false);
    357       this.splitContainer.ResumeLayout(false);
    358       this.tableLayoutPanel1.ResumeLayout(false);
    359       this.tableLayoutPanel1.PerformLayout();
    360144      this.ResumeLayout(false);
    361145
     
    364148    #endregion
    365149
    366     private System.Windows.Forms.PictureBox pictureBox;
    367150    private System.Windows.Forms.TabControl tabControl;
    368151    private System.Windows.Forms.TabPage visualizationTabPage;
     152    private System.Windows.Forms.PictureBox pictureBox;
    369153    private System.Windows.Forms.TabPage valueTabPage;
    370154    private System.Windows.Forms.GroupBox tourGroupBox;
    371     private HeuristicLab.MainForm.WindowsForms.ViewHost tourViewHost;
    372     private System.Windows.Forms.SplitContainer splitContainer;
    373     private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
    374     private System.Windows.Forms.Label label1;
    375     private HeuristicLab.MainForm.WindowsForms.ViewHost travelTimeViewHost;
    376     private System.Windows.Forms.Label label6;
    377     private HeuristicLab.MainForm.WindowsForms.ViewHost tardinessViewHost;
    378     private System.Windows.Forms.Label label5;
    379     private HeuristicLab.MainForm.WindowsForms.ViewHost overloadViewHost;
    380     private System.Windows.Forms.Label label4;
    381     private HeuristicLab.MainForm.WindowsForms.ViewHost vehicleUtilizationViewHost;
    382     private System.Windows.Forms.Label label3;
    383     private System.Windows.Forms.Label label2;
    384     private HeuristicLab.MainForm.WindowsForms.ViewHost qualityViewHost;
    385     private HeuristicLab.MainForm.WindowsForms.ViewHost distanceViewHost;
     155    private MainForm.WindowsForms.ViewHost tourViewHost;
     156
    386157
    387158
  • trunk/sources/HeuristicLab.Problems.VehicleRouting.Views/3.3/VRPSolutionView.cs

    r4174 r4185  
    4545    public VRPSolutionView() {
    4646      InitializeComponent();
     47
     48      ToolTip tt = new ToolTip();
     49      tt.SetToolTip(pictureBox, "Legend: Blue = Depot, Black = City (OK), Orange = City (too early), Red = City (too late)");
    4750    }
    4851
    4952    protected override void DeregisterContentEvents() {
    50       Content.QualityChanged -= new EventHandler(Content_QualityChanged);
    51       Content.DistanceChanged -= new EventHandler(Content_DistanceChanged);
    52       Content.OverloadChanged -= new EventHandler(Content_OverloadChanged);
    53       Content.TardinessChanged -= new EventHandler(Content_TardinessChanged);
    54       Content.TravelTimeChanged -= new EventHandler(Content_TravelTimeChanged);
    55       Content.VehicleUtilizationChanged -= new EventHandler(Content_VehicleUtilizationChanged);
    5653      Content.CoordinatesChanged -= new EventHandler(Content_CoordinatesChanged);
    5754      Content.SolutionChanged -= new EventHandler(Content_SolutionChanged);
     
    6057    protected override void RegisterContentEvents() {
    6158      base.RegisterContentEvents();
    62       Content.QualityChanged += new EventHandler(Content_QualityChanged);
    63       Content.DistanceChanged += new EventHandler(Content_DistanceChanged);
    64       Content.OverloadChanged += new EventHandler(Content_OverloadChanged);
    65       Content.TardinessChanged += new EventHandler(Content_TardinessChanged);
    66       Content.TravelTimeChanged += new EventHandler(Content_TravelTimeChanged);
    67       Content.VehicleUtilizationChanged += new EventHandler(Content_VehicleUtilizationChanged);
    6859      Content.CoordinatesChanged += new EventHandler(Content_CoordinatesChanged);
    6960      Content.SolutionChanged += new EventHandler(Content_SolutionChanged);
     
    7566        pictureBox.Image = null;
    7667      } else {
    77         qualityViewHost.Content = Content.Quality;
    78         distanceViewHost.Content = Content.Distance;
    79         overloadViewHost.Content = Content.Overload;
    80         tardinessViewHost.Content = Content.Tardiness;
    81         travelTimeViewHost.Content = Content.TravelTime;
    82         vehicleUtilizationViewHost.Content = Content.VehicleUtilization;
    83 
    8468        GenerateImage();
    8569        tourViewHost.Content = Content.Solution;
     
    9478    protected override void SetEnabledStateOfControls() {
    9579      base.SetEnabledStateOfControls();
    96       tableLayoutPanel1.Enabled = Content != null;
    9780      pictureBox.Enabled = Content != null;
    9881      tourGroupBox.Enabled = Content != null;
     
    139122                  double t = 0.0;
    140123                  Point[] tourPoints = new Point[tour.Cities.Count + 2];
     124                  Brush[] customerBrushes = new Brush[tour.Cities.Count];
    141125                  int lastCustomer = 0;
    142126
     
    161145                      if (t < readyTime[location]) {
    162146                        t = readyTime[location];
    163                         customerBrush = Brushes.Yellow;
     147                        customerBrush = Brushes.Orange;
    164148                      } else if (t > dueTime[location]) {
    165149                        customerBrush = Brushes.Red;
     
    167151
    168152                      t += serviceTime[location];
    169 
    170                       graphics.FillRectangle(customerBrush, locationPoint.X - 2, locationPoint.Y - 2, 6, 6);
     153                      customerBrushes[i] = customerBrush;
    171154                    }
    172155                    lastCustomer = location;
     
    174157
    175158                  graphics.DrawPolygon(pens[((currentTour >= pens.Length) ? (pens.Length - 1) : (currentTour))], tourPoints);
     159
     160                  for (int i = 0; i < tour.Cities.Count; i++) {
     161                    graphics.FillRectangle(customerBrushes[i], tourPoints[i + 1].X - 3, tourPoints[i + 1].Y - 3, 6, 6);
     162                  }
     163
     164                  graphics.FillEllipse(Brushes.Blue, tourPoints[0].X - 5, tourPoints[0].Y - 5, 10, 10);
     165
    176166                  currentTour++;
    177167                }
     168              } else {
     169                Point locationPoint;
     170                //just draw customers
     171                for (int i = 1; i < coordinates.Rows; i++) {
     172                  locationPoint = new Point(border + ((int)((coordinates[i, 0] - xMin) * xStep)),
     173                                  bitmap.Height - (border + ((int)((coordinates[i, 1] - yMin) * yStep))));
     174
     175                  graphics.FillRectangle(Brushes.Black, locationPoint.X - 3, locationPoint.Y - 3, 6, 6);
     176                }
     177
     178                locationPoint = new Point(border + ((int)((coordinates[0, 0] - xMin) * xStep)),
     179                                  bitmap.Height - (border + ((int)((coordinates[0, 1] - yMin) * yStep))));
     180                graphics.FillEllipse(Brushes.Blue, locationPoint.X - 5, locationPoint.Y - 5, 10, 10);
    178181              }
    179182            }
     
    188191    }
    189192
    190     private void Content_QualityChanged(object sender, EventArgs e) {
    191       if (InvokeRequired)
    192         Invoke(new EventHandler(Content_QualityChanged), sender, e);
    193       else
    194         qualityViewHost.Content = Content.Quality;
    195     }
    196     void Content_DistanceChanged(object sender, EventArgs e) {
    197       if (InvokeRequired)
    198         Invoke(new EventHandler(Content_DistanceChanged), sender, e);
    199       else
    200         distanceViewHost.Content = Content.Distance;
    201     }
    202193    private void Content_CoordinatesChanged(object sender, EventArgs e) {
    203194      if (InvokeRequired)
     
    205196      else
    206197        GenerateImage();
    207     }
    208     void Content_OverloadChanged(object sender, EventArgs e) {
    209       if (InvokeRequired)
    210         Invoke(new EventHandler(Content_OverloadChanged), sender, e);
    211       else
    212         overloadViewHost.Content = Content.Overload;
    213     }
    214     void Content_TardinessChanged(object sender, EventArgs e) {
    215       if (InvokeRequired)
    216         Invoke(new EventHandler(Content_TardinessChanged), sender, e);
    217       else
    218         tardinessViewHost.Content = Content.Tardiness;
    219     }
    220     void Content_TravelTimeChanged(object sender, EventArgs e) {
    221       if (InvokeRequired)
    222         Invoke(new EventHandler(Content_TravelTimeChanged), sender, e);
    223       else
    224         travelTimeViewHost.Content = Content.TravelTime;
    225     }
    226     void Content_VehicleUtilizationChanged(object sender, EventArgs e) {
    227       if (InvokeRequired)
    228         Invoke(new EventHandler(Content_VehicleUtilizationChanged), sender, e);
    229       else
    230         vehicleUtilizationViewHost.Content = Content.VehicleUtilization;
    231198    }
    232199    private void Content_SolutionChanged(object sender, EventArgs e) {
  • trunk/sources/HeuristicLab.Problems.VehicleRouting.Views/3.3/VehicleRoutingProblemView.Designer.cs

    r3938 r4185  
    2525    private void InitializeComponent() {
    2626      this.importButton = new System.Windows.Forms.Button();
     27      this.tabControl1 = new System.Windows.Forms.TabControl();
     28      this.tabPage1 = new System.Windows.Forms.TabPage();
     29      this.parameterCollectionView = new HeuristicLab.Core.Views.ParameterCollectionView();
     30      this.tabPage2 = new System.Windows.Forms.TabPage();
     31      this.vrpSolutionView = new HeuristicLab.Problems.VehicleRouting.Views.VRPSolutionView();
    2732      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
     33      this.tabControl1.SuspendLayout();
     34      this.tabPage1.SuspendLayout();
     35      this.tabPage2.SuspendLayout();
    2836      this.SuspendLayout();
    29       //
    30       // parameterCollectionView
    31       //
    32       this.parameterCollectionView.Location = new System.Drawing.Point(0, 88);
    33       this.parameterCollectionView.Size = new System.Drawing.Size(490, 334);
    3437      //
    3538      // nameTextBox
     
    5053      this.importButton.Click += new System.EventHandler(this.importButton_Click);
    5154      //
     55      // tabControl1
     56      //
     57      this.tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     58                  | System.Windows.Forms.AnchorStyles.Left)
     59                  | System.Windows.Forms.AnchorStyles.Right)));
     60      this.tabControl1.Controls.Add(this.tabPage1);
     61      this.tabControl1.Controls.Add(this.tabPage2);
     62      this.tabControl1.Location = new System.Drawing.Point(0, 84);
     63      this.tabControl1.Name = "tabControl1";
     64      this.tabControl1.SelectedIndex = 0;
     65      this.tabControl1.Size = new System.Drawing.Size(490, 338);
     66      this.tabControl1.TabIndex = 6;
     67      //
     68      // tabPage1
     69      //
     70      this.tabPage1.Controls.Add(this.parameterCollectionView);
     71      this.tabPage1.Location = new System.Drawing.Point(4, 22);
     72      this.tabPage1.Name = "tabPage1";
     73      this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
     74      this.tabPage1.Size = new System.Drawing.Size(482, 312);
     75      this.tabPage1.TabIndex = 0;
     76      this.tabPage1.Text = "Parameters";
     77      this.tabPage1.UseVisualStyleBackColor = true;
     78      //
     79      // parameterCollectionView
     80      //
     81      this.parameterCollectionView.Caption = "ParameterCollection View";
     82      this.parameterCollectionView.Content = null;
     83      this.parameterCollectionView.Dock = System.Windows.Forms.DockStyle.Fill;
     84      this.parameterCollectionView.Location = new System.Drawing.Point(3, 3);
     85      this.parameterCollectionView.Name = "parameterCollectionView";
     86      this.parameterCollectionView.ReadOnly = false;
     87      this.parameterCollectionView.Size = new System.Drawing.Size(476, 306);
     88      this.parameterCollectionView.TabIndex = 1;
     89      //
     90      // tabPage2
     91      //
     92      this.tabPage2.Controls.Add(this.vrpSolutionView);
     93      this.tabPage2.Location = new System.Drawing.Point(4, 22);
     94      this.tabPage2.Name = "tabPage2";
     95      this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
     96      this.tabPage2.Size = new System.Drawing.Size(482, 312);
     97      this.tabPage2.TabIndex = 1;
     98      this.tabPage2.Text = "Visualization";
     99      this.tabPage2.UseVisualStyleBackColor = true;
     100      //
     101      // vrpSolutionView
     102      //
     103      this.vrpSolutionView.Caption = "VRPSolution View";
     104      this.vrpSolutionView.Content = null;
     105      this.vrpSolutionView.Dock = System.Windows.Forms.DockStyle.Fill;
     106      this.vrpSolutionView.Location = new System.Drawing.Point(3, 3);
     107      this.vrpSolutionView.Name = "vrpSolutionView";
     108      this.vrpSolutionView.ReadOnly = false;
     109      this.vrpSolutionView.Size = new System.Drawing.Size(476, 306);
     110      this.vrpSolutionView.TabIndex = 0;
     111      //
    52112      // VehicleRoutingProblemView
    53113      //
    54114      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    55115      this.Controls.Add(this.importButton);
     116      this.Controls.Add(this.tabControl1);
    56117      this.Name = "VehicleRoutingProblemView";
    57118      this.Size = new System.Drawing.Size(490, 422);
     119      this.Controls.SetChildIndex(this.tabControl1, 0);
    58120      this.Controls.SetChildIndex(this.importButton, 0);
    59121      this.Controls.SetChildIndex(this.nameTextBox, 0);
     
    61123      this.Controls.SetChildIndex(this.descriptionLabel, 0);
    62124      this.Controls.SetChildIndex(this.descriptionTextBox, 0);
    63       this.Controls.SetChildIndex(this.parameterCollectionView, 0);
    64125      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
     126      this.tabControl1.ResumeLayout(false);
     127      this.tabPage1.ResumeLayout(false);
     128      this.tabPage2.ResumeLayout(false);
    65129      this.ResumeLayout(false);
    66130      this.PerformLayout();
     
    71135
    72136    private System.Windows.Forms.Button importButton;
     137    private System.Windows.Forms.TabControl tabControl1;
     138    private System.Windows.Forms.TabPage tabPage1;
     139    private System.Windows.Forms.TabPage tabPage2;
     140    private Core.Views.ParameterCollectionView parameterCollectionView;
     141    private VRPSolutionView vrpSolutionView;
    73142  }
    74143}
  • trunk/sources/HeuristicLab.Problems.VehicleRouting.Views/3.3/VehicleRoutingProblemView.cs

    r4068 r4185  
    2424using HeuristicLab.MainForm;
    2525using HeuristicLab.Optimization.Views;
     26using HeuristicLab.Core.Views;
     27using HeuristicLab.Core;
    2628
    2729namespace HeuristicLab.Problems.VehicleRouting.Views {
    2830  [View("VehicleRouting Problem View")]
    2931  [Content(typeof(VehicleRoutingProblem), true)]
    30   public partial class VehicleRoutingProblemView : ProblemView {
     32  public partial class VehicleRoutingProblemView : NamedItemView {
    3133    public new VehicleRoutingProblem Content {
    3234      get { return (VehicleRoutingProblem)base.Content; }
     
    3638    public VehicleRoutingProblemView() {
    3739      InitializeComponent();
     40    }
     41
     42    protected override void DeregisterContentEvents() {
     43      Content.CoordinatesParameter.ValueChanged -= new EventHandler(CoordinatesParameter_ValueChanged);
     44      base.DeregisterContentEvents();
     45    }
     46    protected override void RegisterContentEvents() {
     47      base.RegisterContentEvents();
     48      Content.CoordinatesParameter.ValueChanged += new EventHandler(CoordinatesParameter_ValueChanged);
     49    }
     50
     51    protected override void OnContentChanged() {
     52      base.OnContentChanged();
     53      if (Content == null) {
     54        parameterCollectionView.Content = null;
     55        vrpSolutionView.Content = null;
     56      } else {
     57        parameterCollectionView.Content = ((IParameterizedNamedItem)Content).Parameters;
     58        vrpSolutionView.Content = new VRPSolution(Content.Coordinates);
     59      }
     60    }
     61
     62    protected override void SetEnabledStateOfControls() {
     63      base.SetEnabledStateOfControls();
     64      parameterCollectionView.Enabled = Content != null;
     65      vrpSolutionView.Enabled = Content != null;
     66      importButton.Enabled = Content != null && !ReadOnly;
    3867    }
    3968
     
    4675      }
    4776    }
     77
     78    private void CoordinatesParameter_ValueChanged(object sender, EventArgs e) {
     79      vrpSolutionView.Content.Coordinates = Content.Coordinates;
     80    }
    4881  }
    4982}
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Analyzers/BestVRPSolutionAnalyzer.cs

    r4184 r4185  
    127127        BestSolutionParameter.ActualValue = solution;
    128128        results.Add(new Result("Best VRP Solution", solution));
    129        
     129
     130        results.Add(new Result("Best TravelTime", new DoubleValue(travelTimes[i].Value)));
    130131        results.Add(new Result("Best Distance",  new DoubleValue(distances[i].Value)));
     132        results.Add(new Result("Best VehicleUtilization", new DoubleValue(vehiclesUtilizations[i].Value)));
    131133        results.Add(new Result("Best Overload",  new DoubleValue(overloads[i].Value)));
    132134        results.Add(new Result("Best Tardiness",  new DoubleValue(tardinesses[i].Value)));
    133         results.Add(new Result("Best TravelTime",  new DoubleValue(travelTimes[i].Value)));
    134         results.Add(new Result("Best VehicleUtilization",  new DoubleValue(vehiclesUtilizations[i].Value)));
    135135      } else {
    136136        if (solution.Quality.Value > qualities[i].Value) {
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/VRPSolution.cs

    r4015 r4185  
    195195    public VRPSolution() : base() { }
    196196
     197    public VRPSolution(DoubleMatrix coordinates): base() {
     198      this.coordinates = coordinates;
     199    }
     200
    197201    public VRPSolution(DoubleMatrix coordinates, IVRPEncoding solution, DoubleValue quality,
    198202      DoubleValue distance, DoubleValue overload, DoubleValue tardiness, DoubleValue travelTime,
Note: See TracChangeset for help on using the changeset viewer.