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