Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/08/20 11:21:57 (5 years ago)
Author:
abeham
Message:

#2521: some fixes and reusing handling of distance measure as defined in TSP

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.TravelingSalesman/3.3/TSPData.cs

    r17525 r17529  
    161161      if (closed) distance += GetDistance(prev, start);
    162162      return distance;
     163    }
     164
     165    public double[,] CalculateDistanceMatrix() {
     166      var matrix = new double[Cities, Cities];
     167      for (var i = 0; i < Cities; i++) {
     168        for (var j = 0; j < Cities; j++) {
     169          matrix[i, j] = GetDistance(i, j);
     170        }
     171      }
     172      return matrix;
    163173    }
    164174
Note: See TracChangeset for help on using the changeset viewer.