1 *--F1--> ↗ ↘ F1 F1 ↗ ↘ 0 Start *---F3--->*---F0--->-------F0----->*---F2-->* Finish -1 0 1 2 3 4 Note. F0 is a two segments feature. F1 is a three segment one. F2 and F3 are one segment features.
| 537 | // Note. F0 is a two segments feature. F1 is a three segment one. F2 and F3 are one segment |
| 538 | // features. |
| 539 | unique_ptr<WorldGraph> BuildTwoWayGraph() |
| 540 | { |
| 541 | unique_ptr<TestGeometryLoader> loader = make_unique<TestGeometryLoader>(); |
| 542 | loader->AddRoad(0 /* feature id */, true /* oneWay */, 1.0 /* speed */, |
| 543 | RoadGeometry::Points({{0.0, 0.0}, {1.0, 0.0}, {3.0, 0}})); |
| 544 | loader->AddRoad(1 /* feature id */, true /* oneWay */, 1.0 /* speed */, |
| 545 | RoadGeometry::Points({{0.0, 0.0}, {1.0, 1.0}, {2.0, 1.0}, {3.0, 0.0}})); |
| 546 | loader->AddRoad(2 /* feature id */, true /* oneWay */, 1.0 /* speed */, |
| 547 | RoadGeometry::Points({{3.0, 0.0}, {4.0, 0.0}})); |
| 548 | loader->AddRoad(3 /* feature id */, true /* oneWay */, 1.0 /* speed */, |
| 549 | RoadGeometry::Points({{-1.0, 0.0}, {0.0, 0.0}})); |
| 550 | |
| 551 | vector<Joint> const joints = { |
| 552 | MakeJoint({{0 /* feature id */, 0 /* point id */}, {1, 0}, {3, 1}}), /* joint at point (0, 0) */ |
| 553 | MakeJoint({{0 /* feature id */, 2 /* point id */}, {1, 3}, {2, 0}}), /* joint at point (3, 0) */ |
| 554 | MakeJoint({{3 /* feature id */, 0 /* point id */}}), /* joint at point (-1, 0) */ |
| 555 | MakeJoint({{2 /* feature id */, 1 /* point id */}}), /* joint at point (4, 0) */ |
| 556 | }; |
| 557 | |
| 558 | traffic::TrafficCache const trafficCache; |
| 559 | shared_ptr<EdgeEstimator> estimator = CreateEstimatorForCar(trafficCache); |
| 560 | return BuildWorldGraph(std::move(loader), estimator, joints); |
| 561 | } |
| 562 | |
| 563 | UNIT_TEST(TwoWayGraph) |
| 564 | { |
no test coverage detected