22 #ifndef NBTrafficLightDefinition_h 23 #define NBTrafficLightDefinition_h 107 const std::vector<NBNode*>& junctions,
108 const std::string& programID,
122 const std::string& programID,
208 bool regardNonSignalisedLowerPriority)
const;
220 const NBEdge*
const possProhibitorFrom,
const NBEdge*
const possProhibitorTo,
221 bool regardNonSignalisedLowerPriority)
const;
235 const NBEdge*
const possProhibitedFrom,
const NBEdge*
const possProhibitedTo,
236 bool regardNonSignalisedLowerPriority,
237 bool sameNodeOnly =
false)
const;
248 const NBEdge*
const from2,
const NBEdge*
const to2)
const;
286 NBEdge* by,
int byLane) = 0;
429 return (from1 == o.
from1 && to1 == o.
to1 430 && from2 == o.
from2 && to2 == o.
to2);
434 if (from1 != o.
from1) {
435 return from1 < o.
from1;
440 if (from2 != o.
from2) {
441 return from2 < o.
from2;
virtual void setParticipantsInformation()
Builds the list of participating nodes/edges/links.
StreamPair(const NBEdge *_from1, const NBEdge *_to1, const NBEdge *_from2, const NBEdge *_to2)
TrafficLightType myType
The algorithm type for the traffic light.
virtual void addNode(NBNode *node)
Adds a node to the traffic light logic.
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...
void collectAllLinks()
helper method for use in NBOwnTLDef and NBLoadedSUMOTLDef
static const std::string DummyID
id for temporary definitions
RightOnRedConflicts myRightOnRedConflicts
std::vector< std::string > getControlledInnerEdges() const
Retrieve the ids of edges explicitly controlled by the tls.
A SUMO-compliant built logic for a traffic light.
TrafficLightType getType() const
get the algorithm type (static etc..)
virtual void setTLControllingInformation() const =0
Informs edges about being controlled by a tls.
EdgeVector myIncomingEdges
The list of incoming edges.
virtual ~NBTrafficLightDefinition()
Destructor.
const std::string & getProgramID() const
Returns the ProgramID.
The representation of a single edge during network building.
Signal is blinking yellow.
NBTrafficLightLogic * compute(OptionsCont &oc)
Computes the traffic light logic.
The base class for traffic light logic definitions.
virtual void replaceRemoved(NBEdge *removed, int removedLane, NBEdge *by, int byLane)=0
Replaces a removed edge/lane.
static const SUMOTime UNSPECIFIED_DURATION
Signal shows red/yellow (unused)
std::set< std::pair< int, int > > RightOnRedConflicts
const EdgeVector & getIncomingEdges() const
Returns the list of incoming edges (must be build first)
TLColor
An enumeration of possible tl-signal states.
SUMOTime myOffset
The offset in the program.
#define UNUSED_PARAMETER(x)
NBConnectionVector & getControlledLinks()
returns the controlled links (non const version)
virtual void collectLinks()=0
Collects the links participating in this traffic light If a link could not be found.
std::set< StreamPair > NeedsContRelation
bool operator==(const StreamPair &o) const
SUMOTime getOffset()
Returns the offset.
virtual void collectEdges()
Build the list of participating edges.
int computeBrakingTime(double minDecel) const
Computes the time vehicles may need to brake.
std::set< std::string > myControlledInnerEdges
Set of inner edges that shall be controlled, though.
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.
const NBConnectionVector & getControlledLinks() const
returns the controlled links (depends on previous call to collectLinks)
virtual void shiftTLConnectionLaneIndex(NBEdge *edge, int offset)
patches (loaded) signal plans by modifying lane indices
virtual NBTrafficLightLogic * myCompute(int brakingTime)=0
Computes the traffic light logic finally in dependence to the type.
static const std::string DefaultProgramID
void setProgramID(const std::string &programID)
Sets the programID.
void addControlledInnerEdges(const std::vector< std::string > &edges)
Adds the given ids into the list of inner edges controlled by the tls.
bool mustBrake(const NBEdge *const from, const NBEdge *const to) const
Returns the information whether the described flow must let any other flow pass.
An upper class for objects with additional parameters.
const std::vector< NBNode * > & getNodes() const
Returns the list of controlled nodes.
virtual void removeNode(NBNode *node)
Removes the given node from the list of controlled nodes.
Base class for objects which have an id.
std::vector< NBConnection > NBConnectionVector
Definition of a connection vector.
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.
bool myRightOnRedConflictsReady
bool needsCont(const NBEdge *fromE, const NBEdge *toE, const NBEdge *otherFromE, const NBEdge *otherToE) const
bool myNeedsContRelationReady
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
A storage for options typed value containers)
NeedsContRelation myNeedsContRelation
Represents a single node (junction) during network building.
bool operator<(const StreamPair &o) const
data structure for caching needsCont information
std::vector< NBNode * > myControlledNodes
The container with participating nodes.
NBTrafficLightDefinition(const std::string &id, const std::vector< NBNode * > &junctions, const std::string &programID, SUMOTime offset, TrafficLightType type)
Constructor.
virtual bool amInvalid() const
static std::set< NBEdge * > collectReachable(EdgeVector outer, const EdgeVector &within, bool checkControlled)
NBConnectionVector myControlledLinks
The list of controlled links.
EdgeVector myEdgesWithin
The list of edges within the area controlled by the tls.
virtual void setType(TrafficLightType type)
set the algorithm type (static etc..)
std::string mySubID
The tls program's subid.
virtual bool rightOnRedConflict(int index, int foeIndex) const
whether the given index must yield to the foeIndex while turing right on a red light ...
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 void initNeedsContRelation() const