 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
18 #ifndef NBTrafficLightDefinition_h
19 #define NBTrafficLightDefinition_h
99 const std::vector<NBNode*>& junctions,
100 const std::string& programID,
114 const std::string& programID,
200 bool regardNonSignalisedLowerPriority)
const;
212 const NBEdge*
const possProhibitorFrom,
const NBEdge*
const possProhibitorTo,
213 bool regardNonSignalisedLowerPriority)
const;
227 const NBEdge*
const possProhibitedFrom,
const NBEdge*
const possProhibitedTo,
228 bool regardNonSignalisedLowerPriority,
229 bool sameNodeOnly =
false)
const;
240 const NBEdge*
const from2,
const NBEdge*
const to2)
const;
278 NBEdge* by,
int byLane) = 0;
data structure for caching needsCont information
#define UNUSED_PARAMETER(x)
virtual ~NBTrafficLightDefinition()
Destructor.
virtual void shiftTLConnectionLaneIndex(NBEdge *edge, int offset, int threshold=-1)
patches (loaded) signal plans by modifying lane indices
NBTrafficLightLogic * compute(OptionsCont &oc)
Computes the traffic light logic.
std::vector< std::string > getControlledInnerEdges() const
Retrieve the ids of edges explicitly controlled by the tls.
virtual void initNeedsContRelation() const
An upper class for objects with additional parameters.
virtual int getMaxValidIndex()
Returns the maximum index controlled by this traffic light.
Base class for objects which have an id.
std::set< std::pair< int, int > > RightOnRedConflicts
virtual void setTLControllingInformation() const =0
Informs edges about being controlled by a tls.
virtual void replaceRemoved(NBEdge *removed, int removedLane, NBEdge *by, int byLane)=0
Replaces a removed edge/lane.
std::string mySubID
The tls program's subid.
std::vector< NBNode * > myControlledNodes
The container with participating nodes.
bool operator<(const StreamPair &o) const
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
NBConnectionVector myControlledLinks
The list of controlled links.
virtual bool rightOnRedConflict(int index, int foeIndex) const
whether the given index must yield to the foeIndex while turning right on a red light
std::set< StreamPair > NeedsContRelation
virtual bool usingSignalGroups() const
whether this definition uses signal group (multiple connections with the same link index)
bool mustBrake(const NBEdge *const from, const NBEdge *const to) const
Returns the information whether the described flow must let any other flow pass.
SUMOTime myOffset
The offset in the program.
virtual void collectLinks()=0
Collects the links participating in this traffic light.
static const std::string DummyID
id for temporary definitions
SUMOTime getOffset()
Returns the offset.
TrafficLightType myType
The algorithm type for the traffic light.
virtual void collectEdges()
Build the list of participating edges.
void setProgramID(const std::string &programID)
Sets the programID.
The representation of a single edge during network building.
virtual int getMaxIndex()=0
Returns the maximum index controlled by this traffic light and assigned to a connection.
Signal shows red/yellow (unused)
RightOnRedConflicts myRightOnRedConflicts
void addControlledInnerEdges(const std::vector< std::string > &edges)
Adds the given ids into the list of inner edges controlled by the tls.
virtual NBTrafficLightLogic * myCompute(int brakingTime)=0
Computes the traffic light logic finally in dependence to the type.
TrafficLightType getType() const
get the algorithm type (static etc..)
Signal is blinking yellow.
static const SUMOTime UNSPECIFIED_DURATION
TLColor
An enumeration of possible tl-signal states.
const NBConnectionVector & getControlledLinks() const
returns the controlled links (depends on previous call to collectLinks)
bool myRightOnRedConflictsReady
StreamPair(const NBEdge *_from1, const NBEdge *_to1, const NBEdge *_from2, const NBEdge *_to2)
int computeBrakingTime(double minDecel) const
Computes the time vehicles may need to brake.
const EdgeVector & getIncomingEdges() const
Returns the list of incoming edges (must be build first)
const std::vector< NBNode * > & getNodes() const
Returns the list of controlled nodes.
NeedsContRelation myNeedsContRelation
bool needsCont(const NBEdge *fromE, const NBEdge *toE, const NBEdge *otherFromE, const NBEdge *otherToE) const
A storage for options typed value containers)
bool myNeedsContRelationReady
NBConnectionVector & getControlledLinks()
returns the controlled links (non const version)
EdgeVector myEdgesWithin
The list of edges within the area controlled by the tls.
NBTrafficLightDefinition(const std::string &id, const std::vector< NBNode * > &junctions, const std::string &programID, SUMOTime offset, TrafficLightType type)
Constructor.
bool operator==(const StreamPair &o) const
virtual void remapRemoved(NBEdge *removed, const EdgeVector &incoming, const EdgeVector &outgoing)=0
Replaces occurences of the removed edge in incoming/outgoing edges of all definitions.
static std::set< NBEdge * > collectReachable(EdgeVector outer, const EdgeVector &within, bool checkControlled)
std::string getDescription() const
get ID and programID together (for convenient debugging)
std::set< std::string > myControlledInnerEdges
Set of inner edges that shall be controlled, though.
bool foes(const NBEdge *const from1, const NBEdge *const to1, const NBEdge *const from2, const NBEdge *const to2) const
Returns the information whether the given flows cross.
static const std::string DefaultProgramID
virtual void setParticipantsInformation()
Builds the list of participating nodes/edges/links.
std::vector< NBConnection > NBConnectionVector
Definition of a connection vector.
const std::string & getProgramID() const
Returns the ProgramID.
virtual void addNode(NBNode *node)
Adds a node to the traffic light logic.
virtual void removeNode(NBNode *node)
Removes the given node from the list of controlled nodes.
virtual void setType(TrafficLightType type)
set the algorithm type (static etc..)
A SUMO-compliant built logic for a traffic light.
Represents a single node (junction) during network building.
EdgeVector myIncomingEdges
The list of incoming edges.
void collectAllLinks()
helper method for use in NBOwnTLDef and NBLoadedSUMOTLDef
virtual 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 forbids(const NBEdge *const possProhibitorFrom, const NBEdge *const possProhibitorTo, const NBEdge *const possProhibitedFrom, const NBEdge *const possProhibitedTo, bool regardNonSignalisedLowerPriority, bool sameNodeOnly=false) const
Returns the information whether "prohibited" flow must let "prohibitor" flow pass.
The base class for traffic light logic definitions.
virtual bool amInvalid() const