Simulation/Output/Traffic Lights

SUMO offers some possibilities to save states of traffic lights during the simulation, a feature mainly used to evaluate adaptive traffic light algorithms. We will now describe these outputs.

Instantiating within the Simulation
To enable writing tls state information you have to add the following definition into one of your additional files: " dest=""/>

The attributes have herein the following meanings:

Generated Output
The output looks like this:  " id="" programID="" phase="" state="/>  ... further states ... 

The state is saved in each simulation second. The state itself is coded as a list of the characters 'G', 'Y', and 'R', standing for "green", "yellow", and "red", respectively, see Simulation/Traffic Lights. Each character describes a link controlled by the traffic light. Only the state of the current program is saved (see also "Adding new Programs"). The attributes have the following meaning:

Instantiating within the Simulation
This output contains information about the green light phases of links (lane-to-lane connections). Each green light phase is describes by its begin, end and duration. An entry is written into the file as soon a green phase of a link ends. To enable writing tls switch information you have to add the following definition into one of your additional files: " dest=""/>

The attributes have herein the following meanings:

Generated Output
The output looks like this:  " programID="" \ fromLane="" toLane="" \ begin="<BEGIN_OF_GREEN_PHASE>" end="<END_OF_GREEN_PHASE>" \ duration="<DURATION_OF_GREEN_PHASE>"/> ... further switch points ... </tls-switches>

Each entry is written into a single line. The values have the following meanings:

Instantiating within the Simulation
This output saves tls-states as the TLS States - output does but not every second but only at times the phases or the program (see also "Adding new Programs") change. The output is instantiated by adding the following definition into one of your additional files: <timedEvent type="SaveTLSSwitchStates" source="<TLS_ID>" dest="<OUTPUT_FILE>"/>

The attributes have herein the following meanings:

Generated Output
The output looks like this: <tls-switch-states> <tlsstate time="<SIM_STEP>" id="<TLS_ID>" subid="<TLS_SUBID>"><STATE> ... further states ... </tls-switch-states>

Each entry is written into a single line. The values have the following meanings:

Instantiating within the Simulation
It is possible to add e2-detectors which are coupled to a traffic light. Then, the tls is used to determine the intervals (aggregation) time instead of giving a fixed aggregation time. In this case, output will be generated every time the traffic light switches. To use this feature, simply replace the freq-attribute within the description of an e2-detector by the id of the traffic light that should steer it (use the attribute "tl" to specify the id):

<e2Detector id="<ID>" lane="<LANE_ID>" pos="<POSITION_ON_LANE>" length="<DETECTOR_LENGTH>" tl="<TL_ID>" file="<OUTPUT_FILE>" [timeThreshold="<FLOAT>"] [speedThreshold="<FLOAT>"] [jamThreshold="<FLOAT>"]/>

A further feature allows you to collect measures only for the time the light turns yellow for a certain link (connection between the incoming and the outgoing lane). This should allows measuring the maximum jam length in front of a red traffic light for this link. To enable this, one has to add the name of the following lane: to="<LANE_ID>" to the list of attributes. The incoming lane is already given by the " lane "-attribute.