Person Value Retrieval

## Command 0xae: Get Person Variable

ubyte | string
--- | ---
Variable | Person ID

Asks for the value of a certain variable of the named person. The value returned is the state of the asked variable/value within the last simulation step. In the case the person is loaded, but outside the network - due not being yet inserted into the network or being teleported within the current time step - a default "error" value is returned.

The following variable values can be retrieved, the type of the return value is also shown in the table.

Overview Retrievable Person Variables

Variable | ValueType | Description | Python Method
--- | --- | --- | ---
id list (0x00) | stringList | Returns a list of ids of all persons currently running within the scenario (the given person ID is ignored) | getIDList
count (0x01) | int | Returns the number of persons currently running within the scenario (the given person ID is ignored) | getIDCount
speed (0x40) | double | Returns the speed of the named person within the last step [m/s]; error value: -2^30 | getSpeed
position (0x42) | position | Returns the position(two doubles) of the named person within the last step [m,m]; error value: [-2^30, -2^30]. | getPosition
position 3D (0x39) | position | Returns the 3D-position(three doubles) of the named vehicle (center of the front bumper) within the last step [m,m,m]; error value: [-2^30, -2^30, -2^30]. | getPosition3D
angle (0x43) | double | Returns the angle of the named person within the last step [°]; error value: -2^30 | getAngle
slope (0x36) | double | Retrieves the slope at the current person position in degrees | getSlope
road id (0x50) | string | Returns the id of the edge the named person was at within the last step; error value: "" | getRoadID
type id (0x4f) | string | Returns the id of the type of the named person | getTypeID
color (0x45) | ubyte,ubyte,ubyte,ubyte | Returns the person's color (RGBA). | getColor
edge position (0x56) | double | The position of the person along the edge (in [m]); error value: -2^30 | getLanePosition
length (0x44) | double | Returns the length of the persons [m] | getLength
minGap (0x4c) | double | Returns the offset (gap to front person if halting) of this person [m] | getMinGap
width (0x4d) | double | Returns the width of this person [m] | getWidth
waiting time (0x7a) | double | Returns the waiting time [s] | getWaitingTime
next edge (0xc1) | string | Returns the next edge on the persons route while it is walking. If there is no further edge or the person is in another stage, returns the empty string. | getNextEdge
remaining stages (0xc2) | int | Returns the number of remaining stages for the given person including the current stage. | getRemainingStages
vehicle (0xc3) | string | Returns the id of the vehicle if the person is in stage driving and has entered a vehicle. | getVehicle
taxi reservations (0xc6) | list(Stage) (see below) | Returns all reservations. If onlyNew is 1, each reservation is returned only once. | getTaxiReservations

## Response 0xb4: Person Variable

ubyte | string | ubyte | <return_type>
--- | --- | --- | ---
Variable | Person ID | Return type of the variable | <VARIABLE_VALUE>

The respond to a "Command Get Person Variable".

## Response 0xc6: taxi reservations

Returns all reservations. If onlyNew is 1, each reservation is returned only once.

string | string | string | string | string | double | double | double | double
--- | --- | --- | --- | --- | --- | --- | --- | ---
id | persons | group | fromEdge | toEdge | departPos | arrivalPos | depart | reservationTime

## Extended retrieval messages

Some further messages require additional parameters.

Overview Extended Variables Retrieval

Variable | Request ValueType | Response ValueType | Description | Python Method
--- | --- | --- | --- | ---
stage (0xc0) | next stage index (int) | TraCIStage | Returns the a compound object that describes nth next stage. Index 0 retrieves the value for the current stage. The given index must be lower than the value of 'remaining stages'. | getStage
edges (0x54) | next stage index (int) | stringList | Returns the edges of the nth next stage. Index 0 retrieves the value for the current stage. The given index must be lower than the value of 'remaining stages'. For driving stages only origin and destination edge are returned. | getEdges

#### Search

Enter your search terms:

#### Keyboard Shortcuts

Key | Action
--- | ---
`?` | Open this help dialog
`s` | Search the Documentation
`e` | Edit current page on GitHub