diff --git a/be-graphes-model/src/main/java/org/insa/graphs/model/Path.java b/be-graphes-model/src/main/java/org/insa/graphs/model/Path.java index 9079ab1..6980fd7 100644 --- a/be-graphes-model/src/main/java/org/insa/graphs/model/Path.java +++ b/be-graphes-model/src/main/java/org/insa/graphs/model/Path.java @@ -210,11 +210,14 @@ public class Path { * * @return Total length of the path (in meters). * - * @deprecated Need to be implemented. */ public float getLength() { - // TODO: - return 0; + float acc = 0; + for (Arc l : arcs) { + acc += l.getLength(); + } + + return acc; } /** @@ -225,10 +228,10 @@ public class Path { * @return Time (in seconds) required to travel this path at the given speed (in * kilometers-per-hour). * - * @deprecated Need to be implemented. */ public double getTravelTime(double speed) { - return (this.getLength()/speed); + double speed2 = speed * 1000/3600; + return (this.getLength()/speed2); } /**