Compare commits

..

No commits in common. "728f0699730734131878faefae8a615fe81e9523" and "0b0d1079569a87f549fd5b17138a2ec3c7609774" have entirely different histories.

6 changed files with 12 additions and 24 deletions

View file

@ -22,17 +22,7 @@ public class AStarAlgorithm extends DijkstraAlgorithm {
Path p = Path.createShortestPathFromNodes(data.getGraph(), solutionNodes);
System.out.println("shortest path : " + p.getLength());
if (p.getLength()-solution.getPath().getLength() < 1.00){
System.out.println("le chemin Astar bien est le shortest");
}
}
@Override
public void fastestVerif(ShortestPathSolution solution,ArrayList<Node> solutionNodes,ShortestPathData data){
Path p= Path.createFastestPathFromNodes(data.getGraph(), solutionNodes);
System.out.println("fastest path : " + p.getMinimumTravelTime());
if (p.getMinimumTravelTime()-solution.getPath().getMinimumTravelTime() < 1.00){
System.out.println("le chemin Astar est bien le fastest");
System.out.println("le chemin Astar est le shortest");
}
}

View file

@ -97,7 +97,6 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm {
}
solutionNodes.add(data.getDestination());
ShortestVerif(solution, solutionNodes, data);
fastestVerif(solution, solutionNodes, data);
volDoiseauVerif(data, solution);
return solution;
@ -108,17 +107,7 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm {
Path p = Path.createShortestPathFromNodes(data.getGraph(), solutionNodes);
System.out.println("shortest path : " + p.getLength());
if (p.getLength()-solution.getPath().getLength() < 1.00){
System.out.println("le chemin Dijkstra est bien le shortest");
}
}
public void fastestVerif(ShortestPathSolution solution,ArrayList<Node> solutionNodes,ShortestPathData data){
Path p= Path.createFastestPathFromNodes(data.getGraph(), solutionNodes);
System.out.println("fastest path : " + p.getMinimumTravelTime());
if (p.getMinimumTravelTime()-solution.getPath().getMinimumTravelTime() < 1.00){
System.out.println("le chemin Dijkstra est bien le fastest");
System.out.println("le chemin Dijkstra est le shortest");
}
}

View file

@ -266,6 +266,7 @@ public class Path {
*
*/
public float getLength() {
// TODO:
float length=0;
for (Arc arc : arcs) {
length += arc.getLength();
@ -281,6 +282,14 @@ public class Path {
* @return Time (in seconds) required to travel this path at the given speed (in
* kilometers-per-hour).
*
<<<<<<< HEAD
=======
<<<<<<< HEAD
=======
<<<<<<< HEAD
=======
<<<<<<< HEAD
*/
public double getTravelTime(double speed) {
double TotalTime = 0;
@ -296,7 +305,7 @@ public class Path {
*
* @return Minimum travel time to travel this path (in seconds).
*
*
* @deprecated Need to be implemented.
*/
public double getMinimumTravelTime() {
double minTime = 0;