ADDED getLength()

This commit is contained in:
Guillaume Vincent 2020-03-20 18:23:56 +01:00
parent 61e29e6787
commit 41a7ead4b5

View file

@ -35,7 +35,7 @@ public class Path {
public static Path createFastestPathFromNodes(Graph graph, List<Node> nodes)
throws IllegalArgumentException {
List<Arc> arcs = new ArrayList<Arc>();
// TODO:
//TODO
return new Path(graph, arcs);
}
@ -213,8 +213,14 @@ public class Path {
* @deprecated Need to be implemented.
*/
public float getLength() {
// TODO:
return 0;
// DONE:
float length = 0;
for (Arc arc : this.arcs) {
length += arc.getLength();
}
return length;
}
/**