 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
19 #ifndef NBLoadedSUMOTLDef_h
20 #define NBLoadedSUMOTLDef_h
void reconstructLogic()
adapt to removal or addition of connections
NBTrafficLightLogic * myTLLogic
phases are added directly to myTLLogic which is then returned in myCompute()
void collectEdgeVectors(EdgeVector &fromEdges, EdgeVector &toEdges, std::vector< int > &fromLanes) const
Collects the edges for each tlIndex.
void removeConnection(const NBConnection &conn, bool reconstruct=true)
removes the given connection from the traffic light if recontruct=true, reconstructs the logic and in...
bool hasValidIndices() const
return whether all tls link indices are valid
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
~NBLoadedSUMOTLDef()
Destructor.
connection_equal & operator=(const connection_equal &s)
invalidated assignment operator
NBEdge * getFrom() const
returns the from-edge (start of the connection)
void guessMinMaxDuration()
heuristically add minDur and maxDur when switching from tlType fixed to actuated
NBEdge * getTo() const
returns the to-edge (end of the connection)
void addPhase(SUMOTime duration, const std::string &state, SUMOTime minDur, SUMOTime maxDur, const std::vector< int > &next, const std::string &name)
Adds a phase to the logic the new phase is inserted at the end of the list of already added phases.
class for identifying connections
void setOffset(SUMOTime offset)
Sets the offset of this tls.
NBTrafficLightLogic * getLogic()
Returns the internal logic.
int getMaxIndex()
return the highest known tls link index used by any controlled connection or crossing
void initNeedsContRelation() const
void registerModifications(bool addedConnections, bool removedConnections)
register changes that necessitate recomputation
The representation of a single edge during network building.
void addConnection(NBEdge *from, NBEdge *to, int fromLane, int toLane, int linkIndex, bool reconstruct=true)
Adds a connection and immediately informs the edges.
std::set< NBNode * > myOriginalNodes
The original nodes for which the loaded logic is valid.
bool rightOnRedConflict(int index, int foeIndex) const
whether the given index must yield to the foeIndex while turing right on a red light
void collectLinks()
Collects the links participating in this traffic light (only if not previously loaded)
bool myReconstructAddedConnections
whether the logic must be reconstructed
int getToLane() const
returns the to-lane
void phasesLoaded()
mark phases as load
std::set< NBEdge * > myShifted
set of edges with shifted lane indices (to avoid shifting twice)
void replaceRemoved(NBEdge *removed, int removedLane, NBEdge *by, int byLane)
Replaces a removed edge/lane.
int getMaxValidIndex()
Returns the maximum index controlled by this traffic light.
NBTrafficLightLogic * myCompute(int brakingTimeSeconds)
Computes the traffic light logic finally in dependence to the type.
bool myReconstructRemovedConnections
void remapRemoved(NBEdge *removed, const EdgeVector &incoming, const EdgeVector &outgoing)
Replaces occurences of the removed edge in incoming/outgoing edges of all definitions.
NBLoadedSUMOTLDef(const std::string &id, const std::string &programID, SUMOTime offset, TrafficLightType type)
Constructor.
void patchIfCrossingsAdded()
repair the plan if controlled nodes received pedestrian crossings
bool operator()(const NBConnection &c) const
A SUMO-compliant built logic for a traffic light.
connection_equal(const NBConnection &c)
constructor
int getFromLane() const
returns the from-lane
void joinLogic(NBTrafficLightDefinition *def)
join nodes and states from the given logic (append red state)
void setTLControllingInformation() const
Informs edges about being controlled by a tls.
The base class for traffic light logic definitions.
void collectEdges()
Build the list of participating edges.
bool usingSignalGroups() const
whether this definition uses signal group (multiple connections with the same link index)
void setType(TrafficLightType type)
Sets the algorithm type of this tls.
void shiftTLConnectionLaneIndex(NBEdge *edge, int offset, int threshold=-1)
patches signal plans by modifying lane indices with the given offset, only indices with a value above...
A loaded (complete) traffic light logic.