diff --git a/BE-Graphes/be-graphes-model/src/main/java/org/insa/graphs/model/Path.java b/BE-Graphes/be-graphes-model/src/main/java/org/insa/graphs/model/Path.java index 7580981..9c00acc 100644 --- a/BE-Graphes/be-graphes-model/src/main/java/org/insa/graphs/model/Path.java +++ b/BE-Graphes/be-graphes-model/src/main/java/org/insa/graphs/model/Path.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; + /** *

* Class representing a path between nodes in a graph. @@ -25,12 +26,21 @@ public class Path { * @return A path that goes through the given list of nodes. * @throws IllegalArgumentException If the list of nodes is not valid, i.e. two * consecutive nodes in the list are not connected in the graph. - * @deprecated Need to be implemented. */ public static Path createFastestPathFromNodes(Graph graph, List nodes) throws IllegalArgumentException { + List arcs_parcourus = new ArrayList(); List arcs = new ArrayList(); - // TODO: + double time_min = Float.MAX_VALUE; + for (Node node: nodes){ + arcs_parcourus=node.getSuccessors(); + for (Arc arc : arcs_parcourus){ + if (arc.getMinimumTravelTime() nodes) throws IllegalArgumentException { List arcs = new ArrayList(); - // TODO: + List arcs_parcourus = new ArrayList(); + float len_min = Float.MAX_VALUE; + for (Node node: nodes){ + arcs_parcourus=node.getSuccessors(); + for (Arc arc : arcs_parcourus){ + if (arc.getLength()be-graphes-all - 17 + 11 ${jdk.version} ${jdk.version} UTF-8