Compare commits
2 commits
2914df4a37
...
fcf385ba21
| Author | SHA1 | Date | |
|---|---|---|---|
| fcf385ba21 | |||
| 23d47c448b |
1 changed files with 18 additions and 8 deletions
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue