Add implementation of methods for Path (for testing purpose... ).

This commit is contained in:
Holt59 2018-02-24 21:23:24 +01:00
parent ccad590007
commit f736bf3005

View File

@ -11,6 +11,9 @@ public class PathTest {
// Small graph use for tests
private static Graph graph;
// List of arcs in the graph.
private static Arc[] arcs;
@BeforeAll
static void initAll() throws IOException {
@ -24,16 +27,12 @@ public class PathTest {
}
// Add arcs...
new Arc(nodes[0], nodes[1], 10, speed10, null);
new Arc(nodes[0], nodes[3], 15, speed10, null);
new Arc(nodes[0], nodes[4], 15, speed20, null);
new Arc(nodes[1], nodes[2], 10, speed10, null);
new Arc(nodes[2], nodes[3], 20, speed10, null);
new Arc(nodes[2], nodes[3], 10, speed10, null);
new Arc(nodes[2], nodes[3], 15, speed20, null);
new Arc(nodes[3], nodes[0], 15, speed10, null);
new Arc(nodes[3], nodes[4], 20, speed20, null);
new Arc(nodes[0], nodes[1], 10, speed10, null);
arcs = new Arc[] { new Arc(nodes[0], nodes[1], 10, speed10, null),
new Arc(nodes[0], nodes[3], 15, speed10, null), new Arc(nodes[0], nodes[4], 15, speed20, null),
new Arc(nodes[1], nodes[2], 10, speed10, null), new Arc(nodes[2], nodes[3], 20, speed10, null),
new Arc(nodes[2], nodes[3], 10, speed10, null), new Arc(nodes[2], nodes[3], 15, speed20, null),
new Arc(nodes[3], nodes[0], 15, speed10, null), new Arc(nodes[3], nodes[4], 20, speed20, null),
new Arc(nodes[0], nodes[1], 10, speed10, null) };
graph = new Graph(0, Arrays.asList(nodes));
}