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