6.1 VehicleStateRegimeVariables - smart-fm/simmobility-prod GitHub Wiki
1. Status variable
The status variable keeps the information on the state of the vehicle regarding its LC regime. The function setStatus resets the status variable to account for the possibility of LC regarding the connectivity regarding the vehicle's path.
The variable status keeps the following state conditions:
- if the neighboring lanes are connected to the next link in the vehicles path (
STATUS_RIGHT_OK,STATUS_LEFT_OK), set in thesetStatusfunction mentioned above; - if vehicle wants to change to the right or left lane (
STATUS_RIGHT,STATUS_LEFT), set inmakeLaneChangingDecisionfunction;- if vehicle is changing to the right or left lane (
STATUS_LC_RIGHT,STATUS_LC_LEFT), set inexecuteLCfunction; - if a vehicle is in mandatory lane change state (
STATUS_MANDATORY), set by thecheckForLookAheadLCfunction; - the value of the acceleration regime. Although MITSIM only considers 3 types of acceleration status values (car-following, free-flowing and emergency regimes), SimMobility accounts of a total of 12 (see Section 5.1 for the variable categories);
- the target gap (
STATUS_STOPPED) due to other factors besides traffic: bus stop, toll, drop off/pick up. Thestatusvariable is represented by a 32-bit hexadecimal variable and its default values defined in theConstants.hfile; e.g.:const UNIT STATUS_RIGHT =0x00000001Furthermore, auxiliary functions are created to alter the correct bits in the status function (check classDriverUpdateParams).
- if vehicle is changing to the right or left lane (
2. Internal Flags
Along with the above status variable, several flag variables are used internally to identify intermediate drivers states. Here, states are not integrated into a single variable as each state flag represents one individual variable:
- The mandatory lane change tag (
FLAG_ESCAPEwithFLAG_ESCAPE_RIGHTandFLAG_ESCAPE_LEFT), set in two functions:checkForLCandcheckIfLookAheadEvents. Furthermore, the flag dedicated to each of the (left and right) sides are also set in the auxiliary function:checkMandatoryEventLC; - The discretionary lane change tag (
FLAG_AVOIDwithFLAG_AVOID_RIGHTandFLAG_AVOID_LEFT) set in the same functions as the above mentionedFLAG_ESCAPE; - Tag that keeps track of the last LC decision made (
FLAG_PREV_LCwithFLAG_PREV_LC_RIGHTandFLAG_PREV_LC_LEFT); - Tag for feasible nosing state (
FLAG_NOSING_FEASIBLE) set inexecuteLaneChanging; - Yielding state tag (
FLAG_YIELDINGwithFLAG_YIELDING_RIGHTandFLAG_YIELDING_LEFT)executeLaneChangingand (unset) incalcYieldingRateof the acceleration models; - Nosing state tag (
FLAG_NOSINGwithFLAG_NOSING_RIGHTandFLAG_NOSING_LEFT), set inexecuteLaneChanging; - Tag a vehicle that reaches the end of his lane (
FLAG_STUCK_AT_END), set bycheckNosingFeasibility; - Tag a vehicle that fails a lane change (
FLAG_LC_FAILEDwithFLAG_LC_FAILED_LEADandFLAG_LC_FAILED_LAG) and set byexecuteLaneChanging;