Package de.tudresden.sumo.cmd
Class Trafficlight
java.lang.Object
de.tudresden.sumo.cmd.Trafficlight
The Class Trafficlight.
- Author:
- Mario Krumnow, Evamarie Wiessner
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic SumoCommandReturns the complete traffic light program.static SumoCommandgetControlledJunctions(String tlsID) Returns the junctions controlled by the traffic light.static SumoCommandgetControlledLanes(String tlsID) Returns the list of lanes which are controlled by the named traffic light.static SumoCommandgetControlledLinks(String tlsID) Returns the links controlled by the traffic light, sorted by the signal index and described by giving the incoming, outgoing, and via lane.static SumoCommandReturns the number of all traffic lights in the network.static SumoCommandReturns a list of IDs of all traffic lights within the scenario.static SumoCommandgetNextSwitch(String tlsID) Returns the assumed time (in ms) at which the TLS changes the phase.static SumoCommandgetParameter(String tlsID, String param) Returns the chosen parameter.static SumoCommandReturns the index of the current phase in the current program.static SumoCommandgetPhaseDuration(String tlsID) getPhaseDuration.static SumoCommandgetPhaseName(String tlsID) Returns the name of the current phase in the current program.static SumoCommandgetProgram(String tlsID) Returns the id of the current program.static SumoCommandgetRedYellowGreenState(String tlsID) Returns the named tl's state as a tuple of light definitions from rRgGyYoO, for red, green, yellow, off, where lower case letters mean that the stream has to decelerate.static SumoCommandsetCompleteRedYellowGreenDefinition(String tlsID, SumoTLSProgram tls) Set the complete traffic light program.static SumoCommandsetParameter(String tlsID, String param, String value) Sets the chosen parameter.static SumoCommandSet the index of the current phase in the current program.static SumoCommandsetPhaseDuration(String tlsID, double phaseDuration) Set the duration of the currently active phase (in s?).static SumoCommandsetPhaseName(String tlsID, String name) Set the name of the current phase in the current program.static SumoCommandsetProgram(String tlsID, String programID) Set the id of the current program.static SumoCommandsetRedYellowGreenState(String tlsID, String state) Set the named tl's state as a tuple of light definitions.
- 
Constructor Details- 
Trafficlightpublic Trafficlight()
 
- 
- 
Method Details- 
getCompleteRedYellowGreenDefinitionReturns the complete traffic light program.- Parameters:
- tlsID- a string identifying the traffic light
- Returns:
- program definition
 
- 
getIDCountReturns the number of all traffic lights in the network.- Returns:
- number of traffic lights
 
- 
getPhaseDurationgetPhaseDuration.- Parameters:
- tlsID- a string identifying the traffic light
- Returns:
- phase duration
 
- 
getControlledLanesReturns the list of lanes which are controlled by the named traffic light.- Parameters:
- tlsID- a string identifying the traffic light
- Returns:
- list of controlled lanes
 
- 
getControlledLinksReturns the links controlled by the traffic light, sorted by the signal index and described by giving the incoming, outgoing, and via lane.- Parameters:
- tlsID- a string identifying the traffic light
- Returns:
- list of controlled links
 
- 
getControlledJunctionsReturns the junctions controlled by the traffic light.- Parameters:
- tlsID- a string identifying the traffic light
- Returns:
- list of controlled junctions
 
- 
getIDListReturns a list of IDs of all traffic lights within the scenario.- Returns:
- a list of IDs of all TLS
 
- 
getNextSwitchReturns the assumed time (in ms) at which the TLS changes the phase.- Parameters:
- tlsID- a string identifying the traffic light
- Returns:
- absolute time, counting from simulation start, at which TLS may change
 
- 
getParameterReturns the chosen parameter.- Parameters:
- tlsID- a string identifying the traffic light
- param- a string identifying the parameter
- Returns:
- the specific parameter
 
- 
setParameterSets the chosen parameter.- Parameters:
- tlsID- the tls ID
- param- a string identifying the parameter
- value- a string identifying the new value
- Returns:
- SumoCommand
 
- 
getPhaseReturns the index of the current phase in the current program.- Parameters:
- tlsID- a string identifying the traffic light
- Returns:
- index of the current phase
 
- 
getPhaseNameReturns the name of the current phase in the current program.- Parameters:
- tlsID- a string identifying the traffic light
- Returns:
- name of the current phase
 
- 
getProgramReturns the id of the current program.- Parameters:
- tlsID- a string identifying the traffic light
- Returns:
- index of the current program
 
- 
getRedYellowGreenStateReturns the named tl's state as a tuple of light definitions from rRgGyYoO, for red, green, yellow, off, where lower case letters mean that the stream has to decelerate.- Parameters:
- tlsID- a string identifying the traffic light
- Returns:
- SumoCommand
 
- 
setCompleteRedYellowGreenDefinitionSet the complete traffic light program.- Parameters:
- tlsID- a string identifying the traffic light
- tls- complete program definition
- Returns:
- SumoCommand
 
- 
setPhaseSet the index of the current phase in the current program.- Parameters:
- tlsID- a string identifying the traffic light
- index- an integer identifying the phase (it must be between 0 and the number of phases known to the current program of the tls - 1)
- Returns:
- SumoCommand
 
- 
setPhaseNameSet the name of the current phase in the current program.- Parameters:
- tlsID- a string identifying the traffic light
- name- a string with the phase name
- Returns:
- SumoCommand
 
- 
setPhaseDurationSet the duration of the currently active phase (in s?).- Parameters:
- tlsID- a string identifying the traffic light
- phaseDuration- remaining duration of the current phase
- Returns:
- SumoCommand
 
- 
setProgramSet the id of the current program.- Parameters:
- tlsID- a string identifying the traffic light
- programID- a string identifying the program
- Returns:
- SumoCommand
 
- 
setRedYellowGreenStateSet the named tl's state as a tuple of light definitions.- Parameters:
- tlsID- a string identifying the traffic light
- state- as a tuple of light definitions from rRgGyYoO, for red, green, yellow, off, where lower case letters mean that the stream has to decelerate
- Returns:
- SumoCommand
 
 
-