![]() |
Eclipse SUMO - Simulation of Urban MObility
|
#include <MSRailSignal.h>
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) | |
| bool | conflictLinkApproached () const |
| Whether any of the conflict links have approaching vehicles. | |
| bool | deadlockLaneOccupied (bool store=true) const |
| whether any of myBidiExtended is occupied by a vehicle that targets myBidi | |
| DriveWay (bool temporary=false) | |
| Constructor. | |
| 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 | |
| bool | flankConflict (const DriveWay &other) const |
| Wether there is a flank conflict with the given driveway. | |
| bool | hasLinkConflict (const Approaching &closest, MSLink *foeLink) const |
| Whether the approaching vehicle is prevent from driving by another vehicle approaching the given link. | |
| bool | overlap (const DriveWay &other) const |
| Wether this driveway (route) overlaps with the given one. | |
| bool | reserve (const Approaching &closest, MSEdgeVector &occupied) |
| attempt reserve this driveway for the given vehicle | |
| void | writeBlocks (OutputDevice &od) const |
| Write block items for this driveway. | |
Static Public Member Functions | |
| static bool | mustYield (const Approaching &veh, const Approaching &foe) |
| Whether veh must yield to the foe train. | |
Data Fields | |
| const SUMOVehicle * | myActive |
| whether the current signal is switched green for a train approaching this block | |
| 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 | |
| std::vector< MSLink * > | myConflictLinks |
| int | myCoreSize |
| number of edges in myRoute where overlap with other driveways is forbidden | |
| 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) | |
| double | myMaxFlankLength |
| the maximum flank length searched while building this driveway | |
| int | myNumericalID |
| global driveway index | |
| const MSEdge * | myProtectedBidi |
| switch assumed safe from bidi-traffic | |
| std::vector< MSLink * > | myProtectingSwitches |
| std::vector< MSLink * > | myProtectingSwitchesBidi |
| subset of myProtectingSwitches that protects from oncoming trains | |
| std::vector< const MSEdge * > | myRoute |
| list of edges for matching against train routes | |
Definition at line 274 of file MSRailSignal.h.
|
inline |
Constructor.
Definition at line 277 of file MSRailSignal.h.
| void MSRailSignal::DriveWay::buildRoute | ( | MSLink * | origin, |
| double | length, | ||
| MSRouteIterator | next, | ||
| MSRouteIterator | end, | ||
| LaneVisitedMap & | visited | ||
| ) |
Definition at line 1182 of file MSRailSignal.cpp.
References MSRailSignal::appendMapIndex(), DEBUG_HELPER, MSRailSignal::formatVisitedMap(), gDebugFlag4, MSEdge::getBidiEdge(), MSLane::getBidiLane(), MSRailSignal::getClickableTLLinkID(), MSLane::getEdge(), Named::getID(), MSLane::getIncomingLanes(), MSRailSignalControl::getInstance(), MSLane::getLength(), MSLane::getLinkCont(), MSLane::getNextNormal(), MSRailSignal::getTLLinkID(), MSLink::getTLLogic(), MSRailSignalControl::getUsedEdges(), MSLink::getViaLaneOrLane(), MSEdge::isNormal(), isRailway(), MAX_BLOCK_LENGTH, MAX_SIGNAL_WARNINGS, MSRailSignal::myNumWarnings, TL, toString(), TURN, WRITE_WARNING, and WRITE_WARNINGF.
Referenced by MSRailSignal::LinkInfo::buildDriveWay().
| void MSRailSignal::DriveWay::checkCrossingFlanks | ( | MSLink * | dwLink, |
| const LaneVisitedMap & | visited, | ||
| std::vector< MSLink * > & | flankSwitches | ||
| ) | const |
Definition at line 1396 of file MSRailSignal.cpp.
References MSRailSignal::formatVisitedMap(), MSLink::getDescription(), MSJunctionLogic::getFoesFor(), Named::getID(), MSJunction::getIncoming(), MSLink::getIndex(), MSLink::getJunction(), MSJunction::getLogic(), and isRailway().
| 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 1355 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().
| 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 957 of file MSRailSignal.cpp.
References gDebugFlag4, Named::getID(), Named::getIDSecure(), MSBaseVehicle::isStopped(), MSRailSignal::myBlockingVehicles, MSRailSignal::myStoreVehicles, SIMTIME, and toString().
Referenced by hasLinkConflict(), and MSRailSignal::updateCurrentPhase().
| bool MSRailSignal::DriveWay::conflictLinkApproached | ( | ) | const |
Whether any of the conflict links have approaching vehicles.
Definition at line 852 of file MSRailSignal.cpp.
References gDebugFlag4, and SIMTIME.
Referenced by MSRailSignal::updateCurrentPhase().
| bool MSRailSignal::DriveWay::deadlockLaneOccupied | ( | bool | store = true | ) | const |
whether any of myBidiExtended is occupied by a vehicle that targets myBidi
Definition at line 1002 of file MSRailSignal.cpp.
References MSRoute::end(), gDebugFlag4, MSBaseVehicle::getCurrentRouteEdge(), Named::getID(), MSBaseVehicle::getRoute(), MSRailSignal::myBlockingVehicles, and MSRailSignal::myStoreVehicles.
Referenced by hasLinkConflict().
| void MSRailSignal::DriveWay::findFlankProtection | ( | MSLink * | link, |
| double | length, | ||
| LaneVisitedMap & | visited, | ||
| MSLink * | origLink, | ||
| std::vector< const MSLane * > & | flank | ||
| ) |
Definition at line 1433 of file MSRailSignal.cpp.
References MSRailSignal::appendMapIndex(), MSLink::getDescription(), Named::getID(), MSLane::getIncomingLanes(), MSLink::getIndex(), MSLink::getJunction(), MSLink::getLane(), MSLink::getLaneBefore(), MSLane::getLength(), MSLane::getLinkCont(), MSLink::getTLLogic(), MSLane::isInternal(), MAX2(), MAX_BLOCK_LENGTH, MAX_SIGNAL_WARNINGS, MSRailSignal::myNumWarnings, toString(), TURN, and WRITE_WARNING.
Referenced by MSRailSignal::LinkInfo::buildDriveWay(), and findProtection().
| bool MSRailSignal::DriveWay::findProtection | ( | const Approaching & | veh, |
| MSLink * | link | ||
| ) | const |
find protection for the given vehicle starting at a switch
Definition at line 1045 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().
| bool MSRailSignal::DriveWay::flankConflict | ( | const DriveWay & | other | ) | const |
Wether there is a flank conflict with the given driveway.
Definition at line 1124 of file MSRailSignal.cpp.
References myBidi, and myForward.
Referenced by MSRailSignal::recheckGreen().
| bool MSRailSignal::DriveWay::hasLinkConflict | ( | const Approaching & | closest, |
| MSLink * | foeLink | ||
| ) | const |
Whether the approaching vehicle is prevent from driving by another vehicle approaching the given link.
Definition at line 868 of file MSRailSignal.cpp.
References conflictLaneOccupied(), MSRailSignal::constraintsAllow(), deadlockLaneOccupied(), gDebugFlag4, MSLink::getApproaching(), MSRailSignal::getClosest(), MSLink::getTLIndex(), MSRailSignal::getTLLinkID(), MSLink::getTLLogic(), MSRailSignal::myLinkInfos, MSRailSignal::myPriorityVehicles, MSRailSignal::myRivalVehicles, and MSRailSignal::myStoreVehicles.
|
static |
Whether veh must yield to the foe train.
Definition at line 931 of file MSRailSignal.cpp.
Referenced by MSRailSignal::recheckGreen().
| bool MSRailSignal::DriveWay::overlap | ( | const DriveWay & | other | ) | const |
Wether this driveway (route) overlaps with the given one.
Definition at line 1108 of file MSRailSignal.cpp.
References MSEdge::getFromJunction(), MSEdge::getToJunction(), myCoreSize, and myRoute.
| bool MSRailSignal::DriveWay::reserve | ( | const Approaching & | closest, |
| MSEdgeVector & | occupied | ||
| ) |
attempt reserve this driveway for the given vehicle
Definition at line 802 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().
| void MSRailSignal::DriveWay::writeBlocks | ( | OutputDevice & | od | ) | const |
Write block items for this driveway.
Definition at line 1141 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().
| const SUMOVehicle* MSRailSignal::DriveWay::myActive |
whether the current signal is switched green for a train approaching this block
Definition at line 294 of file MSRailSignal.h.
| std::vector<const MSLane*> MSRailSignal::DriveWay::myBidi |
Definition at line 316 of file MSRailSignal.h.
Referenced by MSRailSignal::LinkInfo::buildDriveWay(), and flankConflict().
| std::vector<const MSLane*> MSRailSignal::DriveWay::myBidiExtended |
Definition at line 320 of file MSRailSignal.h.
Referenced by MSRailSignal::LinkInfo::buildDriveWay().
| 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 327 of file MSRailSignal.h.
Referenced by MSRailSignal::LinkInfo::buildDriveWay(), and findProtection().
| std::vector<MSLink*> MSRailSignal::DriveWay::myConflictLinks |
Definition at line 344 of file MSRailSignal.h.
Referenced by findProtection().
| int MSRailSignal::DriveWay::myCoreSize |
number of edges in myRoute where overlap with other driveways is forbidden
Definition at line 303 of file MSRailSignal.h.
Referenced by MSRailSignal::LinkInfo::buildDriveWay(), findProtection(), and overlap().
| std::vector<const MSLane*> MSRailSignal::DriveWay::myFlank |
Definition at line 324 of file MSRailSignal.h.
Referenced by MSRailSignal::LinkInfo::buildDriveWay(), findProtection(), and MSRailSignal::updateCurrentPhase().
| std::vector<MSLink*> MSRailSignal::DriveWay::myFlankSwitches |
Definition at line 331 of file MSRailSignal.h.
Referenced by MSRailSignal::LinkInfo::buildDriveWay().
| std::vector<const MSLane*> MSRailSignal::DriveWay::myForward |
Definition at line 311 of file MSRailSignal.h.
Referenced by MSRailSignal::LinkInfo::buildDriveWay(), and flankConflict().
| bool MSRailSignal::DriveWay::myFoundReversal |
Definition at line 307 of file MSRailSignal.h.
| bool MSRailSignal::DriveWay::myFoundSignal |
whether this driveway ends its forward section with a rail signal (and thus comprises a full block)
Definition at line 306 of file MSRailSignal.h.
Referenced by MSRailSignal::LinkInfo::getDriveWay().
| double MSRailSignal::DriveWay::myMaxFlankLength |
the maximum flank length searched while building this driveway
Definition at line 291 of file MSRailSignal.h.
| int MSRailSignal::DriveWay::myNumericalID |
global driveway index
Definition at line 288 of file MSRailSignal.h.
Referenced by MSRailSignal::LinkInfo::buildDriveWay(), MSRailSignal::updateCurrentPhase(), and MSRailSignal::updateDriveway().
| const MSEdge* MSRailSignal::DriveWay::myProtectedBidi |
switch assumed safe from bidi-traffic
Definition at line 297 of file MSRailSignal.h.
Referenced by MSRailSignal::LinkInfo::buildDriveWay().
| std::vector<MSLink*> MSRailSignal::DriveWay::myProtectingSwitches |
Definition at line 337 of file MSRailSignal.h.
Referenced by MSRailSignal::LinkInfo::buildDriveWay(), and findProtection().
| std::vector<MSLink*> MSRailSignal::DriveWay::myProtectingSwitchesBidi |
subset of myProtectingSwitches that protects from oncoming trains
Definition at line 339 of file MSRailSignal.h.
| std::vector<const MSEdge*> MSRailSignal::DriveWay::myRoute |
list of edges for matching against train routes
Definition at line 300 of file MSRailSignal.h.
Referenced by MSRailSignal::LinkInfo::buildDriveWay(), findProtection(), MSRailSignal::LinkInfo::getDriveWay(), overlap(), MSRailSignal::recheckGreen(), MSRailSignal::updateCurrentPhase(), and MSRailSignal::updateDriveway().