Compare commits

..

No commits in common. "96dc076c30cf8ed88fb91e710b3c8b9e91743530" and "1de89b46d533535a959a95c1a82c04ed06ee2ebb" have entirely different histories.

View file

@ -56,22 +56,7 @@ public class Path {
public static Path createShortestPathFromNodes(Graph graph, List<Node> nodes)
throws IllegalArgumentException {
List<Arc> arcs = new ArrayList<Arc>();
Arc candidat = null;
Node deb = nodes.remove(0);
for(Node fin : nodes){
float dist = Float.MAX_VALUE;
for(Arc a : deb.getSuccessors()){
if(a.getDestination().equals(fin)&&dist>a.getLength()){
dist = a.getLength();
candidat=a;
}
}
if(dist==Float.MAX_VALUE){
throw new IllegalArgumentException("Liste de noeuds non valide");
}
arcs.add(candidat);
deb = fin;
}
// TODO:
return new Path(graph, arcs);
}
@ -190,7 +175,7 @@ public class Path {
return this.origin == null;
}
/**speed
/**
* Get the number of <b>nodes</b> in this path.
*
* @return Number of nodes in this path.
@ -264,11 +249,8 @@ public class Path {
* @deprecated Need to be implemented.
*/
public double getTravelTime(double speed) {
float res = 0;
for(Arc a : arcs){
res+=a.getTravelTime(speed);
}
return res;
// TODO:
return 0;
}
/**