diff --git a/src/main/java/fr/u_paris/gla/project/itinerary/Finder.java b/src/main/java/fr/u_paris/gla/project/itinerary/Finder.java index 1e557b3..49c08d0 100644 --- a/src/main/java/fr/u_paris/gla/project/itinerary/Finder.java +++ b/src/main/java/fr/u_paris/gla/project/itinerary/Finder.java @@ -2,12 +2,19 @@ package fr.u_paris.gla.project.itinerary; import java.util.*; + public class Finder { + private Graph graph; public Finder(Graph graph) { this.graph = graph; } + /** + * return a path from startNode to goalNode using A* algorithm + * @param startNode + * @param goalNode + */ public List findPath(Stop startNode, Stop goalNode) { double startTime = 43200; //12h @@ -74,6 +81,12 @@ public class Finder { return null; } + /** + * Once we found the destination we reconstruct the path + * @param cameFrom + * @param current + * @return path + */ private List reconstructPath(HashMap cameFrom, Stop current) { List totalPath = new ArrayList<>(); totalPath.add(current); @@ -86,16 +99,17 @@ public class Finder { return totalPath; } + /** + * Update the priority queue + * @param openSet + * @param node + * @param newF + */ public void updatePriority(PriorityQueue openSet, Stop node, double newF) { openSet.remove(node); node.setF(newF); openSet.add(node); } - //TODO: - public List findPath(double longitude, double latitude){ - return null; - } - }