-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestCode.java
More file actions
33 lines (18 loc) · 837 Bytes
/
TestCode.java
File metadata and controls
33 lines (18 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package code;
import java.io.FileNotFoundException;
public class TestCode {
public static void main(String[] args) throws FileNotFoundException {
simulatedAnnealing n = new simulatedAnnealing();
//change it to the dataset.txt path in your laptop or pc
n.setFileLocation("C:\\Users\\tridev\\eclipse-workspace\\simulated Annealing\\src\\code\\dataset.txt");
n.annealling();
String path = "";
for (int i = 0; i < n.getNodesOrder().size()-1; i++)
{
path += n.getNodesOrder().get(i) + " -> ";
}
path += n.getNodesOrder().get(n.getNodesOrder().size() - 1);
System.out.println("\n best tour: " + path);
System.out.println("The distance is: " + n.shortestCost);
}
}