SUMO
Simulation of Urban MObility

- Home
- Download
- Documentation
- Wiki
- Trac
- Blog
- Contact
- SF-Project

# TraCI/Lane Value Retrieval

## Command 0xa3: Get Lane Variable

ubyte | string
Variable | Lane ID
--- | ---

Asks for the value of a certain variable of the named lane.

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

Overview Retrievable Lane Variables
Variable | ValueType | Description
--- | --- | ---
id list (0x00) | stringList | Returns a list of ids of all lanes within the scenario (the given Lane ID is ignored)
count (0x01) | int | Returns the number of lanes within the scenario (the given Lane ID is ignored)
link number (0x30) | ubyte | Returns the number of links outgoing from this lane [#]
edge id (0x31) | string | Returns the id of the edge this lane belongs to
links (0x33) | compound | Returns descriptions of the links outgoing from this lane [m]
allowed vehicle classes (0x34) | stringList | Returns the mml-definitions of vehicle classes allowed on this lane
disallowed vehicle classes (0x35) | stringList | Returns the mml-definitions of vehicle classes not allowed on this lane
length (0x44) | double | Returns the length of the named lane [m]
vmax (0x41) | double | Returns the maximum speed allowed on this lane [m/s]
shape (0x4e) | shape | Returns this lane's shape
width (0x4d) | double | Returns the width of the named lane [m]
CO2 emissions (id 0x60) | double | Sum of CO2 emissions on this lane in mg during this time step, computed based on HBEFA.
CO emissions (id 0x61) | double | Sum of CO emissions on this lane in mg during this time step, computed based on HBEFA.
HC emissions (id 0x62) | double | Sum of HC emissions on this lane in mg during this time step, computed based on HBEFA.
PMx emissions (id 0x63) | double | Sum of PMx emissions on this lane in mg during this time step, computed based on HBEFA.
NOx emissions (id 0x64) | double | Sum of NOx emissions on this lane in mg during this time step, computed based on HBEFA.
fuel consumption (id 0x65) | double | Sum of fuel consumption on this lane in ml during this time step, computed based on HBEFA.
noise emission (id 0x66) | double | Sum of noise generated on this lane in dBA, computed based on Harmonoise.
last step vehicle number (0x10) | integer | The number of vehicles on this lane within the last time step.
last step mean speed (0x11) | double | Returns the mean speed of vehicles that were on the named induction loop within the last simulation step [m/s]
last step vehicle ids (0x12) | stringList | Returns the list of ids of vehicles that were on the named induction loop in the last simulation step
last step occupancy (0x13) | double | Returns the percentage of time the detector was occupied by a vehicle [%]
last step mean vehicle length (0x15) | double | The mean length of vehicles which were on the detector in the last step [m]

### Response 0xb3: Lane Variable

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

The respond to a "Command Get Lane Variable".

#### Structure of compound object links

If you request the list of links, an compound object is returned, structured as following. Attention, each part is fowarded by a byte which represents its data type, except "length".

integer | type + integer | link | ... | link
Length | Number of links | Link 1 | ... | Link n
--- | --- | --- | --- | ---

where length is the total number of following elements -- counting each element of link separatley -- and link is decribed by:

type + string | type + string | type + ubyte | type + ubyte | type + ubyte | type + string | type + string | type + double
consecutive not internal lane | consecutive internal lane | has priority (=1) or not (=0) | is opened (=1) or not (=0) | has approaching foe (=1) or not (=0) | (current) state (not yet implemented, always="") | direction (not yet implemented, always="") | length [m] - only valid if not using internal lanes
--- | --- | --- | --- | --- | --- | --- | ---

Caution:
Please note that the information "is opened" and "has approaching foe" currently refer to the current time step; this is rather inappropriate and will be probably changed in the next future.

This page was last modified on 6 January 2012, at 08:08.