20 #ifndef NBLoadedTLDef_h 21 #define NBLoadedTLDef_h 214 const std::vector<NBNode*>& junctions,
SUMOTime offset,
356 const std::string& state,
std::vector< double > getTimes(SUMOTime cycleDuration) const
Returns the times at which the signal switches.
void setSignalYellowTimes(const std::string &groupid, SUMOTime tRedYellow, SUMOTime tYellow)
Sets the times the light is yellow or red/yellow.
bool containsOutgoing(NBEdge *to) const
Returns whether this signal controls a connection where the given edge is the destination.
~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.
std::string buildPhaseState(int time) const
Builds the phase for a given time.
void sortPhases()
Sorts the phases.
void collectNodes()
Collects the nodes participating in this traffic light.
The base class for traffic light logic definitions.
bool containsConnection(NBEdge *from, NBEdge *to) const
Returns whether the given connection is controlled by this signal.
const NBConnection & getConnection(int pos) const
Returns the connection at the given index.
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.
int getLinkNo() const
Returns the number of links (connection) controlled by this signal.
NBLoadedTLDef(const NBEdgeCont &ec, const std::string &id, const std::vector< NBNode *> &junctions, SUMOTime offset, TrafficLightType type)
Constructor.
SignalGroupCont mySignalGroups
Controlled signal groups.
SignalGroup * findGroup(NBEdge *from, NBEdge *to) const
Returns the signal group which is responsible for the given connection.
PhaseDef(SUMOTime time, TLColor color)
Constructor.
void setTLControllingInformation() const
Informs edges about being controlled by a tls.
void setCycleDuration(int cycleDur)
Sets the duration of a cycle.
void setParticipantsInformation()
Builds the list of participating nodes/edges/links.
std::vector< PhaseDef > myPhases
The phases of this signal.
Storage for edges, including some functionality operating on multiple edges.
void remap(NBEdge *removed, int removedLane, NBEdge *by, int byLane)
Replaces a removed edge/lane.
void collectLinks()
Collects the links participating in this traffic light.
void addConnection(const NBConnection &c)
Inserts a controlled connection.
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.
void setYellowTimes(SUMOTime tRedYellowe, SUMOTime tYellow)
Sets the times for redyellow and yellow.
void initNeedsContRelation() const
void patchTYellow(int tyellow, bool forced)
Sets the yellow time.
SUMOTime myTRedYellow
The times of redyellow and yellow.
void addSignalGroup(const std::string &id)
Adds a signal group.
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
bool mayDrive(SUMOTime time) const
Returns whether vehicles on controlled links may drive at the given time.
Sorts phases by their begin time.
NBTrafficLightLogic * myCompute(int brakingTimeSeconds)
Computes the traffic light logic finally in dependence to the type.
bool containsIncoming(NBEdge *from) const
Returns whether this signal controls the given edge.
int myCycleDuration
The duration of a single cycle.
Represents a single node (junction) during network building.
bool mustBrake(const NBConnection &possProhibited, const std::string &state, int strmpos) const
Returns the information whether a connection must brake, given a phase.
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.
phase_by_time_sorter()
Constructor.
const NBEdgeCont * myEdgeCont
int operator()(const PhaseDef &p1, const PhaseDef &p2)
Sorts phases by their begin time.
bool hasYellow(SUMOTime time) const
Returns whether controlled links have yellow at the given time.