Free cookie consent management tool by TermsFeed Policy Generator

Changeset 6789


Ignore:
Timestamp:
09/16/11 16:54:36 (13 years ago)
Author:
svonolfe
Message:

Added visualization of flows to PDP view (#1177)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.4/CVRPPDTWView.cs

    r6715 r6789  
    144144          } else {
    145145            {
    146               Point locationPoint;
     146              Point[] locationPoints = new Point[coordinates.Rows];
    147147              //just draw customers
    148148              for (int i = 1; i < coordinates.Rows; i++) {
    149                 locationPoint = new Point(border + ((int)((coordinates[i, 0] - xMin) * xStep)),
     149                locationPoints[i] = new Point(border + ((int)((coordinates[i, 0] - xMin) * xStep)),
    150150                                bitmap.Height - (border + ((int)((coordinates[i, 1] - yMin) * yStep))));
    151151
    152                 graphics.FillRectangle(Brushes.Black, locationPoint.X - 3, locationPoint.Y - 3, 6, 6);
     152                graphics.FillRectangle(Brushes.Black, locationPoints[i].X - 3, locationPoints[i].Y - 3, 6, 6);
    153153              }
    154154
    155               locationPoint = new Point(border + ((int)((coordinates[0, 0] - xMin) * xStep)),
     155              if (drawFlow) {
     156                for (int i = 1; i < coordinates.Rows; i++) {
     157                  if (demand[i] < 0) {
     158
     159                    graphics.DrawLine(flowPen, locationPoints[pickupDeliveryLocation[i]], locationPoints[i]);
     160                  }
     161                }
     162              }
     163
     164              Point locationPoint = new Point(border + ((int)((coordinates[0, 0] - xMin) * xStep)),
    156165                                bitmap.Height - (border + ((int)((coordinates[0, 1] - yMin) * yStep))));
    157166              graphics.FillEllipse(Brushes.Blue, locationPoint.X - 5, locationPoint.Y - 5, 10, 10);
Note: See TracChangeset for help on using the changeset viewer.