From a8357ef564b6e95dfb66364356391f81617fdf4e Mon Sep 17 00:00:00 2001 From: HU helene Date: Tue, 23 Apr 2024 21:06:27 +0200 Subject: [PATCH] javadoc --- .../u_paris/gla/project/itinerary/Finder.java | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) 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; - } - }