Skip to content

6.1 VehicleStateRegimeVariables

smart-fm edited this page Nov 9, 2018 · 6 revisions

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.


Flow chart for setStatus

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 the setStatus function mentioned above;
  • if vehicle wants to change to the right or left lane (STATUS_RIGHT, STATUS_LEFT), set in makeLaneChangingDecision function;
    • if vehicle is changing to the right or left lane (STATUS_LC_RIGHT, STATUS_LC_LEFT), set in executeLC function;
    • if a vehicle is in mandatory lane change state (STATUS_MANDATORY), set by the checkForLookAheadLC function;
    • 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. The status variable is represented by a 32-bit hexadecimal variable and its default values defined in the Constants.h file; e.g.: const UNIT STATUS_RIGHT =0x00000001 Furthermore, auxiliary functions are created to alter the correct bits in the status function (check class DriverUpdateParams).

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_ESCAPE with FLAG_ESCAPE_RIGHT and FLAG_ESCAPE_LEFT), set in two functions: checkForLC and checkIfLookAheadEvents. 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_AVOID with FLAG_AVOID_RIGHT and FLAG_AVOID_LEFT) set in the same functions as the above mentioned FLAG_ESCAPE;
  • Tag that keeps track of the last LC decision made (FLAG_PREV_LC with FLAG_PREV_LC_RIGHT and FLAG_PREV_LC_LEFT);
  • Tag for feasible nosing state (FLAG_NOSING_FEASIBLE) set in executeLaneChanging;
  • Yielding state tag (FLAG_YIELDING with FLAG_YIELDING_RIGHT and FLAG_YIELDING_LEFT) executeLaneChanging and (unset) in calcYieldingRate of the acceleration models;
  • Nosing state tag (FLAG_NOSING with FLAG_NOSING_RIGHT and FLAG_NOSING_LEFT), set in executeLaneChanging;
  • Tag a vehicle that reaches the end of his lane (FLAG_STUCK_AT_END), set by checkNosingFeasibility;
  • Tag a vehicle that fails a lane change (FLAG_LC_FAILED with FLAG_LC_FAILED_LEAD and FLAG_LC_FAILED_LAG) and set by executeLaneChanging;
Clone this wiki locally