![]() |
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) |
| find links that cross the driveway without entering it More... | |
| void | checkFlanks (const std::vector< MSLane * > &lanes, const LaneVisitedMap &visited, bool allFoes) |
| find switches that threaten this driveway More... | |
| bool | conflictLaneOccupied (const std::string &joinVehicle="", bool store=true) 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) |
| find upstream protection from the given link More... | |
| 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 SUMOVehicle * | myActive |
| whether the current signal is switched green for a train approaching this block More... | |
| std::vector< MSLane * > | myBidi |
| std::vector< 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< MSLane * > | myForward |
| double | myMaxFlankLength |
| the maximum flank length searched while building this driveway More... | |
| int | myNumericalID |
| global driveway index More... | |
| const MSEdge * | myProtectedBidi |
| 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... | |
Definition at line 272 of file MSRailSignal.h.
|
inline |
Constructor.
Definition at line 275 of file MSRailSignal.h.
| void MSRailSignal::DriveWay::buildRoute | ( | MSLink * | origin, |
| double | length, | ||
| MSRouteIterator | next, | ||
| MSRouteIterator | end, | ||
| LaneVisitedMap & | visited | ||
| ) |
Definition at line 1109 of file MSRailSignal.cpp.
References MSRailSignal::appendMapIndex(), 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, toString(), TURN, and WRITE_WARNING.
Referenced by MSRailSignal::LinkInfo::buildDriveWay().
| void MSRailSignal::DriveWay::checkCrossingFlanks | ( | MSLink * | dwLink, |
| const LaneVisitedMap & | visited | ||
| ) |
find links that cross the driveway without entering it
Definition at line 1291 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 std::vector< MSLane * > & | lanes, |
| const LaneVisitedMap & | visited, | ||
| bool | allFoes | ||
| ) |
find switches that threaten this driveway
Definition at line 1267 of file MSRailSignal.cpp.
References MSRailSignal::formatVisitedMap(), and toString().
Referenced by MSRailSignal::LinkInfo::buildDriveWay().
| bool MSRailSignal::DriveWay::conflictLaneOccupied | ( | const std::string & | joinVehicle = "", |
| bool | store = true |
||
| ) | const |
whether any of myConflictLanes is occupied (vehicles that are the target of a join must be ignored)
Definition at line 894 of file MSRailSignal.cpp.
References gDebugFlag4, 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 789 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 929 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 | ||
| ) |
find upstream protection from the given link
Definition at line 1328 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 972 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().
| bool MSRailSignal::DriveWay::flankConflict | ( | const DriveWay & | other | ) | const |
Wether there is a flank conflict with the given driveway.
Definition at line 1051 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 805 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 868 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 1035 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 739 of file MSRailSignal.cpp.
References gDebugFlag4, MSRailSignal::getTLLinkID(), MSGlobals::gUseMesoSim, and SUMOVehicleParameter::Stop::join.
Referenced by findProtection(), MSRailSignal::storeTraCIVehicles(), and MSRailSignal::updateCurrentPhase().
| void MSRailSignal::DriveWay::writeBlocks | ( | OutputDevice & | od | ) | const |
Write block items for this driveway.
Definition at line 1068 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().
| const SUMOVehicle* MSRailSignal::DriveWay::myActive |
whether the current signal is switched green for a train approaching this block
Definition at line 290 of file MSRailSignal.h.
| std::vector<MSLane*> MSRailSignal::DriveWay::myBidi |
Definition at line 308 of file MSRailSignal.h.
Referenced by MSRailSignal::LinkInfo::buildDriveWay(), flankConflict(), and MSRailSignal::hasOncomingRailTraffic().
| std::vector<MSLane*> MSRailSignal::DriveWay::myBidiExtended |
Definition at line 312 of file MSRailSignal.h.
| 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 319 of file MSRailSignal.h.
Referenced by MSRailSignal::LinkInfo::buildDriveWay(), and findProtection().
| std::vector<MSLink*> MSRailSignal::DriveWay::myConflictLinks |
Definition at line 336 of file MSRailSignal.h.
Referenced by findProtection(), and MSRailSignal::hasOncomingRailTraffic().
| int MSRailSignal::DriveWay::myCoreSize |
number of edges in myRoute where overlap with other driveways is forbidden
Definition at line 299 of file MSRailSignal.h.
Referenced by MSRailSignal::LinkInfo::buildDriveWay(), findProtection(), and overlap().
| std::vector<const MSLane*> MSRailSignal::DriveWay::myFlank |
Definition at line 316 of file MSRailSignal.h.
Referenced by MSRailSignal::LinkInfo::buildDriveWay(), findProtection(), MSRailSignal::hasOncomingRailTraffic(), and MSRailSignal::updateCurrentPhase().
| std::vector<MSLink*> MSRailSignal::DriveWay::myFlankSwitches |
Definition at line 323 of file MSRailSignal.h.
Referenced by MSRailSignal::LinkInfo::buildDriveWay().
| std::vector<MSLane*> MSRailSignal::DriveWay::myForward |
Definition at line 303 of file MSRailSignal.h.
Referenced by MSRailSignal::LinkInfo::buildDriveWay(), and flankConflict().
| double MSRailSignal::DriveWay::myMaxFlankLength |
the maximum flank length searched while building this driveway
Definition at line 287 of file MSRailSignal.h.
| int MSRailSignal::DriveWay::myNumericalID |
global driveway index
Definition at line 284 of file MSRailSignal.h.
Referenced by MSRailSignal::LinkInfo::buildDriveWay(), MSRailSignal::retrieveDriveWay(), MSRailSignal::updateCurrentPhase(), and MSRailSignal::updateDriveway().
| const MSEdge* MSRailSignal::DriveWay::myProtectedBidi |
switch assumed safe from bidi-traffic
Definition at line 293 of file MSRailSignal.h.
Referenced by MSRailSignal::LinkInfo::buildDriveWay().
| std::vector<MSLink*> MSRailSignal::DriveWay::myProtectingSwitches |
Definition at line 329 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 331 of file MSRailSignal.h.
Referenced by MSRailSignal::hasOncomingRailTraffic().
| std::vector<const MSEdge*> MSRailSignal::DriveWay::myRoute |
list of edges for matching against train routes
Definition at line 296 of file MSRailSignal.h.
Referenced by MSRailSignal::LinkInfo::buildDriveWay(), findProtection(), overlap(), MSRailSignal::recheckGreen(), MSRailSignal::updateCurrentPhase(), and MSRailSignal::updateDriveway().