From bbc51ce00b8a260806df655510d87ed675b2757a Mon Sep 17 00:00:00 2001 From: brunetto Date: Wed, 19 Apr 2023 18:21:01 +0200 Subject: [PATCH] =?UTF-8?q?Test=20=C3=A0=20corriger?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../insa/graphs/algorithm/utils/PCCTest.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/be-graphes-algos/src/test/java/org/insa/graphs/algorithm/utils/PCCTest.java b/be-graphes-algos/src/test/java/org/insa/graphs/algorithm/utils/PCCTest.java index 7c93f65..7908e45 100644 --- a/be-graphes-algos/src/test/java/org/insa/graphs/algorithm/utils/PCCTest.java +++ b/be-graphes-algos/src/test/java/org/insa/graphs/algorithm/utils/PCCTest.java @@ -1,7 +1,7 @@ package org.insa.graphs.algorithm.utils; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.Assert.assertFalse; import java.util.ArrayList; @@ -58,7 +58,7 @@ public class PCCTest{ arcInspectors.add(ArcInspectorFactory.getAllFilters().get(0)) ; //Sans Filtres 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 @@ -95,7 +95,8 @@ public class PCCTest{ public void TestDikjstraVL() { dji = new DijkstraAlgorithm(DataVL_INSA); - assertTrue(dji.run().isFeasible()); + assertFalse(dji.run().isFeasible()); + dji = new DijkstraAlgorithm(DataVL_HauteGaronne); bf = new BellmanFordAlgorithm(DataVL_HauteGaronne); @@ -107,14 +108,14 @@ public class PCCTest{ @Test public void TestDikjstraVT() { - dji = new DijkstraAlgorithm(DataVT_INSA); - bf = new BellmanFordAlgorithm(DataVT_INSA); - assertEquals(bf.run().getPath().getLength(), dji.run().getPath().getLength(), 0.05f); + + dji = new DijkstraAlgorithm(DataVL_INSA); + assertFalse(dji.run().isFeasible()); dji = new DijkstraAlgorithm(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() { as = new AStarAlgorithm(DataVL_INSA); - assertTrue(as.run().isFeasible()); + assertFalse(as.run().isFeasible()); as = new AStarAlgorithm(DataVL_HauteGaronne); bf = new BellmanFordAlgorithm(DataVL_HauteGaronne); @@ -148,12 +149,11 @@ public class PCCTest{ public void TestAStarVT() { as = new AStarAlgorithm(DataVT_INSA); - bf = new BellmanFordAlgorithm(DataVT_INSA); - assertEquals(bf.run().getPath().getLength(), as.run().getPath().getLength(), 0.05f); + assertFalse(as.run().isFeasible()); as = new AStarAlgorithm(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); }