ajout des méthodes TravelTime() et MinimumTravelTime()
This commit is contained in:
parent
1c2efc2d51
commit
ca03cd5860
1 changed files with 11 additions and 5 deletions
|
@ -196,7 +196,7 @@ public class Path {
|
||||||
* Compute the length of this path (in meters).
|
* Compute the length of this path (in meters).
|
||||||
*
|
*
|
||||||
* @return Total length of the path (in meters).
|
* @return Total length of the path (in meters).
|
||||||
* @deprecated Need to be implemented.
|
*
|
||||||
*/
|
*/
|
||||||
public float getLength() {
|
public float getLength() {
|
||||||
float pathLength=0f; // sinon error si on met O.O
|
float pathLength=0f; // sinon error si on met O.O
|
||||||
|
@ -215,8 +215,11 @@ 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 travelTime=0; // sinon error si on met O.O
|
||||||
return 0;
|
for (Arc element : this.arcs) {
|
||||||
|
travelTime=travelTime+element.getTravelTime(speed);
|
||||||
|
}
|
||||||
|
return travelTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -227,8 +230,11 @@ public class Path {
|
||||||
* @deprecated Need to be implemented.
|
* @deprecated Need to be implemented.
|
||||||
*/
|
*/
|
||||||
public double getMinimumTravelTime() {
|
public double getMinimumTravelTime() {
|
||||||
// TODO:
|
double minimumTravelTime=0;
|
||||||
return 0;
|
for (Arc element : this.arcs) {
|
||||||
|
minimumTravelTime=minimumTravelTime+element.getMinimumTravelTime();
|
||||||
|
}
|
||||||
|
return minimumTravelTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue