conflit resolu
This commit is contained in:
Bezza Younes 2025-04-04 10:15:44 +02:00
commit 66462ee535

View file

@ -29,7 +29,8 @@ public class Path {
public static Path createFastestPathFromNodes(Graph graph, List<Node> nodes) public static Path createFastestPathFromNodes(Graph graph, List<Node> nodes)
throws IllegalArgumentException { throws IllegalArgumentException {
List<Arc> arcs = new ArrayList<Arc>(); List<Arc> arcs = new ArrayList<Arc>();
// TODO: // TODO : faut faire en fct du maxspeed ds road information
return new Path(graph, arcs); return new Path(graph, arcs);
} }
@ -217,11 +218,14 @@ 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() {
// TODO: float pathLength=0f; // sinon error si on met O.O
return 0; for (Arc element : this.arcs) {
pathLength=pathLength+((float) element.getLength());
}
return pathLength;
} }
/** /**
@ -230,11 +234,14 @@ public class Path {
* @param speed Speed to compute the travel time. * @param speed Speed to compute the travel time.
* @return Time (in seconds) required to travel this path at the given speed (in * @return Time (in seconds) required to travel this path at the given speed (in
* kilometers-per-hour). * kilometers-per-hour).
* @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;
} }
/** /**
@ -242,11 +249,14 @@ public class Path {
* every arc. * every arc.
* *
* @return Minimum travel time to travel this path (in seconds). * @return Minimum travel time to travel this path (in seconds).
* @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;
} }
} }