37 #ifdef CHECK_MEMORY_LEAKS
39 #endif // CHECK_MEMORY_LEAKS
46 SUMOTime intermediateTime,
bool phaseDefined)
47 : myName(name), myCycleTime(cycleTime), myOffset(offset),
48 myIntermediateTime(intermediateTime), myPhaseDefined(phaseDefined)
53 for (std::map<std::string, Phase*>::iterator i =
myPhases.begin(); i !=
myPhases.end(); ++i) {
82 for (std::vector<NBNode*>::iterator ni =
myNodes.begin(); ni !=
myNodes.end(); ni++) {
90 std::string groupName = (*gi).first;
97 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.
void build(NBTrafficLightLogicCont &tlc)
build the traffic light and add it to the given container
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.
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.
const std::string & getID() const
Returns the id.
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
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.
void setCycleDuration(unsigned int cycleDur)
Sets the duration of a cycle.
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.
T get(const std::string &str) const
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.