Tout les test larche

This commit is contained in:
El Haji Fofana 2023-05-19 18:23:24 +02:00
parent bc6e91b21d
commit e41e12d980
2 changed files with 4 additions and 17 deletions

View file

@ -14,6 +14,4 @@ public class AStarAlgorithm extends DijkstraAlgorithm {
//On utilise Point.distance qui permet d'obtenir la distance à vol d'oiseau d'un point x vers un point destination
return new LabelStar(x,cout,parent,Point.distance(data.getGraph().get(x.getId()).getPoint(), data.getDestination().getPoint()));
}
}

View file

@ -8,8 +8,6 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import org.insa.graphs.model.*;
import org.insa.graphs.model.RoadInformation.RoadType;
import java.io.BufferedInputStream;
@ -23,7 +21,7 @@ import org.insa.graphs.model.io.GraphReader;
import org.junit.BeforeClass;
import org.junit.Test;
public abstract class DijkstraAlgorithmTest {
public class DijkstraAlgorithmTest {
// Small graph use for tests
private static Graph graph;
@ -44,14 +42,10 @@ public abstract class DijkstraAlgorithmTest {
// 10 and 20 meters per seconds paramètres des chemins emprunter
RoadInformation speed10 = new RoadInformation(RoadType.MOTORWAY, null, true, 36, ""),
speed20 = new RoadInformation(RoadType.MOTORWAY, null, true, 72, "");
speed20 = new RoadInformation(RoadType.MOTORWAY, null, true, 72, "");
// Create nodes
nodes = new Node[6];
// for (int i = 0; i < nodes.length; ++i) {
// nodes[i] = new Node(i, null);
// }
nodes[0] = new Node(0, new Point(0, 20));
nodes[1] = new Node(0, new Point(20, 0));
nodes[2] = new Node(0, new Point(15, 43));
@ -73,8 +67,6 @@ public abstract class DijkstraAlgorithmTest {
graph = new Graph("ID", "", Arrays.asList(nodes), new GraphStatistics (null,9,1,72,1));
}
protected ShortestPathAlgorithm doAlgo(ShortestPathData data) {
@ -82,6 +74,7 @@ public abstract class DijkstraAlgorithmTest {
return new DijkstraAlgorithm(data);
}
@Test
public void Chemin_Valide() throws Exception{
final String map_c = "/mnt/commetud/3eme Annee MIC/Graphes-et-Algorithmes/Maps/carre-dense.mapgr";
@ -105,7 +98,7 @@ public abstract class DijkstraAlgorithmTest {
}
@Test
public void Comparaison_Bell() throws IOException{
public void Comparaison_Chemin_Bell() throws IOException{
final String map_c = "/mnt/commetud/3eme Annee MIC/Graphes-et-Algorithmes/Maps/carre.mapgr";
final GraphReader reader = new BinaryGraphReader(new DataInputStream(new BufferedInputStream(new FileInputStream(map_c))));
Graph graph_c = reader.read();
@ -170,10 +163,6 @@ public abstract class DijkstraAlgorithmTest {
}
}