PCCTest V2
This commit is contained in:
parent
49859bc50c
commit
31222aaf62
1 changed files with 56 additions and 5 deletions
|
@ -18,11 +18,62 @@ import org.junit.runner.RunWith;
|
||||||
import org.junit.runners.Parameterized;
|
import org.junit.runners.Parameterized;
|
||||||
import org.junit.runners.Parameterized.Parameter;
|
import org.junit.runners.Parameterized.Parameter;
|
||||||
import org.junit.runners.Parameterized.Parameters;
|
import org.junit.runners.Parameterized.Parameters;
|
||||||
|
import org.junit.BeforeClass;
|
||||||
|
|
||||||
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.Dimension;
|
||||||
|
import java.io.BufferedInputStream;
|
||||||
|
import java.io.DataInputStream;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
|
||||||
|
import javax.swing.JFrame;
|
||||||
|
import javax.swing.SwingUtilities;
|
||||||
|
|
||||||
|
import org.insa.graphs.model.Graph;
|
||||||
|
import org.insa.graphs.model.Path;
|
||||||
|
import org.insa.graphs.model.io.BinaryGraphReader;
|
||||||
|
import org.insa.graphs.model.io.BinaryPathReader;
|
||||||
|
import org.insa.graphs.model.io.GraphReader;
|
||||||
|
import org.insa.graphs.model.io.PathReader;
|
||||||
|
|
||||||
|
import org.insa.graphs.algorithm.ArcInspector;
|
||||||
|
import org.insa.graphs.algorithm.ArcInspectorFactory;
|
||||||
|
import org.insa.graphs.algorithm.shortestpath.DijkstraAlgorithm;
|
||||||
|
import org.insa.graphs.algorithm.shortestpath.ShortestPathData;
|
||||||
|
|
||||||
|
public class PCCTest{
|
||||||
|
|
||||||
|
@BeforeClass
|
||||||
|
public static void initAll() throws Exception
|
||||||
|
{
|
||||||
|
final String nomUser = "brunetto";
|
||||||
|
// Visit these directory to see the list of available files on Commetud.
|
||||||
|
final String mapName = "/home/" + nomUser + "/Bureau/commetud/3eme Annee MIC/Graphes-et-Algorithmes/Maps/insa.mapgr";
|
||||||
|
final String pathName = "/home/" + nomUser + "/Bureau/commetud/3eme Annee MIC/Graphes-et-Algorithmes/Paths/path_fr31insa_rangueil_r2.path";
|
||||||
|
|
||||||
|
// Create a graph reader.
|
||||||
|
final GraphReader reader = new BinaryGraphReader(
|
||||||
|
new DataInputStream(new BufferedInputStream(new FileInputStream(mapName))));
|
||||||
|
|
||||||
|
// Read the graph.
|
||||||
|
final Graph graph = reader.read();
|
||||||
|
|
||||||
|
|
||||||
@BeforeClass
|
// Create a PathReader.
|
||||||
public static void initAll()
|
final PathReader pathReader = new BinaryPathReader(
|
||||||
{
|
new DataInputStream(new BufferedInputStream(new FileInputStream(pathName))));
|
||||||
|
|
||||||
|
// Read the path.
|
||||||
|
final Path path = pathReader.readPath(graph);
|
||||||
|
|
||||||
|
final ArcInspector arcInspector = ArcInspectorFactory.getAllFilters().get(0) ;
|
||||||
|
|
||||||
|
ShortestPathData theData = new ShortestPathData(graph, path.getOrigin(), path.getDestination(), arcInspector);
|
||||||
|
//ArcInspectorFactory liste d'ArcInspectors avec permissions etc existants en static
|
||||||
|
DijkstraAlgorithm dji = new DijkstraAlgorithm(theData);
|
||||||
|
|
||||||
|
System.out.println("");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in a new issue