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