Network directions

Traffic may travel with or against the direction of a link as defined by its start and end node. There is a subtle but important difference between allowable and actual direction of traffic, namely, that a GTU has to have one, while both, either or none can be allowed. Allowance is defined in LongitudinalDirectionality, for both links and lanes.

Longitudinal directionality
⌊ Plus
⌊ Minus
⌊ Both
⌊ None

For a GTU there are only two possible directions of travel, hence we also have GTUDirectionality.

GTU directionality
⌊ Plus
⌊ Minus

In many ways, a combination of a link or lane with a GTU directionality is a more suitable building block for an algorithm than the link or lane itself. Small classes define combinations as LinkDirection and LaneDirection. These have a number of helper methods that allow easier algorithms that search over a network from the perspective of a GTU. In particular LaneDirection.getNextLaneDirection(…) aides in dealing with splits in an easy and consistent manner.

Link / Lane direction
⌊ Link / Lane
⌊ GTU directionality

Other small classes additionally define a longitudinal position on the link or lane, namely DirectedLinkPosition and DirectedLanePosition.