181 const std::vector<NBNode*>& junctions,
SUMOTime offset,
319 const std::string& state,
331 NBEdge* by,
int byLane,
bool incoming);
std::vector< NBConnection > NBConnectionVector
Definition of a connection vector.
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
Storage for edges, including some functionality operating on multiple edges.
The representation of a single edge during network building.
Definition of a single, loaded phase.
PhaseDef(SUMOTime time, TLColor color)
Constructor.
TLColor myColor
A signal's color from this time.
SUMOTime myTime
The begin time of this phase.
A single signal group, may control several connections.
void remapOutgoing(NBEdge *which, const EdgeVector &by)
Replaces the given outgoing edge by the others given.
NBConnectionVector myConnections
Connections controlled by this signal.
void addPhaseBegin(SUMOTime time, TLColor color)
Sets the begin of a phase.
void addConnection(const NBConnection &c)
Inserts a controlled connection.
SUMOTime myTRedYellow
The times of redyellow and yellow.
std::vector< SUMOTime > getTimes(SUMOTime cycleDuration) const
Returns the times at which the signal switches.
bool mayDrive(SUMOTime time) const
Returns whether vehicles on controlled links may drive at the given time.
std::vector< PhaseDef > myPhases
The phases of this signal.
void patchTYellow(SUMOTime tyellow, bool forced)
Sets the yellow time.
bool hasYellow(SUMOTime time) const
Returns whether controlled links have yellow at the given time.
const NBConnection & getConnection(int pos) const
Returns the connection at the given index.
void remap(NBEdge *removed, int removedLane, NBEdge *by, int byLane)
Replaces a removed edge/lane.
bool containsIncoming(NBEdge *from) const
Returns whether this signal controls the given edge.
void setYellowTimes(SUMOTime tRedYellowe, SUMOTime tYellow)
Sets the times for redyellow and yellow.
void sortPhases()
Sorts the phases.
~SignalGroup()
Destructor.
bool containsOutgoing(NBEdge *to) const
Returns whether this signal controls a connection where the given edge is the destination.
void remapIncoming(NBEdge *which, const EdgeVector &by)
Replaces the given incoming edge by the others given.
int getLinkNo() const
Returns the number of links (connection) controlled by this signal.
A loaded (complete) traffic light logic.
void setParticipantsInformation()
Builds the list of participating nodes/edges/links.
void collectNodes()
Collects the nodes participating in this traffic light.
void replaceRemoved(NBEdge *removed, int removedLane, NBEdge *by, int byLane, bool incoming)
Replaces a removed edge/lane.
bool addToSignalGroup(const std::string &groupid, const NBConnection &connection)
Adds a connection to a signal group.
int getMaxIndex()
Returns the maximum index controlled by this traffic light.
std::string buildPhaseState(const SUMOTime time) const
Builds the phase for a given time.
~NBLoadedTLDef()
Destructor.
void addSignalGroupPhaseBegin(const std::string &groupid, SUMOTime time, TLColor color)
Sets the information about the begin of a phase.
SUMOTime myCycleDuration
The duration of a single cycle.
const NBEdgeCont * myEdgeCont
void setSignalYellowTimes(const std::string &groupid, SUMOTime tRedYellow, SUMOTime tYellow)
Sets the times the light is yellow or red/yellow.
std::map< std::string, SignalGroup * > SignalGroupCont
Definition of the container for signal groups.
void addSignalGroup(const std::string &id)
Adds a signal group.
void setCycleDuration(SUMOTime cycleDur)
Sets the duration of a cycle.
SignalGroupCont mySignalGroups
Controlled signal groups.
NBTrafficLightLogic * myCompute(int brakingTimeSeconds)
Computes the traffic light logic finally in dependence to the type.
void setTLControllingInformation() const
Informs edges about being controlled by a tls.
void collectLinks()
Collects the links participating in this traffic light.
bool mustBrake(const NBConnection &possProhibited, const std::string &state, int strmpos) const
Returns the information whether a connection must brake, given a phase.
void initNeedsContRelation() const
void remapRemoved(NBEdge *removed, const EdgeVector &incoming, const EdgeVector &outgoing)
Replaces occurrences of the removed edge in incoming/outgoing edges of all definitions.
Represents a single node (junction) during network building.
The base class for traffic light logic definitions.
TLColor
An enumeration of possible tl-signal states.
A SUMO-compliant built logic for a traffic light.
Base class for objects which have an id.