|
@@ -25,7 +25,7 @@ import org.insa.graphs.model.io.PathReader;
|
25
|
25
|
import org.junit.BeforeClass;
|
26
|
26
|
import org.junit.Test;
|
27
|
27
|
|
28
|
|
-public class DijkstraAlgorithmTest{
|
|
28
|
+public class DijkstraAlgorithm_et_AStarTest{
|
29
|
29
|
|
30
|
30
|
//copié sur PathTest.java
|
31
|
31
|
// Small graph use for tests
|
|
@@ -55,6 +55,7 @@ public class DijkstraAlgorithmTest{
|
55
|
55
|
@BeforeClass
|
56
|
56
|
public static void initAll() throws IOException {
|
57
|
57
|
|
|
58
|
+ //TODO: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHHHH
|
58
|
59
|
/*//gestion des restrictions pour pouvoir créer les Bellman-Ford
|
59
|
60
|
AccessRestrictions voiture, pedestre;
|
60
|
61
|
AccessRestrictions.AccessRestriction authorise = AccessRestrictions.AccessRestriction.ALLOWED;
|
|
@@ -108,7 +109,7 @@ public class DijkstraAlgorithmTest{
|
108
|
109
|
datapt= new ShortestPathData(graph, nodes[5], nodes[0], pietime);//f->e
|
109
|
110
|
onenodata=new ShortestPathData(graph, nodes[2], nodes[2], pietime);
|
110
|
111
|
emptydata=new ShortestPathData(graph, null, null, pietime);
|
111
|
|
- invalidata=new ShortestPathData(graph, nodes[0], nodes[7], carlen);//h accessible uniquement aux piétons
|
|
112
|
+ invalidata=new ShortestPathData(graph, nodes[0], nodes[7], carlen);//h est accessible uniquement aux piétons
|
112
|
113
|
|
113
|
114
|
//initialisation des Dijkstras
|
114
|
115
|
dijkal = (new DijkstraAlgorithm(dataal)).run();
|
|
@@ -226,7 +227,7 @@ public class DijkstraAlgorithmTest{
|
226
|
227
|
PathReader pathread = new BinaryPathReader(new DataInputStream(new BufferedInputStream(new FileInputStream(pathaddr))));
|
227
|
228
|
|
228
|
229
|
Graph graphmap = graphread.read();
|
229
|
|
- Path pathmap = pathread.readPath(graphmap);//erreur ici mais pas mapmismatch, donc pourquoi? Path impossible? (hem)
|
|
230
|
+ Path pathmap = pathread.readPath(graphmap);//erreur ici mais pas mapmismatch, donc pourquoi? Path impossible? (hem) TODO: correct this
|
230
|
231
|
//quel inspector prendre? Le path est en longueur mais voitures seulement ou tout autorisé?
|
231
|
232
|
|
232
|
233
|
DijkstraAlgorithm dijkmap = new DijkstraAlgorithm(new ShortestPathData(graphmap, pathmap.getOrigin(), pathmap.getDestination(), alllen));
|
|
@@ -236,4 +237,8 @@ public class DijkstraAlgorithmTest{
|
236
|
237
|
assertTrue(asmap.run().getPath().getLength()==pathmap.getLength());
|
237
|
238
|
//comparaison de la longueur
|
238
|
239
|
}
|
|
240
|
+
|
|
241
|
+ //TODO: sans oracle
|
|
242
|
+ //idem mais au lieu du path trouver les ids de deux nodes valides?
|
|
243
|
+
|
239
|
244
|
}
|