![]() |
Eclipse SUMO - Simulation of Urban MObility
|
#include <MSRailSignal.h>
Public Member Functions | |
void | buildRoute (MSLink *origin, double length, MSRouteIterator next, MSRouteIterator end, LaneSet &visited) |
void | checkCrossingFlanks (MSLink *dwLink, const LaneSet &visited) |
find links that cross the driveway without entering it More... | |
void | checkFlanks (const std::vector< MSLane *> &lanes, const LaneSet &visited, bool allFoes) |
find switches that threathen this driveway More... | |
bool | conflictLaneOccupied () const |
whether any of myConflictLanes is occupied More... | |
bool | conflictLinkApproached () const |
Whether any of the conflict linkes have approaching vehicles. More... | |
DriveWay (int index) | |
Constructor. More... | |
void | findFlankProtection (MSLink *link, double length, LaneSet &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 | 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 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... | |
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< const MSLane * > | myConflictLanes |
the lanes that must be clear of trains before this signal can switch to green More... | |
std::vector< MSLink * > | myConflictLinks |
std::vector< const MSLane * > | myFlank |
std::vector< MSLink * > | myFlankSwitches |
std::vector< MSLane * > | myForward |
int | myIndex |
index in the list of driveways More... | |
double | myMaxFlankLength |
the maximum flank length searched while building this driveway More... | |
std::vector< MSLink * > | myProtectingSwitches |
std::vector< const MSEdge * > | myRoute |
list of lanes for matching against train routes More... | |
Definition at line 220 of file MSRailSignal.h.
|
inline |
Constructor.
Definition at line 223 of file MSRailSignal.h.
void MSRailSignal::DriveWay::buildRoute | ( | MSLink * | origin, |
double | length, | ||
MSRouteIterator | next, | ||
MSRouteIterator | end, | ||
LaneSet & | visited | ||
) |
Definition at line 730 of file MSRailSignal.cpp.
References MSLane::getBidiLane(), MSRailSignal::getClickableTLLinkID(), MSLane::getEdge(), Named::getID(), MSLane::getIncomingLanes(), MSLane::getLength(), MSLane::getLinkCont(), MSLink::getTLLogic(), MSLink::getViaLaneOrLane(), MSEdge::isNormal(), isRailway(), LINKDIR_TURN, MAX_BLOCK_LENGTH, MAX_SIGNAL_WARNINGS, MSRailSignal::myNumWarnings, toString(), and WRITE_WARNING.
find links that cross the driveway without entering it
Definition at line 843 of file MSRailSignal.cpp.
References MSLink::getDescription(), MSJunctionLogic::getFoesFor(), Named::getID(), MSJunction::getIncoming(), MSLink::getIndex(), MSLink::getJunction(), MSJunction::getLogic(), isRailway(), and joinNamedToString().
void MSRailSignal::DriveWay::checkFlanks | ( | const std::vector< MSLane *> & | lanes, |
const LaneSet & | visited, | ||
bool | allFoes | ||
) |
find switches that threathen this driveway
Definition at line 819 of file MSRailSignal.cpp.
References joinNamedToString(), and toString().
bool MSRailSignal::DriveWay::conflictLaneOccupied | ( | ) | const |
whether any of myConflictLanes is occupied
Definition at line 615 of file MSRailSignal.cpp.
References gDebugFlag4, and SIMTIME.
Referenced by hasLinkConflict(), and MSRailSignal::updateCurrentPhase().
bool MSRailSignal::DriveWay::conflictLinkApproached | ( | ) | const |
Whether any of the conflict linkes have approaching vehicles.
Definition at line 538 of file MSRailSignal.cpp.
Referenced by MSRailSignal::updateCurrentPhase().
void MSRailSignal::DriveWay::findFlankProtection | ( | MSLink * | link, |
double | length, | ||
LaneSet & | visited, | ||
MSLink * | origLink | ||
) |
find upstream protection from the given link
Definition at line 875 of file MSRailSignal.cpp.
References MSLink::getDescription(), Named::getID(), MSLane::getIncomingLanes(), MSLink::getIndex(), MSLink::getJunction(), MSLink::getLane(), MSLink::getLaneBefore(), MSLane::getLength(), MSLane::getLinkCont(), MSLink::getTLLogic(), MSLane::isInternal(), LINKDIR_TURN, MAX2(), MAX_BLOCK_LENGTH, MAX_SIGNAL_WARNINGS, MSRailSignal::myNumWarnings, toString(), and WRITE_WARNING.
Referenced by findProtection().
bool MSRailSignal::DriveWay::findProtection | ( | const Approaching & | veh, |
MSLink * | link | ||
) | const |
find protection for the given vehicle starting at a switch
Definition at line 631 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, myFlank, myProtectingSwitches, myRoute, reserve(), SIMTIME, and toString().
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 549 of file MSRailSignal.cpp.
References conflictLaneOccupied(), gDebugFlag4, MSLink::getApproaching(), MSRailSignal::getClosest(), MSLink::getTLIndex(), MSRailSignal::getTLLinkID(), MSLink::getTLLogic(), and MSRailSignal::myLinkInfos.
bool MSRailSignal::DriveWay::overlap | ( | const DriveWay & | other | ) | const |
Wether this driveway overlaps with the given one.
Definition at line 692 of file MSRailSignal.cpp.
References MSEdge::getFromJunction(), MSEdge::getToJunction(), and myRoute.
bool MSRailSignal::DriveWay::reserve | ( | const Approaching & | closest, |
MSEdgeVector & | occupied | ||
) |
attempt reserve this driveway for the given vehicle
Definition at line 498 of file MSRailSignal.cpp.
References gDebugFlag4, and MSRailSignal::getTLLinkID().
Referenced by findProtection(), and MSRailSignal::updateCurrentPhase().
void MSRailSignal::DriveWay::writeBlocks | ( | OutputDevice & | od | ) | const |
Write block items for this driveway.
Definition at line 706 of file MSRailSignal.cpp.
References OutputDevice::closeTag(), MSRailSignal::getTLLinkID(), joinToString(), 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 236 of file MSRailSignal.h.
std::vector<MSLane*> MSRailSignal::DriveWay::myBidi |
Definition at line 248 of file MSRailSignal.h.
Referenced by MSRailSignal::hasOncomingRailTraffic().
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 255 of file MSRailSignal.h.
Referenced by findProtection().
std::vector<MSLink*> MSRailSignal::DriveWay::myConflictLinks |
Definition at line 270 of file MSRailSignal.h.
Referenced by findProtection(), and MSRailSignal::hasOncomingRailTraffic().
std::vector<const MSLane*> MSRailSignal::DriveWay::myFlank |
Definition at line 252 of file MSRailSignal.h.
Referenced by findProtection(), and MSRailSignal::hasOncomingRailTraffic().
std::vector<MSLink*> MSRailSignal::DriveWay::myFlankSwitches |
Definition at line 259 of file MSRailSignal.h.
std::vector<MSLane*> MSRailSignal::DriveWay::myForward |
Definition at line 243 of file MSRailSignal.h.
int MSRailSignal::DriveWay::myIndex |
index in the list of driveways
Definition at line 230 of file MSRailSignal.h.
double MSRailSignal::DriveWay::myMaxFlankLength |
the maximum flank length searched while building this driveway
Definition at line 233 of file MSRailSignal.h.
std::vector<MSLink*> MSRailSignal::DriveWay::myProtectingSwitches |
Definition at line 265 of file MSRailSignal.h.
Referenced by findProtection().
std::vector<const MSEdge*> MSRailSignal::DriveWay::myRoute |
list of lanes for matching against train routes
Definition at line 239 of file MSRailSignal.h.
Referenced by findProtection(), and overlap().