public class Trafficlight
extends Object
Constructor and Description |
---|
Trafficlight() |
Modifier and Type | Method and Description |
---|---|
static SumoCommand |
getCompleteRedYellowGreenDefinition(String tlsID)
Returns the complete traffic light program.
|
static SumoCommand |
getControlledJunctions(String tlsID)
Returns the junctions controlled by the traffic light
|
static SumoCommand |
getControlledLanes(String tlsID)
Returns the list of lanes which are controlled by the named traffic light.
|
static SumoCommand |
getControlledLinks(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 SumoCommand |
getExternalState(String tlsID)
Returns the external state
|
static SumoCommand |
getIDCount()
Returns the number of all traffic lights in the network.
|
static SumoCommand |
getIDList()
Returns a list of IDs of all traffic lights within the scenario.
|
static SumoCommand |
getNextSwitch(String tlsID)
Returns the assumed time (in ms) at which the TLS changes the phase.
|
static SumoCommand |
getParameter(String tlsID,
String param)
Returns the chosen parameter
|
static SumoCommand |
getPhase(String tlsID)
Returns the index of the current phase in the current program.
|
static SumoCommand |
getPhaseDuration(String tlsID)
getPhaseDuration
|
static SumoCommand |
getProgram(String tlsID)
Returns the id of the current program.
|
static SumoCommand |
getRedYellowGreenState(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 SumoCommand |
setCompleteRedYellowGreenDefinition(String tlsID,
SumoTLSProgram tls)
Set the complete traffic light program.
|
static SumoCommand |
setPhase(String tlsID,
int index)
Set the index of the current phase in the current program.
|
static SumoCommand |
setPhaseDuration(String tlsID,
int phaseDuration)
Set the duration of the currently active phase (in s?).
|
static SumoCommand |
setProgram(String tlsID,
String programID)
Set the id of the current program.
|
static SumoCommand |
setRedYellowGreenState(String tlsID,
String state)
Set the named tl's state as a tuple of light definitions.
|
public static SumoCommand getCompleteRedYellowGreenDefinition(String tlsID)
tlsID
- a string identifying the traffic lightpublic static SumoCommand getIDCount()
public static SumoCommand getPhaseDuration(String tlsID)
tlsID
- a string identifying the traffic lightpublic static SumoCommand getControlledLanes(String tlsID)
tlsID
- a string identifying the traffic lightpublic static SumoCommand getControlledLinks(String tlsID)
tlsID
- a string identifying the traffic lightpublic static SumoCommand getControlledJunctions(String tlsID)
tlsID
- a string identifying the traffic lightpublic static SumoCommand getExternalState(String tlsID)
tlsID
- a string identifying the traffic lightpublic static SumoCommand getIDList()
public static SumoCommand getNextSwitch(String tlsID)
tlsID
- a string identifying the traffic lightpublic static SumoCommand getParameter(String tlsID, String param)
tlsID
- a string identifying the traffic lightparam
- a string identifying the parameterpublic static SumoCommand getPhase(String tlsID)
tlsID
- a string identifying the traffic lightpublic static SumoCommand getProgram(String tlsID)
tlsID
- a string identifying the traffic lightpublic static SumoCommand getRedYellowGreenState(String tlsID)
tlsID
- a string identifying the traffic lightpublic static SumoCommand setCompleteRedYellowGreenDefinition(String tlsID, SumoTLSProgram tls)
tlsID
- a string identifying the traffic lighttls
- complete program definitionpublic static SumoCommand setPhase(String tlsID, int index)
tlsID
- a string identifying the traffic lightindex
- an integer identifying the phase (it must be between 0 and the number of phases known to the current program of the tls - 1)public static SumoCommand setPhaseDuration(String tlsID, int phaseDuration)
tlsID
- a string identifying the traffic lightphaseDuration
- remaining duration of the current phasepublic static SumoCommand setProgram(String tlsID, String programID)
tlsID
- a string identifying the traffic lightprogramID
- a string identifying the programpublic static SumoCommand setRedYellowGreenState(String tlsID, String state)
tlsID
- a string identifying the traffic lightstate
- as a tuple of light definitions from rRgGyYoO, for red, green, yellow, off, where lower case letters mean that the stream has to decelerate