From f12c1ec84b628c5509a24162ca1648f526d25c67 Mon Sep 17 00:00:00 2001 From: Romain BERNARD <romain.bernard@uca.fr> Date: Thu, 14 Mar 2024 17:01:41 +0100 Subject: [PATCH] new debug instances --- .../cycling_line_debug_instance/graph.dat | 7 +---- .../graph.dat | 12 ++++----- .../graph.dat | 27 +++++++++++++++++++ .../graph.dat | 23 ++++++++++++++++ test/debug.cpp | 22 ++++++++++----- 5 files changed, 73 insertions(+), 18 deletions(-) create mode 100644 resources/test/instances/multiple_cycling_lines_debug_instance/graph.dat create mode 100644 resources/test/instances/single_node_lines_debug_instance/graph.dat diff --git a/resources/test/instances/cycling_line_debug_instance/graph.dat b/resources/test/instances/cycling_line_debug_instance/graph.dat index 4cdc53d..5e6abe1 100644 --- a/resources/test/instances/cycling_line_debug_instance/graph.dat +++ b/resources/test/instances/cycling_line_debug_instance/graph.dat @@ -18,9 +18,4 @@ 5,6,3 6,7,2 #PT line format : freq (min), start_time, end_time, node_1, ..., node_n -15,340,560,3,4,5,6 -15,340,560,6,5,4,3 -30,360,580,2,3,4,5,6,7 -30,240,580,7,6,5,4,3,2 -30,290,580,0,4,1 -30,290,580,1,4,0 \ No newline at end of file +30,240,580,7,6,7,5,4,3,2,7 \ No newline at end of file diff --git a/resources/test/instances/multiple_crossing_lines_debug_instance/graph.dat b/resources/test/instances/multiple_crossing_lines_debug_instance/graph.dat index c12d94a..4cdc53d 100644 --- a/resources/test/instances/multiple_crossing_lines_debug_instance/graph.dat +++ b/resources/test/instances/multiple_crossing_lines_debug_instance/graph.dat @@ -18,9 +18,9 @@ 5,6,3 6,7,2 #PT line format : freq (min), start_time, end_time, node_1, ..., node_n -15,340,560,3,4,5,6,3 -15,340,560,6,5,4,3,6 -30,360,580,2,3,4,5,6,7,2 -30,240,580,7,6,5,4,3,2,7 -30,290,580,0,4,1,0 -30,290,580,1,4,0,1 \ No newline at end of file +15,340,560,3,4,5,6 +15,340,560,6,5,4,3 +30,360,580,2,3,4,5,6,7 +30,240,580,7,6,5,4,3,2 +30,290,580,0,4,1 +30,290,580,1,4,0 \ No newline at end of file diff --git a/resources/test/instances/multiple_cycling_lines_debug_instance/graph.dat b/resources/test/instances/multiple_cycling_lines_debug_instance/graph.dat new file mode 100644 index 0000000..6b69917 --- /dev/null +++ b/resources/test/instances/multiple_cycling_lines_debug_instance/graph.dat @@ -0,0 +1,27 @@ +#Params (seed) +123456789 +#Nodes format : status,x,y +,0,7 +,1,6 +,2,5 +,3,4 +,4,3 +,5,2 +,6,1 +,7,0 +#Edges format : node_in,node_out,length +0,1,1 +1,2,1 +2,3,2 +2,4,4 +4,5,2 +5,6,3 +6,7,2 +#PT line format : freq (min), start_time, end_time, node_1, ..., node_n +15,340,560,3,4,5,6,3 +15,340,560,6,5,4,3,6 +30,360,580,2,3,4,5,6,7,2 +30,240,580,7,6,5,4,3,2,7 +30,240,580,7,6,7,5,4,3,2,7 +30,290,580,0,4,1,0 +30,290,580,1,4,0,1 \ No newline at end of file diff --git a/resources/test/instances/single_node_lines_debug_instance/graph.dat b/resources/test/instances/single_node_lines_debug_instance/graph.dat new file mode 100644 index 0000000..971382a --- /dev/null +++ b/resources/test/instances/single_node_lines_debug_instance/graph.dat @@ -0,0 +1,23 @@ +#Params (seed) +123456789 +#Nodes format : status,x,y +,0,7 +,1,6 +,2,5 +,3,4 +,4,3 +,5,2 +,6,1 +,7,0 +#Edges format : node_in,node_out,length +0,1,1 +1,2,1 +2,3,2 +2,4,4 +4,5,2 +5,6,3 +6,7,2 +#PT line format : freq (min), start_time, end_time, node_1, ..., node_n +15,340,560,3,3,3,3,3,3,3,3,3 +15,340,560,7,7,7,7,7,7,7,7 +30,360,580,2,3,4,5,6,7 \ No newline at end of file diff --git a/test/debug.cpp b/test/debug.cpp index 3ae878d..999d44c 100644 --- a/test/debug.cpp +++ b/test/debug.cpp @@ -25,20 +25,30 @@ int main() { } } - Graph cyclingLinesGraph("../resources/test/instances/cycling_line_debug_instance/" + datFile); - for(auto& ptLine : cyclingLinesGraph.getPTLines()) { + Graph crossingLinesGraph("../resources/test/instances/multiple_crossing_lines_debug_instance/" + datFile); + for(auto& ptLine : crossingLinesGraph.getPTLines()) { for(int i = 0; i < ptLine.size(); ++i) { for (auto& startingTime: ptLine.getTimetable(i)) { - TransitShortestPathPrecompute::executeAlgorithm(cyclingLinesGraph, ptLine.getNode(i),startingTime); + TransitShortestPathPrecompute::executeAlgorithm(crossingLinesGraph, ptLine.getNode(i),startingTime); } } } - Graph crossingLinesGraph("../resources/test/instances/multiple_crossing_lines_debug_instance/" + datFile); - for(auto& ptLine : crossingLinesGraph.getPTLines()) { + Graph cyclingLineGraph("../resources/test/instances/cycling_line_debug_instance/" + datFile); + for(auto& ptLine : cyclingLineGraph.getPTLines()) { for(int i = 0; i < ptLine.size(); ++i) { for (auto& startingTime: ptLine.getTimetable(i)) { - TransitShortestPathPrecompute::executeAlgorithm(crossingLinesGraph, ptLine.getNode(i),startingTime); + TransitShortestPathPrecompute::executeAlgorithm(cyclingLineGraph, ptLine.getNode(i),startingTime); + } + } + } + + + Graph multipleCyclingLinesGraph("../resources/test/instances/multiple_cycling_lines_debug_instance/" + datFile); + for(auto& ptLine : multipleCyclingLinesGraph.getPTLines()) { + for(int i = 0; i < ptLine.size(); ++i) { + for (auto& startingTime: ptLine.getTimetable(i)) { + TransitShortestPathPrecompute::executeAlgorithm(multipleCyclingLinesGraph, ptLine.getNode(i),startingTime); } } } -- GitLab