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

Function BuildXXGraph

libs/routing/routing_tests/cumulative_restriction_test.cpp:185–225  ·  view source on GitHub ↗

Finish 3 ↖ ↗ F5 F6 ↖ ↗ 2 ↖ ↗ ↖ F2 F3 F4 ↖ ↗ ↖ 1 ↗ ↖ ^ F0 F1 F8 ↗ ↖ | 0 * *--F7---> ^ F9 | -1 0 1 2 3 Start Note. This graph contains of 9 one segment directed features.

Source from the content-addressed store, hash-verified

183// Start
184// Note. This graph contains of 9 one segment directed features.
185unique_ptr<SingleVehicleWorldGraph> BuildXXGraph()
186{
187 unique_ptr<TestGeometryLoader> loader = make_unique<TestGeometryLoader>();
188 loader->AddRoad(0 /* featureId */, true /* oneWay */, 1.0 /* speed */,
189 RoadGeometry::Points({{0.0, 0.0}, {1.0, 1.0}}));
190 loader->AddRoad(1 /* featureId */, true /* oneWay */, 1.0 /* speed */,
191 RoadGeometry::Points({{2.0, 0.0}, {1.0, 1.0}}));
192 loader->AddRoad(2 /* featureId */, true /* oneWay */, 1.0 /* speed */,
193 RoadGeometry::Points({{1.0, 1.0}, {0.0, 2.0}}));
194 loader->AddRoad(3 /* featureId */, true /* oneWay */, 1.0 /* speed */,
195 RoadGeometry::Points({{1.0, 1.0}, {2.0, 2.0}}));
196 loader->AddRoad(4 /* featureId */, true /* oneWay */, 1.0 /* speed */,
197 RoadGeometry::Points({{3.0, 1.0}, {2.0, 2.0}}));
198 loader->AddRoad(5 /* featureId */, true /* oneWay */, 1.0 /* speed */,
199 RoadGeometry::Points({{2.0, 2.0}, {1.0, 3.0}}));
200 loader->AddRoad(6 /* featureId */, true /* oneWay */, 1.0 /* speed */,
201 RoadGeometry::Points({{2.0, 2.0}, {3.0, 3.0}}));
202 loader->AddRoad(7 /* featureId */, true /* oneWay */, 1.0 /* speed */,
203 RoadGeometry::Points({{2.0, 0.0}, {3.0, 0.0}}));
204 loader->AddRoad(8 /* featureId */, true /* oneWay */, 1.0 /* speed */,
205 RoadGeometry::Points({{3.0, 0.0}, {3.0, 1.0}}));
206 loader->AddRoad(9 /* featureId */, true /* oneWay */, 1.0 /* speed */,
207 RoadGeometry::Points({{2.0, -1.0}, {2.0, 0.0}}));
208
209 vector<Joint> const joints = {
210 MakeJoint({{0 /* feature id */, 0 /* point id */}}), /* joint at point (0, 0) */
211 MakeJoint({{1, 0}, {7, 0}, {9, 1}}), /* joint at point (2, 0) */
212 MakeJoint({{0, 1}, {1, 1}, {2, 0}, {3, 0}}), /* joint at point (1, 1) */
213 MakeJoint({{2, 1}}), /* joint at point (0, 2) */
214 MakeJoint({{3, 1}, {4, 1}, {5, 0}, {6, 0}}), /* joint at point (2, 2) */
215 MakeJoint({{4, 0}, {8, 1}}), /* joint at point (3, 1) */
216 MakeJoint({{5, 1}}), /* joint at point (1, 3) */
217 MakeJoint({{6, 1}}), /* joint at point (3, 3) */
218 MakeJoint({{7, 1}, {8, 0}}), /* joint at point (3, 0) */
219 MakeJoint({{9, 0}}), /* joint at point (2, -1) */
220 };
221
222 traffic::TrafficCache const trafficCache;
223 shared_ptr<EdgeEstimator> estimator = CreateEstimatorForCar(trafficCache);
224 return BuildWorldGraph(std::move(loader), estimator, joints);
225}
226
227// 2 * *
228// ↗ ↘

Callers 1

UNIT_CLASS_TESTFunction · 0.70

Calls 5

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

Tested by

no test coverage detected