traci.trafficlights
index
/build/buildd/sumo-0.21.0+dfsg/tools/traci/trafficlights.py

@file    trafficlights.py
@author  Michael Behrisch
@date    2011-03-16
@version $Id: trafficlights.py 15692 2014-02-22 09:17:02Z behrisch $
 
Python implementation of the TraCI interface.
 
SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
Copyright (C) 2011-2014 DLR (http://www.dlr.de/) and contributors
 
This file is part of SUMO.
SUMO is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.

 
Modules
       
struct
traci.constants
traci

 
Classes
       
Logic
Phase

 
class Logic
     Methods defined here:
__init__(self, subID, type, subParameter, currentPhaseIndex, phases)
__repr__(self)

 
class Phase
     Methods defined here:
__init__(self, duration, duration1, duration2, phaseDef)
__repr__(self)

 
Functions
       
getCompleteRedYellowGreenDefinition(tlsID)
getCompleteRedYellowGreenDefinition(string) -> 
 
.
getContextSubscriptionResults(tlsID=None)
getControlledLanes(tlsID)
getControlledLanes(string) -> c
 
Returns the list of lanes which are controlled by the named traffic light.
getControlledLinks(tlsID)
getControlledLinks(string) -> list(list(list(string)))
 
Returns the links controlled by the traffic light, sorted by the signal index and described by giving the incoming, outgoing, and via lane.
getIDCount()
getIDCount() -> integer
 
Returns the number of traffic lights in the network.
getIDList()
getIDList() -> list(string)
 
Returns a list of ids of all traffic lights within the scenario.
getNextSwitch(tlsID)
getNextSwitch(string) -> integer
 
.
getPhase(tlsID)
getPhase(string) -> integer
 
.
getPhaseDuration(tlsID)
getPhaseDuration(string) -> integer
 
.
getProgram(tlsID)
getProgram(string) -> string
 
Returns the id of the current program.
getRedYellowGreenState(tlsID)
getRedYellowGreenState(string) -> string
 
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.
getSubscriptionResults(tlsID=None)
getSubscriptionResults(string) -> dict(integer: <value_type>)
 
Returns the subscription results for the last time step and the given traffic light.
If no traffic light id is given, all subscription results are returned in a dict.
If the traffic light id is unknown or the subscription did for any reason return no data,
'None' is returned.
It is not possible to retrieve older subscription results than the ones
from the last time step.
setCompleteRedYellowGreenDefinition(tlsID, tls)
setCompleteRedYellowGreenDefinition(string, ) -> None
 
.
setPhase(tlsID, index)
setPhase(string, integer) -> None
 
.
setPhaseDuration(tlsID, phaseDuration)
setProgram(tlsID, programID)
setProgram(string, string) -> None
 
Sets the id of the current program.
setRedYellowGreenState(tlsID, state)
setRedYellowGreenState(string, string) -> None
 
Sets 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.
subscribe(tlsID, varIDs=(40,), begin=0, end=2147483647L)
subscribe(string, list(integer), double, double) -> None
 
Subscribe to one or more traffic light values for the given interval.
subscribeContext(tlsID, domain, dist, varIDs=(40,), begin=0, end=2147483647L)

 
Data
        subscriptionResults = <{}, {}>