 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
55 const std::vector<NBNode*>& junctions,
111 const std::vector<NBNode::Crossing*>& crossings,
const EdgeVector& fromEdges,
const EdgeVector& toEdges);
116 std::string state,
const std::vector<NBNode::Crossing*>& crossings,
const EdgeVector& fromEdges,
const EdgeVector& toEdges);
120 const std::vector<NBNode::Crossing*>& crossings,
const EdgeVector& fromEdges,
const EdgeVector& toEdges);
215 static bool hasCrossing(
const NBEdge* from,
const NBEdge* to,
const std::vector<NBNode::Crossing*>& crossings);
223 const std::vector<int>& fromLanes,
const std::vector<int>& toLanes);
230 const std::vector<int>& fromLanes,
const std::vector<int>& toLanes);
233 const std::vector<bool>& isTurnaround,
234 const std::vector<NBNode::Crossing*>& crossings);
253 const std::vector<bool>& isTurnaround,
254 const std::vector<int>& fromLanes,
255 const std::vector<bool>& hadGreenMajor,
256 bool& haveForbiddenLeftMover, std::vector<bool>& rightTurnConflicts);
void replaceRemoved(NBEdge *removed, int removedLane, NBEdge *by, int byLane)
Replaces a removed edge/lane.
static EdgeVector getConnectedOuterEdges(const EdgeVector &incoming)
get edges that have connections
NBOwnTLDef(const std::string &id, const std::vector< NBNode * > &junctions, SUMOTime offset, TrafficLightType type)
Constructor.
void initNeedsContRelation() const
static std::string addPedestrianPhases(NBTrafficLightLogic *logic, SUMOTime greenTime, SUMOTime minDur, SUMOTime maxDur, std::string state, const std::vector< NBNode::Crossing * > &crossings, const EdgeVector &fromEdges, const EdgeVector &toEdges)
add 1 or 2 phases depending on the presence of pedestrian crossings
Sorts edges by their priority within the node they end at.
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
void buildAllRedState(SUMOTime allRedTime, NBTrafficLightLogic *logic, const std::string &state)
static void addPedestrianScramble(NBTrafficLightLogic *logic, int noLinksAll, SUMOTime greenTime, SUMOTime yellowTime, const std::vector< NBNode::Crossing * > &crossings, const EdgeVector &fromEdges, const EdgeVector &toEdges)
add an additional pedestrian phase if there are crossings that did not get green yet
A traffic light logics which must be computed (only nodes/edges are given)
std::string allowSingleEdge(std::string state, const EdgeVector &fromEdges)
static bool hasCrossing(const NBEdge *from, const NBEdge *to, const std::vector< NBNode::Crossing * > &crossings)
compute whether the given connection is crossed by pedestrians
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)....
std::string allowCompatible(std::string state, const EdgeVector &fromEdges, const EdgeVector &toEdges, const std::vector< int > &fromLanes, const std::vector< int > &toLanes)
allow connections that are compatible with the chosen edges
void collectLinks()
Collects the links participating in this traffic light.
std::string allowUnrelated(std::string state, const EdgeVector &fromEdges, const EdgeVector &toEdges, const std::vector< bool > &isTurnaround, const std::vector< NBNode::Crossing * > &crossings)
The representation of a single edge during network building.
NBNode * getToNode() const
Returns the destination node of the edge.
bool corridorLike() const
test whether a joined tls with layout 'opposites' would be built without dedicated left-turn phase
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
void remapRemoved(NBEdge *removed, const EdgeVector &incoming, const EdgeVector &outgoing)
Replaces occurences of the removed edge in incoming/outgoing edges of all definitions.
void setSinglePhase()
Forces the definition not to compute an additional phase for left-movers.
bool forbidden(const std::string &state, int index, const EdgeVector &fromEdges, const EdgeVector &toEdges)
whether the given index is forbidden by a green link in the current state
int operator()(const NBEdge *const e1, const NBEdge *const e2) const
comparing operator
std::pair< NBEdge *, NBEdge * > getBestPair(EdgeVector &incoming)
Returns the combination of two edges from the given which has most unblocked streams.
int getToPrio(const NBEdge *const e)
Returns this edge's priority at the node it ends at.
double getDirectionalWeight(LinkDirection dir)
Returns the weight of a stream given its direction.
NBTrafficLightLogic * computeLogicAndConts(int brakingTimeSeconds, bool onlyConts=false)
helper function for myCompute
static std::string patchStateForCrossings(const std::string &state, const std::vector< NBNode::Crossing * > &crossings, const EdgeVector &fromEdges, const EdgeVector &toEdges)
compute phase state in regard to pedestrian crossings
int getJunctionPriority(const NBNode *const node) const
Returns the junction priority (normalised for the node currently build)
std::string allowByVClass(std::string state, const EdgeVector &fromEdges, const EdgeVector &toEdges, SVCPermissions perm)
double computeUnblockedWeightedStreamNumber(const NBEdge *const e1, const NBEdge *const e2)
Returns how many streams outgoing from the edges can pass the junction without being blocked.
std::string correctConflicting(std::string state, const EdgeVector &fromEdges, const EdgeVector &toEdges, const std::vector< bool > &isTurnaround, const std::vector< int > &fromLanes, const std::vector< bool > &hadGreenMajor, bool &haveForbiddenLeftMover, std::vector< bool > &rightTurnConflicts)
change 'G' to 'g' for conflicting connections
std::string allowFollowers(std::string state, const EdgeVector &fromEdges, const EdgeVector &toEdges)
A SUMO-compliant built logic for a traffic light.
Represents a single node (junction) during network building.
void setTLControllingInformation() const
Informs edges about being controlled by a tls.
bool myHaveSinglePhase
Whether left-mover should not have an additional phase.
std::pair< NBEdge *, NBEdge * > getBestCombination(const EdgeVector &edges)
Returns the combination of two edges from the given which has most unblocked streams.
NBTrafficLightLogic * myCompute(int brakingTimeSeconds)
Computes the traffic light logic finally in dependence to the type.
void checkCustomCrossingIndices(NBTrafficLightLogic *logic) const
fix states in regard to custom crossing indices
The base class for traffic light logic definitions.
int getMaxIndex()
Returns the maximum index controlled by this traffic light.
std::string allowPredecessors(std::string state, const EdgeVector &fromEdges, const EdgeVector &toEdges, const std::vector< int > &fromLanes, const std::vector< int > &toLanes)
const std::string & getID() const