Tout les test larche
This commit is contained in:
parent
bc6e91b21d
commit
e41e12d980
2 changed files with 4 additions and 17 deletions
|
@ -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
|
//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()));
|
return new LabelStar(x,cout,parent,Point.distance(data.getGraph().get(x.getId()).getPoint(), data.getDestination().getPoint()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,6 @@ import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import org.insa.graphs.model.*;
|
import org.insa.graphs.model.*;
|
||||||
import org.insa.graphs.model.RoadInformation.RoadType;
|
import org.insa.graphs.model.RoadInformation.RoadType;
|
||||||
import java.io.BufferedInputStream;
|
import java.io.BufferedInputStream;
|
||||||
|
@ -23,7 +21,7 @@ import org.insa.graphs.model.io.GraphReader;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
public abstract class DijkstraAlgorithmTest {
|
public class DijkstraAlgorithmTest {
|
||||||
|
|
||||||
// Small graph use for tests
|
// Small graph use for tests
|
||||||
private static Graph graph;
|
private static Graph graph;
|
||||||
|
@ -48,10 +46,6 @@ public abstract class DijkstraAlgorithmTest {
|
||||||
|
|
||||||
// Create nodes
|
// Create nodes
|
||||||
nodes = new Node[6];
|
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[0] = new Node(0, new Point(0, 20));
|
||||||
nodes[1] = new Node(0, new Point(20, 0));
|
nodes[1] = new Node(0, new Point(20, 0));
|
||||||
nodes[2] = new Node(0, new Point(15, 43));
|
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));
|
graph = new Graph("ID", "", Arrays.asList(nodes), new GraphStatistics (null,9,1,72,1));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ShortestPathAlgorithm doAlgo(ShortestPathData data) {
|
protected ShortestPathAlgorithm doAlgo(ShortestPathData data) {
|
||||||
|
@ -82,6 +74,7 @@ public abstract class DijkstraAlgorithmTest {
|
||||||
return new DijkstraAlgorithm(data);
|
return new DijkstraAlgorithm(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void Chemin_Valide() throws Exception{
|
public void Chemin_Valide() throws Exception{
|
||||||
final String map_c = "/mnt/commetud/3eme Annee MIC/Graphes-et-Algorithmes/Maps/carre-dense.mapgr";
|
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
|
@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 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))));
|
final GraphReader reader = new BinaryGraphReader(new DataInputStream(new BufferedInputStream(new FileInputStream(map_c))));
|
||||||
Graph graph_c = reader.read();
|
Graph graph_c = reader.read();
|
||||||
|
@ -170,10 +163,6 @@ public abstract class DijkstraAlgorithmTest {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue