Merge branch 'master' of https://git.etud.insa-toulouse.fr/brunetto/BEGraphes
This commit is contained in:
commit
be3ce20466
1 changed files with 11 additions and 11 deletions
|
@ -1,7 +1,7 @@
|
||||||
package org.insa.graphs.algorithm.utils;
|
package org.insa.graphs.algorithm.utils;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertFalse;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ public class PCCTest{
|
||||||
|
|
||||||
arcInspectors.add(ArcInspectorFactory.getAllFilters().get(0)) ; //Sans Filtres
|
arcInspectors.add(ArcInspectorFactory.getAllFilters().get(0)) ; //Sans Filtres
|
||||||
arcInspectors.add(ArcInspectorFactory.getAllFilters().get(1)); //Voiture, longueur
|
arcInspectors.add(ArcInspectorFactory.getAllFilters().get(1)); //Voiture, longueur
|
||||||
arcInspectors.add(ArcInspectorFactory.getAllFilters().get(2)); //Voiture, temps
|
arcInspectors.add(ArcInspectorFactory.getAllFilters().get(3)); //Voiture, temps
|
||||||
|
|
||||||
//Créations des données pour les algos
|
//Créations des données pour les algos
|
||||||
|
|
||||||
|
@ -95,7 +95,8 @@ public class PCCTest{
|
||||||
public void TestDikjstraVL() {
|
public void TestDikjstraVL() {
|
||||||
|
|
||||||
dji = new DijkstraAlgorithm(DataVL_INSA);
|
dji = new DijkstraAlgorithm(DataVL_INSA);
|
||||||
assertTrue(dji.run().isFeasible());
|
assertFalse(dji.run().isFeasible());
|
||||||
|
|
||||||
|
|
||||||
dji = new DijkstraAlgorithm(DataVL_HauteGaronne);
|
dji = new DijkstraAlgorithm(DataVL_HauteGaronne);
|
||||||
bf = new BellmanFordAlgorithm(DataVL_HauteGaronne);
|
bf = new BellmanFordAlgorithm(DataVL_HauteGaronne);
|
||||||
|
@ -107,14 +108,14 @@ public class PCCTest{
|
||||||
@Test
|
@Test
|
||||||
public void TestDikjstraVT() {
|
public void TestDikjstraVT() {
|
||||||
|
|
||||||
dji = new DijkstraAlgorithm(DataVT_INSA);
|
|
||||||
bf = new BellmanFordAlgorithm(DataVT_INSA);
|
dji = new DijkstraAlgorithm(DataVL_INSA);
|
||||||
assertEquals(bf.run().getPath().getLength(), dji.run().getPath().getLength(), 0.05f);
|
assertFalse(dji.run().isFeasible());
|
||||||
|
|
||||||
|
|
||||||
dji = new DijkstraAlgorithm(DataVT_HauteGaronne);
|
dji = new DijkstraAlgorithm(DataVT_HauteGaronne);
|
||||||
bf = new BellmanFordAlgorithm(DataVT_HauteGaronne);
|
bf = new BellmanFordAlgorithm(DataVT_HauteGaronne);
|
||||||
assertEquals(bf.run().getPath().getLength(), dji.run().getPath().getLength(), 0.05f);
|
assertEquals(bf.run().getPath().getMinimumTravelTime(), dji.run().getPath().getMinimumTravelTime(), 0.05f);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,7 +136,7 @@ public class PCCTest{
|
||||||
public void TestAStarVL() {
|
public void TestAStarVL() {
|
||||||
|
|
||||||
as = new AStarAlgorithm(DataVL_INSA);
|
as = new AStarAlgorithm(DataVL_INSA);
|
||||||
assertTrue(as.run().isFeasible());
|
assertFalse(as.run().isFeasible());
|
||||||
|
|
||||||
as = new AStarAlgorithm(DataVL_HauteGaronne);
|
as = new AStarAlgorithm(DataVL_HauteGaronne);
|
||||||
bf = new BellmanFordAlgorithm(DataVL_HauteGaronne);
|
bf = new BellmanFordAlgorithm(DataVL_HauteGaronne);
|
||||||
|
@ -148,12 +149,11 @@ public class PCCTest{
|
||||||
public void TestAStarVT() {
|
public void TestAStarVT() {
|
||||||
|
|
||||||
as = new AStarAlgorithm(DataVT_INSA);
|
as = new AStarAlgorithm(DataVT_INSA);
|
||||||
bf = new BellmanFordAlgorithm(DataVT_INSA);
|
assertFalse(as.run().isFeasible());
|
||||||
assertEquals(bf.run().getPath().getLength(), as.run().getPath().getLength(), 0.05f);
|
|
||||||
|
|
||||||
as = new AStarAlgorithm(DataVT_HauteGaronne);
|
as = new AStarAlgorithm(DataVT_HauteGaronne);
|
||||||
bf = new BellmanFordAlgorithm(DataVT_HauteGaronne);
|
bf = new BellmanFordAlgorithm(DataVT_HauteGaronne);
|
||||||
assertEquals(bf.run().getPath().getLength(), as.run().getPath().getLength(), 0.05f);
|
assertEquals(bf.run().getPath().getMinimumTravelTime(), as.run().getPath().getMinimumTravelTime(), 0.05f);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue