Merge branch 'master' of https://git.etud.insa-toulouse.fr/brunetto/BEGraphes
This commit is contained in:
commit
41aa35a1dd
1 changed files with 118 additions and 2 deletions
|
@ -36,6 +36,8 @@ import org.insa.graphs.model.io.BinaryPathReader;
|
|||
|
||||
import org.insa.graphs.algorithm.ArcInspector;
|
||||
import org.insa.graphs.algorithm.ArcInspectorFactory;
|
||||
import org.insa.graphs.algorithm.shortestpath.AStarAlgorithm;
|
||||
import org.insa.graphs.algorithm.shortestpath.BellmanFordAlgorithm;
|
||||
import org.insa.graphs.algorithm.shortestpath.DijkstraAlgorithm;
|
||||
import org.insa.graphs.algorithm.shortestpath.ShortestPathData;
|
||||
|
||||
|
@ -53,7 +55,7 @@ public class PCCTest{
|
|||
@BeforeClass
|
||||
public static void initAll() throws Exception
|
||||
{
|
||||
final String nomUser = "brunetto";
|
||||
final String nomUser = "norgeux";
|
||||
// Visit these directory to see the list of available files on Commetud.
|
||||
|
||||
//Récupération des cartes
|
||||
|
@ -97,7 +99,121 @@ public class PCCTest{
|
|||
DataVT_France = new ShortestPathData(graphs.get(1), paths.get(1).getOrigin(), paths.get(1).getDestination(), arcInspectors.get(2));
|
||||
DataVT_HauteGaronne = new ShortestPathData(graphs.get(2), paths.get(2).getOrigin(), paths.get(2).getDestination(), arcInspectors.get(2));
|
||||
|
||||
}
|
||||
System.out.println("");
|
||||
|
||||
}
|
||||
|
||||
private static DijkstraAlgorithm dji ;
|
||||
private static AStarAlgorithm as ;
|
||||
private static BellmanFordAlgorithm bf ;
|
||||
|
||||
/* TEST DIKJSTRA SANS FILTRE */
|
||||
@Test
|
||||
public void TestDikjstraSF() {
|
||||
|
||||
dji = new DijkstraAlgorithm(DataSF_INSA);
|
||||
bf = new BellmanFordAlgorithm(DataSF_INSA);
|
||||
assertEquals(bf.run(), dji.run());
|
||||
|
||||
dji = new DijkstraAlgorithm(DataSF_France);
|
||||
bf = new BellmanFordAlgorithm(DataSF_France);
|
||||
assertEquals(bf.run(), dji.run());
|
||||
|
||||
dji = new DijkstraAlgorithm(DataSF_HauteGaronne);
|
||||
bf = new BellmanFordAlgorithm(DataSF_HauteGaronne);
|
||||
assertEquals(bf.run(), dji.run());
|
||||
|
||||
}
|
||||
|
||||
/* TEST DIKJSTRA VERSION LENGTH */
|
||||
@Test
|
||||
public void TestDikjstraVL() {
|
||||
|
||||
dji = new DijkstraAlgorithm(DataVL_INSA);
|
||||
bf = new BellmanFordAlgorithm(DataVL_INSA);
|
||||
assertEquals(bf.run(), dji.run());
|
||||
|
||||
dji = new DijkstraAlgorithm(DataVL_France);
|
||||
bf = new BellmanFordAlgorithm(DataVL_France);
|
||||
assertEquals(bf.run(), dji.run());
|
||||
|
||||
dji = new DijkstraAlgorithm(DataVL_HauteGaronne);
|
||||
bf = new BellmanFordAlgorithm(DataVL_HauteGaronne);
|
||||
assertEquals(bf.run(), dji.run());
|
||||
|
||||
}
|
||||
|
||||
/* TEST DIKJSTRA VERSION TIME */
|
||||
@Test
|
||||
public void TestDikjstraVT() {
|
||||
|
||||
dji = new DijkstraAlgorithm(DataVT_INSA);
|
||||
bf = new BellmanFordAlgorithm(DataVT_INSA);
|
||||
assertEquals(bf.run(), dji.run());
|
||||
|
||||
dji = new DijkstraAlgorithm(DataVT_France);
|
||||
bf = new BellmanFordAlgorithm(DataVT_France);
|
||||
assertEquals(bf.run(), dji.run());
|
||||
|
||||
dji = new DijkstraAlgorithm(DataVT_HauteGaronne);
|
||||
bf = new BellmanFordAlgorithm(DataVT_HauteGaronne);
|
||||
assertEquals(bf.run(), dji.run());
|
||||
|
||||
}
|
||||
|
||||
/* TEST A* SANS FILTRE */
|
||||
@Test
|
||||
public void TestAStarSF() {
|
||||
|
||||
as = new AStarAlgorithm(DataSF_INSA);
|
||||
bf = new BellmanFordAlgorithm(DataSF_INSA);
|
||||
assertEquals(bf.run(), as.run());
|
||||
|
||||
as = new AStarAlgorithm(DataSF_INSA);
|
||||
bf = new BellmanFordAlgorithm(DataSF_France);
|
||||
assertEquals(bf.run(), as.run());
|
||||
|
||||
as = new AStarAlgorithm(DataSF_HauteGaronne);
|
||||
bf = new BellmanFordAlgorithm(DataSF_HauteGaronne);
|
||||
assertEquals(bf.run(), as.run());
|
||||
|
||||
}
|
||||
|
||||
/* TEST A* VERSION LENGTH */
|
||||
@Test
|
||||
public void TestAStarVL() {
|
||||
|
||||
as = new AStarAlgorithm(DataVL_INSA);
|
||||
bf = new BellmanFordAlgorithm(DataVL_INSA);
|
||||
assertEquals(bf.run(), as.run());
|
||||
|
||||
as = new AStarAlgorithm(DataVL_INSA);
|
||||
bf = new BellmanFordAlgorithm(DataVL_France);
|
||||
assertEquals(bf.run(), as.run());
|
||||
|
||||
as = new AStarAlgorithm(DataVL_HauteGaronne);
|
||||
bf = new BellmanFordAlgorithm(DataVL_HauteGaronne);
|
||||
assertEquals(bf.run(), as.run());
|
||||
|
||||
}
|
||||
|
||||
/* TEST A* VERSION TIME */
|
||||
@Test
|
||||
public void TestAStarVT() {
|
||||
|
||||
as = new AStarAlgorithm(DataVT_INSA);
|
||||
bf = new BellmanFordAlgorithm(DataVT_INSA);
|
||||
assertEquals(bf.run(), as.run());
|
||||
|
||||
as = new AStarAlgorithm(DataVT_INSA);
|
||||
bf = new BellmanFordAlgorithm(DataVT_France);
|
||||
assertEquals(bf.run(), as.run());
|
||||
|
||||
as = new AStarAlgorithm(DataVT_HauteGaronne);
|
||||
bf = new BellmanFordAlgorithm(DataVT_HauteGaronne);
|
||||
assertEquals(bf.run(), as.run());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue