A RoadSegment is a unidirectional stretch of road that contains a number of lane segments. A bidirectional stretch of road may be created by combining two road segments running in opposite directions.
RoadSegments may be combined to form a road network.
A RoadSegment is normally connected to two other road segments: a source road from which vehicles enter the road segment and a sink road to which vehicles exit. RoadSegments at the edge of the network will normally be connected to only one other road segment: traffic inflow and outflow will be controlled directly by source and sink objects.
RoadSegments are connected to each other on a lane-wise basis: each sink (outgoing) lane of a road segment may be connected to a source (incoming) lane of another road segment. This allows the forking and merging of road segments, the creation of on-ramps and off-ramps. By connecting the lanes of a number of road segments in this way, complex junctions and interchanges may be created.
A RoadSegment is a logical entity, not a physical one. That is a RoadSegment does not know if it is straight or winding, it just knows about the vehicles it contains and what it is connected to. A vehicle's coordinates on a RoadsSegment are given by the vehicle's position relative to the start of the RoadSegment and the vehicle's lane.
A RoadSegment has laneCount
lanes. Lanes within a RoadSegment are represented by the LaneSegment class.
The mapping from a position on a RoadSegment to coordinates in physical space is determined by a RoadSegment's RoadMapping. Although the RoadMapping is primarily used by software that draws the road network and the vehicles upon it, elements of the RoadMapping may influence vehicle behavior, in particular a road's curvature and its gradient.
|
|
|
|
|
|
|
|