From 9beb01570657a2498429361f30ad215787d0f180 Mon Sep 17 00:00:00 2001
From: Pedro Pablo Cardona Arroyave <pedropca@stud.ntnu.no>
Date: Fri, 18 Nov 2022 10:11:59 +0100
Subject: [PATCH] Print latitud og longitud

---
 src/Main.java | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/Main.java b/src/Main.java
index 10ac95e..2aa0f66 100644
--- a/src/Main.java
+++ b/src/Main.java
@@ -9,11 +9,18 @@ public class Main {
       g.loadNodes("nodes.txt");
       Edge lastEdge= g.getShortestPath(4247796,232073);
       int sum = 0;
-      
+      List<Integer> destinations = new ArrayList<>();
       while (lastEdge!=null) {
+        destinations.add(lastEdge.getDestination());
         sum += lastEdge.drivingTime;
         lastEdge = lastEdge.previousEdge;
       }
+      List<Node> nodes = g.getNodes();
+      for (Integer destination: destinations) {
+        Node node  = nodes.get(destination);
+        System.out.println(node.getLatitude() +","+node.getLongitude());
+      }
+      System.out.println(nodes.get(4247796).getLatitude()+","+nodes.get(4247796).getLongitude());
       System.out.println(4247796);
       System.out.println("-------------------------------------------");
       System.out.println(Utils.formatTime(sum));
-- 
GitLab