Version fonctionnelle - Ajout getMinimumTravelTime isValid
This commit is contained in:
parent
4365c6b3a8
commit
3303f2400c
1 changed files with 18 additions and 8 deletions
|
@ -197,12 +197,21 @@ public class Path {
|
|||
* </ul>
|
||||
*
|
||||
* @return true if the path is valid, false otherwise.
|
||||
*
|
||||
* @deprecated Need to be implemented.
|
||||
*/
|
||||
public boolean isValid() {
|
||||
// TODO:
|
||||
return false;
|
||||
boolean retour = true;
|
||||
if ((! this.isEmpty()) && (!(this.size() == 0))) {
|
||||
Node Deb = this.origin;
|
||||
for (Arc arc : this.arcs) {
|
||||
if (Deb == arc.getOrigin()) {
|
||||
Deb = arc.getDestination();
|
||||
} else {
|
||||
retour = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return retour;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -239,12 +248,13 @@ public class Path {
|
|||
* on every arc.
|
||||
*
|
||||
* @return Minimum travel time to travel this path (in seconds).
|
||||
*
|
||||
* @deprecated Need to be implemented.
|
||||
*/
|
||||
public double getMinimumTravelTime() {
|
||||
// TODO:
|
||||
return 0;
|
||||
double minimumTravelTime = 0;
|
||||
for (Arc arc : this.arcs) {
|
||||
minimumTravelTime = minimumTravelTime + arc.getMinimumTravelTime();
|
||||
}
|
||||
return minimumTravelTime;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue