Compare commits

...

2 commits

Author SHA1 Message Date
fcf385ba21 Changes to be committed: 2020-03-25 18:21:41 +01:00
23d47c448b Changes to be committed:
Changes not staged for commit:
2020-03-25 18:16:59 +01:00

View file

@ -201,20 +201,28 @@ public class Path {
* @deprecated Need to be implemented. * @deprecated Need to be implemented.
*/ */
public boolean isValid() { public boolean isValid() {
// TODO: if (!this.isEmpty()) {
return false; return false;
} }
if (this.getArcs().size() != 0) {
return false;
}
return true;
}
/** /**
* Compute the length of this path (in meters). * Compute the length of this path (in meters).
* *
* @return Total length of the path (in meters). * Total length of the path (in meters).
* *
* @deprecated Need to be implemented. * Need to be implemented.
*/ */
public float getLength() { public float getLength() {
// TODO: float totalLength = 0.0f;
return 0; for(Arc arc : this.arcs) {
totalLength += arc.getLength();
}
return totalLength;
} }
/** /**
@ -228,8 +236,10 @@ public class Path {
* @deprecated Need to be implemented. * @deprecated Need to be implemented.
*/ */
public double getTravelTime(double speed) { public double getTravelTime(double speed) {
// TODO: double temps = 0.0;
return 0; float longueur = getLength();
temps = longueur/(speed*(1000.0/3600.0));
return temps;
} }
/** /**