MCPcopy Create free account
hub / github.com/comaps/comaps / BuildFGraph

Function BuildFGraph

libs/routing/routing_tests/restriction_test.cpp:686–707  ·  view source on GitHub ↗

2 *---F2--> ^ F0 | 1 *---F1-->* Finish ^ F0 | 0 0 1 Start

Source from the content-addressed store, hash-verified

684// 0 1
685// Start
686unique_ptr<SingleVehicleWorldGraph> BuildFGraph()
687{
688 unique_ptr<TestGeometryLoader> loader = make_unique<TestGeometryLoader>();
689 loader->AddRoad(0 /* feature id */, true /* one way */, 1.0 /* speed */,
690 RoadGeometry::Points({{0.0, 0.0}, {0.0, 1.0}, {0.0, 2.0}}));
691 loader->AddRoad(1 /* feature id */, true /* one way */, 1.0 /* speed */,
692 RoadGeometry::Points({{0.0, 1.0}, {1.0, 1.0}}));
693 loader->AddRoad(2 /* feature id */, true /* one way */, 1.0 /* speed */,
694 RoadGeometry::Points({{0.0, 2.0}, {1.0, 2.0}}));
695
696 vector<Joint> const joints = {
697 MakeJoint({{0 /* feature id */, 0 /* point id */}}), /* joint at point (0, 0) */
698 MakeJoint({{0, 1}, {1, 0}}), /* joint at point (0, 1) */
699 MakeJoint({{0, 2}, {2, 0}}), /* joint at point (0, 2) */
700 MakeJoint({{1, 1}}), /* joint at point (1, 1) */
701 MakeJoint({{2, 1}}), /* joint at point (1, 2) */
702 };
703
704 traffic::TrafficCache const trafficCache;
705 shared_ptr<EdgeEstimator> estimator = CreateEstimatorForCar(trafficCache);
706 return BuildWorldGraph(std::move(loader), estimator, joints);
707}
708
709// This test checks that having a Only restriction from F0 to F2 it's still possible std::move
710// from F0 to F1.

Callers 1

UNIT_CLASS_TESTFunction · 0.85

Calls 5

PointsFunction · 0.85
MakeJointFunction · 0.85
CreateEstimatorForCarFunction · 0.85
BuildWorldGraphFunction · 0.85
AddRoadMethod · 0.45

Tested by

no test coverage detected