déplacement de testdijkstra dans be-graphes-gui/src/test/java/
This commit is contained in:
parent
94a837123b
commit
aa1301c4e0
1 changed files with 6 additions and 26 deletions
|
|
@ -1,14 +1,9 @@
|
||||||
package org.insa.graphs.gui.simple;
|
|
||||||
|
|
||||||
import java.awt.BorderLayout;
|
|
||||||
import java.awt.Dimension;
|
|
||||||
import java.io.BufferedInputStream;
|
import java.io.BufferedInputStream;
|
||||||
import java.io.DataInputStream;
|
import java.io.DataInputStream;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
|
|
||||||
import javax.swing.JFrame;
|
|
||||||
import javax.swing.SwingUtilities;
|
|
||||||
|
|
||||||
import org.insa.graphs.algorithm.AbstractInputData.Mode;
|
import org.insa.graphs.algorithm.AbstractInputData.Mode;
|
||||||
import org.insa.graphs.algorithm.ArcInspector;
|
import org.insa.graphs.algorithm.ArcInspector;
|
||||||
import org.insa.graphs.algorithm.MyArcInspector;
|
import org.insa.graphs.algorithm.MyArcInspector;
|
||||||
|
|
@ -17,33 +12,15 @@ import org.insa.graphs.algorithm.shortestpath.BellmanFordAlgorithm;
|
||||||
import org.insa.graphs.algorithm.shortestpath.DijkstraAlgorithm;
|
import org.insa.graphs.algorithm.shortestpath.DijkstraAlgorithm;
|
||||||
import org.insa.graphs.algorithm.shortestpath.ShortestPathData;
|
import org.insa.graphs.algorithm.shortestpath.ShortestPathData;
|
||||||
import org.insa.graphs.algorithm.shortestpath.ShortestPathSolution;
|
import org.insa.graphs.algorithm.shortestpath.ShortestPathSolution;
|
||||||
import org.insa.graphs.gui.drawing.Drawing;
|
import org.insa.graphs.model.Arc;
|
||||||
import org.insa.graphs.gui.drawing.components.BasicDrawing;
|
|
||||||
import org.insa.graphs.model.Graph;
|
import org.insa.graphs.model.Graph;
|
||||||
import org.insa.graphs.model.Node;
|
import org.insa.graphs.model.Node;
|
||||||
import org.insa.graphs.model.Path;
|
import org.insa.graphs.model.Path;
|
||||||
import org.insa.graphs.model.Arc;
|
|
||||||
import org.insa.graphs.model.io.BinaryGraphReader;
|
import org.insa.graphs.model.io.BinaryGraphReader;
|
||||||
import org.insa.graphs.model.io.GraphReader;
|
import org.insa.graphs.model.io.GraphReader;
|
||||||
|
|
||||||
public class TestDijkstra {
|
public class TestDijkstra {
|
||||||
|
|
||||||
public static Drawing createDrawing() throws Exception {
|
|
||||||
BasicDrawing basicDrawing = new BasicDrawing();
|
|
||||||
SwingUtilities.invokeAndWait(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
JFrame frame = new JFrame("BE Graphes - Launch");
|
|
||||||
frame.setLayout(new BorderLayout());
|
|
||||||
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
||||||
frame.setVisible(true);
|
|
||||||
frame.setSize(new Dimension(800, 600));
|
|
||||||
frame.setContentPane(basicDrawing);
|
|
||||||
frame.validate();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return basicDrawing;
|
|
||||||
}
|
|
||||||
|
|
||||||
// fonction pour tester un scénario
|
// fonction pour tester un scénario
|
||||||
public static void testScenario(String map, int depart, int arrivee, Mode mode, boolean petitGraphe, boolean Astar, boolean restreint) throws Exception {
|
public static void testScenario(String map, int depart, int arrivee, Mode mode, boolean petitGraphe, boolean Astar, boolean restreint) throws Exception {
|
||||||
|
|
@ -179,6 +156,9 @@ public class TestDijkstra {
|
||||||
// testScenario("paris.mapgr", 27361, 36108, Mode.TIME, true,false,false); // ce test mettait en lumière un problème d'arrondi qui est mtn résolu.
|
// testScenario("paris.mapgr", 27361, 36108, Mode.TIME, true,false,false); // ce test mettait en lumière un problème d'arrondi qui est mtn résolu.
|
||||||
|
|
||||||
System.out.println("== Trajet impossible (piste cyclable) ==");
|
System.out.println("== Trajet impossible (piste cyclable) ==");
|
||||||
testScenario("insa.mapgr",90,922 , Mode.LENGTH, false,false,true); //marche pas
|
testScenario("insa.mapgr",90,922 , Mode.LENGTH, false,false,true);
|
||||||
|
System.out.println("== Trajet impossible (piste cyclable) == sans restriction");
|
||||||
|
testScenario("insa.mapgr",90,922 , Mode.LENGTH, false,false,false); //marche pas
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in a new issue