Merge branch 'main' of https://git.etud.insa-toulouse.fr/bezza/BE-Graphe
conflit resolu
This commit is contained in:
commit
66462ee535
1 changed files with 20 additions and 10 deletions
|
@ -29,7 +29,8 @@ public class Path {
|
|||
public static Path createFastestPathFromNodes(Graph graph, List<Node> nodes)
|
||||
throws IllegalArgumentException {
|
||||
List<Arc> arcs = new ArrayList<Arc>();
|
||||
// TODO:
|
||||
// TODO : faut faire en fct du maxspeed ds road information
|
||||
|
||||
return new Path(graph, arcs);
|
||||
}
|
||||
|
||||
|
@ -217,11 +218,14 @@ public class Path {
|
|||
* Compute the length of this path (in meters).
|
||||
*
|
||||
* @return Total length of the path (in meters).
|
||||
* @deprecated Need to be implemented.
|
||||
*
|
||||
*/
|
||||
public float getLength() {
|
||||
// TODO:
|
||||
return 0;
|
||||
float pathLength=0f; // sinon error si on met O.O
|
||||
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.
|
||||
* @return Time (in seconds) required to travel this path at the given speed (in
|
||||
* kilometers-per-hour).
|
||||
* @deprecated Need to be implemented.
|
||||
*
|
||||
*/
|
||||
public double getTravelTime(double speed) {
|
||||
// TODO:
|
||||
return 0;
|
||||
double travelTime=0; // sinon error si on met O.O
|
||||
for (Arc element : this.arcs) {
|
||||
travelTime=travelTime+element.getTravelTime(speed);
|
||||
}
|
||||
return travelTime;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -242,11 +249,14 @@ public class Path {
|
|||
* 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 element : this.arcs) {
|
||||
minimumTravelTime=minimumTravelTime+element.getMinimumTravelTime();
|
||||
}
|
||||
return minimumTravelTime;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue