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)
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue