Builds a continuous "motorway" route by:
More...
#include <MotorwayGenerator.h>
Builds a continuous "motorway" route by:
- Finding the two farthest intersections A and B.
- Computing a dynamic perpendicular threshold = thresholdRatio * distance(A,B).
- Selecting all intersections within that threshold of the straight line A->B.
- Sorting them by their projection along A->B.
- Connecting them in sequence (A->…->B) with bidirectional edges.
◆ MotorwayGenerator()
MotorwayGenerator::MotorwayGenerator |
( |
double |
thresholdRatio, |
|
|
int |
defaultSpeed |
|
) |
| |
- Parameters
-
thresholdRatio | Fraction of AB's length used as max perpendicular distance for including nodes (e.g. 0.1 = 10%). |
defaultSpeed | Speed to assign to each motorway segment. |
◆ generate()
Append new bidirectional motorways into the graph (no duplicates).
Implements RoadGenerator.
The documentation for this class was generated from the following files: