diff options
author | Yuri Gorshenin <y@mmaps.me> | 2015-04-07 17:34:21 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:46:35 +0300 |
commit | fd08ecf76c8ae0939ee137f3d2532a26d5b78c06 (patch) | |
tree | de97522e5bd0d138b38dad9d4f49938523a9aef9 /pedestrian_routing_benchmarks | |
parent | e631e75971ae468b26f019384c65233c30b3801d (diff) |
[pedestrian-routing-benchmarks] Added pedestrian routing benchmarks.
Diffstat (limited to 'pedestrian_routing_benchmarks')
-rw-r--r-- | pedestrian_routing_benchmarks/pedestrian_routing_benchmarks.pro | 19 | ||||
-rw-r--r-- | pedestrian_routing_benchmarks/pedestrian_routing_test.cc | 37 |
2 files changed, 56 insertions, 0 deletions
diff --git a/pedestrian_routing_benchmarks/pedestrian_routing_benchmarks.pro b/pedestrian_routing_benchmarks/pedestrian_routing_benchmarks.pro new file mode 100644 index 0000000000..a061345c00 --- /dev/null +++ b/pedestrian_routing_benchmarks/pedestrian_routing_benchmarks.pro @@ -0,0 +1,19 @@ +TARGET = pedestrian_routing_benchmarks +CONFIG += console warn_on +CONFIG -= app_bundle +TEMPLATE = app + +ROOT_DIR = ../ +DEPENDENCIES = map routing search storage indexer platform geometry coding base osrm jansson protobuf tomcrypt succinct + +macx-*: LIBS *= "-framework Foundation" "-framework IOKit" + +include($$ROOT_DIR/common.pri) + +QT *= core + +win32* : LIBS *= -lShell32 + +SOURCES += \ + ../testing/testingmain.cpp \ + pedestrian_routing_test.cc \ diff --git a/pedestrian_routing_benchmarks/pedestrian_routing_test.cc b/pedestrian_routing_benchmarks/pedestrian_routing_test.cc new file mode 100644 index 0000000000..36608f917c --- /dev/null +++ b/pedestrian_routing_benchmarks/pedestrian_routing_test.cc @@ -0,0 +1,37 @@ +#include "../testing/testing.hpp" + +#include "../indexer/index.hpp" +#include "../indexer/classificator_loader.hpp" + +#include "../routing/astar_router.hpp" +#include "../routing/features_road_graph.hpp" + +#include "../base/logging.hpp" + +#include "../std/string.hpp" +#include "../std/vector.hpp" + +UNIT_TEST(PedestrianRouting_UK) +{ + string const kMapName = "UK_England"; + classificator::Load(); + Index index; + routing::AStarRouter router(&index); + + m2::RectD rect; + index.AddMap(kMapName + DATA_FILE_EXTENSION, rect); + TEST(index.IsLoaded(kMapName), ()); + MwmSet::MwmId id = index.GetMwmIdByName(kMapName + DATA_FILE_EXTENSION); + TEST_NOT_EQUAL(static_cast<size_t>(-1), id, ()); + + router.SetRoadGraph(new routing::FeaturesRoadGraph(&index, id)); + + vector<routing::RoadPos> startPos = {{59231052, true, 8}, {59231052, false, 8}}; + vector<routing::RoadPos> finalPos = {{49334376, true, 0}, {49334376, false, 0}}; + router.SetFinalRoadPos(finalPos); + + vector<routing::RoadPos> route; + LOG(LINFO, ("Calculating routing...")); + router.CalculateRoute(startPos, route); + LOG(LINFO, ("Route length:", route.size())); +} |