Eclipse SUMO - Simulation of Urban MObility
MSRailSignal::DriveWay Struct Reference

#include <MSRailSignal.h>

Collaboration diagram for MSRailSignal::DriveWay:
[legend]

Public Member Functions

void buildRoute (MSLink *origin, double length, MSRouteIterator next, MSRouteIterator end, LaneVisitedMap &visited)
 
void checkCrossingFlanks (MSLink *dwLink, const LaneVisitedMap &visited, std::vector< MSLink * > &flankSwitches) const
 
void checkFlanks (const MSLink *originLink, const std::vector< const MSLane * > &lanes, const LaneVisitedMap &visited, bool allFoes, std::vector< MSLink * > &flankSwitches) const
 
bool conflictLaneOccupied (const std::string &joinVehicle="", bool store=true, const SUMOVehicle *ego=nullptr) const
 whether any of myConflictLanes is occupied (vehicles that are the target of a join must be ignored) More...
 
bool conflictLinkApproached () const
 Whether any of the conflict links have approaching vehicles. More...
 
bool deadlockLaneOccupied (bool store=true) const
 whether any of myBidiExtended is occupied by a vehicle that targets myBidi More...
 
 DriveWay (bool temporary=false)
 Constructor. More...
 
void findFlankProtection (MSLink *link, double length, LaneVisitedMap &visited, MSLink *origLink, std::vector< const MSLane * > &flank)
 
bool findProtection (const Approaching &veh, MSLink *link) const
 find protection for the given vehicle starting at a switch More...
 
bool flankConflict (const DriveWay &other) const
 Wether there is a flank conflict with the given driveway. More...
 
bool hasLinkConflict (const Approaching &closest, MSLink *foeLink) const
 Whether the approaching vehicle is prevent from driving by another vehicle approaching the given link. More...
 
bool overlap (const DriveWay &other) const
 Wether this driveway (route) overlaps with the given one. More...
 
bool reserve (const Approaching &closest, MSEdgeVector &occupied)
 attempt reserve this driveway for the given vehicle More...
 
void writeBlocks (OutputDevice &od) const
 Write block items for this driveway. More...
 

Static Public Member Functions

static bool mustYield (const Approaching &veh, const Approaching &foe)
 Whether veh must yield to the foe train. More...
 

Data Fields

const SUMOVehiclemyActive
 whether the current signal is switched green for a train approaching this block More...
 
std::vector< const MSLane * > myBidi
 
std::vector< const MSLane * > myBidiExtended
 
std::vector< const MSLane * > myConflictLanes
 the lanes that must be clear of trains before this signal can switch to green More...
 
std::vector< MSLink * > myConflictLinks
 
int myCoreSize
 number of edges in myRoute where overlap with other driveways is forbidden More...
 
std::vector< const MSLane * > myFlank
 
std::vector< MSLink * > myFlankSwitches
 
std::vector< const MSLane * > myForward
 
bool myFoundReversal
 
bool myFoundSignal
 whether this driveway ends its forward section with a rail signal (and thus comprises a full block) More...
 
double myMaxFlankLength
 the maximum flank length searched while building this driveway More...
 
int myNumericalID
 global driveway index More...
 
const MSEdgemyProtectedBidi
 switch assumed safe from bidi-traffic More...
 
std::vector< MSLink * > myProtectingSwitches
 
std::vector< MSLink * > myProtectingSwitchesBidi
 subset of myProtectingSwitches that protects from oncoming trains More...
 
std::vector< const MSEdge * > myRoute
 list of edges for matching against train routes More...
 

Detailed Description

Definition at line 265 of file MSRailSignal.h.

Constructor & Destructor Documentation

◆ DriveWay()

MSRailSignal::DriveWay::DriveWay ( bool  temporary = false)
inline

Constructor.

Definition at line 268 of file MSRailSignal.h.

Member Function Documentation

◆ buildRoute()

◆ checkCrossingFlanks()

void MSRailSignal::DriveWay::checkCrossingFlanks ( MSLink dwLink,
const LaneVisitedMap visited,
std::vector< MSLink * > &  flankSwitches 
) const

◆ checkFlanks()

void MSRailSignal::DriveWay::checkFlanks ( const MSLink originLink,
const std::vector< const MSLane * > &  lanes,
const LaneVisitedMap visited,
bool  allFoes,
std::vector< MSLink * > &  flankSwitches 
) const

Definition at line 1367 of file MSRailSignal.cpp.

References MSRailSignal::formatVisitedMap(), MSLane::getBidiLane(), MSLink::getCorrespondingExitLink(), MSLink::getDirection(), Named::getID(), Named::getIDSecure(), MSLane::getIncomingLanes(), MSLink::getLane(), MSLink::getLaneBefore(), MSLane::getLinkTo(), MSLane::isInternal(), toString(), TURN, and TURN_LEFTHAND.

Referenced by MSRailSignal::LinkInfo::buildDriveWay().

Here is the caller graph for this function:

◆ conflictLaneOccupied()

bool MSRailSignal::DriveWay::conflictLaneOccupied ( const std::string &  joinVehicle = "",
bool  store = true,
const SUMOVehicle ego = nullptr 
) const

whether any of myConflictLanes is occupied (vehicles that are the target of a join must be ignored)

Definition at line 954 of file MSRailSignal.cpp.

References gDebugFlag4, Named::getID(), Named::getIDSecure(), MSBaseVehicle::getNextStopParameter(), MSBaseVehicle::isStopped(), SUMOVehicleParameter::Stop::join, MSRailSignal::myBlockingVehicles, MSRailSignal::myStoreVehicles, SIMTIME, and toString().

Referenced by hasLinkConflict(), and MSRailSignal::updateCurrentPhase().

Here is the caller graph for this function:

◆ conflictLinkApproached()

bool MSRailSignal::DriveWay::conflictLinkApproached ( ) const

Whether any of the conflict links have approaching vehicles.

Definition at line 849 of file MSRailSignal.cpp.

References gDebugFlag4, and SIMTIME.

Referenced by MSRailSignal::updateCurrentPhase().

Here is the caller graph for this function:

◆ deadlockLaneOccupied()

bool MSRailSignal::DriveWay::deadlockLaneOccupied ( bool  store = true) const

whether any of myBidiExtended is occupied by a vehicle that targets myBidi

Definition at line 1007 of file MSRailSignal.cpp.

References MSRoute::end(), gDebugFlag4, MSBaseVehicle::getCurrentRouteEdge(), Named::getID(), MSBaseVehicle::getRoute(), MSRailSignal::myBlockingVehicles, and MSRailSignal::myStoreVehicles.

Referenced by hasLinkConflict().

Here is the caller graph for this function:

◆ findFlankProtection()

void MSRailSignal::DriveWay::findFlankProtection ( MSLink link,
double  length,
LaneVisitedMap visited,
MSLink origLink,
std::vector< const MSLane * > &  flank 
)

◆ findProtection()

bool MSRailSignal::DriveWay::findProtection ( const Approaching veh,
MSLink link 
) const

find protection for the given vehicle starting at a switch

Definition at line 1050 of file MSRailSignal.cpp.

References MSRailSignal::describeLinks(), findFlankProtection(), gDebugFlag4, MSLink::getApproaching(), MSRailSignal::getClosest(), MSLink::getDescription(), Named::getIDSecure(), MSLane::getIncomingLanes(), MSLink::getLane(), MSLink::getLaneBefore(), MSLane::getLinkCont(), myConflictLanes, myConflictLinks, myCoreSize, myFlank, myProtectingSwitches, myRoute, reserve(), SIMTIME, and toString().

Referenced by MSRailSignal::hasOncomingRailTraffic().

Here is the caller graph for this function:

◆ flankConflict()

bool MSRailSignal::DriveWay::flankConflict ( const DriveWay other) const

Wether there is a flank conflict with the given driveway.

Definition at line 1129 of file MSRailSignal.cpp.

References myBidi, and myForward.

Referenced by MSRailSignalControl::recheckGreen().

Here is the caller graph for this function:

◆ hasLinkConflict()

bool MSRailSignal::DriveWay::hasLinkConflict ( const Approaching closest,
MSLink foeLink 
) const

◆ mustYield()

bool MSRailSignal::DriveWay::mustYield ( const Approaching veh,
const Approaching foe 
)
static

Whether veh must yield to the foe train.

Definition at line 928 of file MSRailSignal.cpp.

Referenced by MSRailSignalControl::recheckGreen().

Here is the caller graph for this function:

◆ overlap()

bool MSRailSignal::DriveWay::overlap ( const DriveWay other) const

Wether this driveway (route) overlaps with the given one.

Definition at line 1113 of file MSRailSignal.cpp.

References MSEdge::getFromJunction(), MSEdge::getToJunction(), myCoreSize, and myRoute.

◆ reserve()

bool MSRailSignal::DriveWay::reserve ( const Approaching closest,
MSEdgeVector occupied 
)

attempt reserve this driveway for the given vehicle

Definition at line 799 of file MSRailSignal.cpp.

References gDebugFlag4, Named::getIDSecure(), MSRailSignal::getTLLinkID(), MSGlobals::gUseMesoSim, SUMOVehicleParameter::Stop::join, MSRailSignal::myBlockingVehicles, and toString().

Referenced by findProtection(), MSRailSignal::storeTraCIVehicles(), and MSRailSignal::updateCurrentPhase().

Here is the caller graph for this function:

◆ writeBlocks()

void MSRailSignal::DriveWay::writeBlocks ( OutputDevice od) const

Write block items for this driveway.

Definition at line 1146 of file MSRailSignal.cpp.

References OutputDevice::closeTag(), MSRailSignal::getJunctionLinkID(), MSRailSignal::getTLLinkID(), joinToString(), OutputDevice::lf(), OutputDevice::openTag(), SUMO_ATTR_EDGES, SUMO_ATTR_LANES, toString(), and OutputDevice::writeAttr().

Referenced by MSRailSignal::writeBlocks().

Here is the caller graph for this function:

Field Documentation

◆ myActive

const SUMOVehicle* MSRailSignal::DriveWay::myActive

whether the current signal is switched green for a train approaching this block

Definition at line 285 of file MSRailSignal.h.

◆ myBidi

std::vector<const MSLane*> MSRailSignal::DriveWay::myBidi

◆ myBidiExtended

std::vector<const MSLane*> MSRailSignal::DriveWay::myBidiExtended

Definition at line 311 of file MSRailSignal.h.

Referenced by MSRailSignal::LinkInfo::buildDriveWay().

◆ myConflictLanes

std::vector<const MSLane*> MSRailSignal::DriveWay::myConflictLanes

the lanes that must be clear of trains before this signal can switch to green

Definition at line 318 of file MSRailSignal.h.

Referenced by MSRailSignal::LinkInfo::buildDriveWay(), and findProtection().

◆ myConflictLinks

std::vector<MSLink*> MSRailSignal::DriveWay::myConflictLinks

Definition at line 335 of file MSRailSignal.h.

Referenced by findProtection(), and MSRailSignal::hasOncomingRailTraffic().

◆ myCoreSize

int MSRailSignal::DriveWay::myCoreSize

number of edges in myRoute where overlap with other driveways is forbidden

Definition at line 294 of file MSRailSignal.h.

Referenced by MSRailSignal::LinkInfo::buildDriveWay(), findProtection(), and overlap().

◆ myFlank

std::vector<const MSLane*> MSRailSignal::DriveWay::myFlank

◆ myFlankSwitches

std::vector<MSLink*> MSRailSignal::DriveWay::myFlankSwitches

Definition at line 322 of file MSRailSignal.h.

Referenced by MSRailSignal::LinkInfo::buildDriveWay().

◆ myForward

std::vector<const MSLane*> MSRailSignal::DriveWay::myForward

Definition at line 302 of file MSRailSignal.h.

Referenced by MSRailSignal::LinkInfo::buildDriveWay(), and flankConflict().

◆ myFoundReversal

bool MSRailSignal::DriveWay::myFoundReversal

Definition at line 298 of file MSRailSignal.h.

◆ myFoundSignal

bool MSRailSignal::DriveWay::myFoundSignal

whether this driveway ends its forward section with a rail signal (and thus comprises a full block)

Definition at line 297 of file MSRailSignal.h.

Referenced by MSRailSignal::LinkInfo::getDriveWay().

◆ myMaxFlankLength

double MSRailSignal::DriveWay::myMaxFlankLength

the maximum flank length searched while building this driveway

Definition at line 282 of file MSRailSignal.h.

◆ myNumericalID

int MSRailSignal::DriveWay::myNumericalID

◆ myProtectedBidi

const MSEdge* MSRailSignal::DriveWay::myProtectedBidi

switch assumed safe from bidi-traffic

Definition at line 288 of file MSRailSignal.h.

Referenced by MSRailSignal::LinkInfo::buildDriveWay().

◆ myProtectingSwitches

std::vector<MSLink*> MSRailSignal::DriveWay::myProtectingSwitches

Definition at line 328 of file MSRailSignal.h.

Referenced by MSRailSignal::LinkInfo::buildDriveWay(), and findProtection().

◆ myProtectingSwitchesBidi

std::vector<MSLink*> MSRailSignal::DriveWay::myProtectingSwitchesBidi

subset of myProtectingSwitches that protects from oncoming trains

Definition at line 330 of file MSRailSignal.h.

Referenced by MSRailSignal::hasOncomingRailTraffic().

◆ myRoute

std::vector<const MSEdge*> MSRailSignal::DriveWay::myRoute

The documentation for this struct was generated from the following files: