initial version of the ASRank algorithm
[aco.git] / Distance.java
blob5d5a07f30c19a966e51cd5e4e37e60778ec7aedc
1 class Distance {
3 protected Graph graph;
4 protected int[][] Distance;
6 Distance(Graph graph) {
7 this(graph, new int[graph.getNumOfCities()][graph.getNumOfCities()]);
9 for (int i = 0; i < graph.getNumOfCities(); i++) {
10 for (int j = 0; j < graph.getNumOfCities(); j++) {
11 setDistance(i,j, graph.getINFINITY());
17 Distance(Graph graph, int[][] Distance) {
18 this.graph = graph;
19 this.Distance = Distance;
22 public int[][] getDistance() {
23 return this.Distance;
26 public int getDistance(int x, int y) {
27 return this.Distance[x][y];
30 public void setDistance(int[][] Distance) {
31 this.Distance = Distance;
34 public void setDistance(int x, int y, int Distance) {
35 this.Distance[x][y] = Distance;