Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/01/10 11:13:46 (14 years ago)
Author:
svonolfe
Message:

Merged r4351 of the VRP feature branch into trunk (#1039)

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

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.VehicleRouting.Views

  • trunk/sources/HeuristicLab.Problems.VehicleRouting.Views/3.3/VRPSolutionView.cs

    r4185 r4352  
    2727using HeuristicLab.MainForm;
    2828using HeuristicLab.Problems.VehicleRouting.Encodings;
     29using HeuristicLab.Parameters;
     30using System.Linq;
    2931
    3032namespace HeuristicLab.Problems.VehicleRouting.Views {
     
    6769      } else {
    6870        GenerateImage();
    69         tourViewHost.Content = Content.Solution;
     71        UpdateTourView();
    7072      }
    7173    }
     
    8082      pictureBox.Enabled = Content != null;
    8183      tourGroupBox.Enabled = Content != null;
     84    }
     85
     86    private void UpdateTourView() {
     87      tourGridView.Rows.Clear();
     88      tourGridView.ColumnCount = Content.Coordinates.Rows - 1;
     89
     90      if (Content != null && Content.Solution != null) {
     91        foreach (Tour tour in Content.Solution.GetTours(new ValueLookupParameter<DoubleMatrix>("DistanceMatrix", Content.DistanceMatrix))) {
     92          int row = tourGridView.Rows.Add();
     93          int cell = 0;
     94          foreach (int city in tour.Cities) {
     95            tourGridView.Rows[row].Cells[cell].Value = city;
     96            cell++;
     97          }
     98        }
     99      }
    82100    }
    83101
     
    119137              if (Content.Solution != null) {
    120138                int currentTour = 0;
    121                 foreach (Tour tour in Content.Solution.Tours) {
     139                foreach (Tour tour in Content.Solution.GetTours(new ValueLookupParameter<DoubleMatrix>("DistanceMatrix", distanceMatrix))) {
    122140                  double t = 0.0;
    123141                  Point[] tourPoints = new Point[tour.Cities.Count + 2];
     
    202220      else {
    203221        GenerateImage();
    204         tourViewHost.Content = Content.Solution;
     222        UpdateTourView();
    205223      }
    206224    }
Note: See TracChangeset for help on using the changeset viewer.