 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
38 SUMOTime intermediateTime,
bool phaseDefined)
39 : myName(name), myCycleTime(cycleTime), myOffset(offset),
40 myIntermediateTime(intermediateTime), myPhaseDefined(phaseDefined) {
45 for (std::map<std::string, Phase*>::iterator i =
myPhases.begin(); i !=
myPhases.end(); ++i) {
74 for (std::vector<NBNode*>::iterator ni =
myNodes.begin(); ni !=
myNodes.end(); ni++) {
76 if (node ==
nullptr) {
86 std::string groupName = (*gi).first;
93 for (std::map<std::string, Phase*>::iterator pi = SG.
phases().begin(); pi != SG.
phases().end(); pi++) {
SUMOTime myCycleTime
The cycle time of traffic light in seconds.
#define WRITE_WARNING(msg)
Storage for edges, including some functionality operating on multiple edges.
std::vector< NBNode * > myNodes
Vector of nodes belonging to this traffic light.
@ TLCOLOR_RED
Signal shows red.
SignalGroup & getSignalGroup(const std::string &name)
Returns the named signal group.
A container for traffic light definitions and built programs.
void addSignalGroup(const std::string &id)
Adds a signal group.
SUMOTime getStartTime()
Returns the stored start time.
static OptionsCont & getOptions()
Retrieves the options.
void addSignalGroupPhaseBegin(const std::string &groupid, SUMOTime time, TLColor color)
Sets the information about the begin of a phase.
void addSignalGroup(const std::string &name, SUMOTime startTime, SUMOTime endTime, SUMOTime yellowTime)
Adds a signal group.
SUMOTime getYellowTime()
Returns the stored yellow time.
void setCycleDuration(int cycleDur)
Sets the duration of a cycle.
A signal group can be defined either by a time period or by phases.
NBConnectionVector & connections()
Returns the connections vector.
bool myPhaseDefined
Toogles the usage either of phases or of time periods in signal groups.
T get(const std::string &str) const
SUMOTime myOffset
The offset in the plan.
void setSignalYellowTimes(const std::string &groupid, SUMOTime tRedYellow, SUMOTime tYellow)
Sets the times the light is yellow or red/yellow.
void addPhase(const std::string &name, SUMOTime startTime, SUMOTime endTime, SUMOTime yellowTime)
Adds a phase.
SUMOTime myIntermediateTime
The all-red time (unused here)
NIVisumTL(const std::string &name, SUMOTime cycleTime, SUMOTime offset, SUMOTime intermediateTime, bool phaseDefined)
Constructor.
A loaded (complete) traffic light logic.
static StringBijection< TrafficLightType > TrafficLightTypes
traffic light types
std::map< std::string, SignalGroup * > mySignalGroups
Map of used signal groups.
std::string myName
The name of traffic light.
std::map< std::string, Phase * > & phases()
Returns the phases map.
Represents a single node (junction) during network building.
bool insert(NBTrafficLightDefinition *logic, bool forceInsert=false)
Adds a logic definition to the dictionary.
SUMOTime getEndTime()
Returns the stored end time.
void build(NBEdgeCont &ec, NBTrafficLightLogicCont &tlc)
build the traffic light and add it to the given container
const std::string & getID() const
Returns the id.
std::map< std::string, Phase * > myPhases
Map of used phases if phases defined.
bool addToSignalGroup(const std::string &groupid, const NBConnection &connection)
Adds a connection to a signal group.
@ TLCOLOR_GREEN
Signal shows green.