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