Skip to content
Snippets Groups Projects
Commit baca5e46 authored by Romain BERNARD's avatar Romain BERNARD Committed by Romain BERNARD
Browse files

shortest path container testing

parent 27ac6610
No related branches found
No related tags found
1 merge request!1Transit algorithm implementation
......@@ -5,6 +5,7 @@
#include "../src/instance/graph/Graph.h"
#include "../src/ShortestPath/Transit/TransitStateContainer.h"
#include "../src/ShortestPath/Transit/TransitShortestPathPrecompute.h"
#include "../src/ShortestPath/Transit/TransitShortestPathContainer.h"
int main() {
// Graph give_me_a_name("../resources/test/instances/basic_debug_instance/nodes.csv",
......@@ -17,38 +18,50 @@ int main() {
Graph graphFromSingleFile("../resources/test/instances/" + instanceFolder + datFile);
graphFromSingleFile.exportGraphToFiles("../resources/test/outputs/" + instanceFolder);
TransitShortestPathContainer contiguousContainer(graphFromSingleFile.getNbNodes());
for(auto& ptLine : graphFromSingleFile.getPTLines()) {
for(int i = 0; i < ptLine.size(); ++i) {
for (auto& startingTime: ptLine.getTimetable(i)) {
TransitShortestPathPrecompute::executeAlgorithm(graphFromSingleFile, ptLine.getNode(i),startingTime);
contiguousContainer.addShortestPathCollection(i, startingTime, graphFromSingleFile.getNbNodes(),
TransitShortestPathPrecompute::executeAlgorithm(graphFromSingleFile, ptLine.getNode(i),startingTime));
contiguousContainer.getShortestPathsFromTime(i, startingTime - 1);
}
}
}
TransitShortestPathContainer crossingContainer(graphFromSingleFile.getNbNodes());
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(crossingLinesGraph, ptLine.getNode(i),startingTime);
crossingContainer.addShortestPathCollection(i, startingTime, crossingLinesGraph.getNbNodes(),
TransitShortestPathPrecompute::executeAlgorithm(crossingLinesGraph, ptLine.getNode(i),startingTime));
crossingContainer.getShortestPathsFromTime(i, startingTime - 1);
}
}
}
TransitShortestPathContainer cycleContainer(graphFromSingleFile.getNbNodes());
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(cyclingLineGraph, ptLine.getNode(i),startingTime);
cycleContainer.addShortestPathCollection(i, startingTime, cyclingLineGraph.getNbNodes(),
TransitShortestPathPrecompute::executeAlgorithm(cyclingLineGraph, ptLine.getNode(i),startingTime));
cycleContainer.getShortestPathsFromTime(i, startingTime - 1);
}
}
}
TransitShortestPathContainer multiCycleContainer(graphFromSingleFile.getNbNodes());
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);
multiCycleContainer.addShortestPathCollection(i, startingTime, multipleCyclingLinesGraph.getNbNodes(),
TransitShortestPathPrecompute::executeAlgorithm(multipleCyclingLinesGraph, ptLine.getNode(i),startingTime));
multiCycleContainer.getShortestPathsFromTime(i, startingTime - 1);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment