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