Eclipse SUMO - Simulation of Urban MObility
|
#include <MSPushButton.h>
Public Member Functions | |
MSPedestrianPushButton (const MSEdge *walkingEdge, const MSEdge *crossingEdge) | |
virtual | ~MSPedestrianPushButton () |
bool | isActivated () const |
abstract methods inherited from PedestrianState | |
Static Public Member Functions | |
static bool | isActiveForEdge (const MSEdge *walkingEdge, const MSEdge *crossing) |
Static method with the same behavior of isActivated. | |
static bool | isActiveOnAnySideOfTheRoad (const MSEdge *crossing) |
Static method to check if the push button is active on both side of the road. | |
static std::vector< MSPushButton * > | loadPushButtons (const MSPhaseDefinition *) |
Loads all the pushbuttons for all the controlled lanes of a stage. | |
Static Private Member Functions | |
static bool | anyActive (const std::vector< MSPushButton * > &) |
Checks if any pushbutton in the vector is active. | |
static void | loadCrossingEdgeMap () |
Private Attributes | |
const MSEdge * | m_crossingEdge |
const MSEdge * | m_edge |
Static Private Attributes | |
static std::map< std::string, std::vector< std::string > > | m_crossingEdgeMap |
static bool | m_crossingEdgeMapLoaded = false |
Pedestrian push button
Definition at line 63 of file MSPushButton.h.
MSPedestrianPushButton::MSPedestrianPushButton | ( | const MSEdge * | walkingEdge, |
const MSEdge * | crossingEdge | ||
) |
MSPedestrianPushButton constructor
[in] | edge | the edge where the push button is located. Must be a walking area. |
[in] | crossingEdge | the crossing controlled by the push button. Must be a crossing. |
Definition at line 58 of file MSPushButton.cpp.
References MSEdge::getPermissions(), MSEdge::isCrossing(), MSEdge::isWalkingArea(), and SVC_PEDESTRIAN.
|
inlinevirtual |
Definition at line 71 of file MSPushButton.h.
|
staticinherited |
Checks if any pushbutton in the vector is active.
Definition at line 48 of file MSPushButton.cpp.
Referenced by MSSOTLTrafficLightLogic::isPushButtonPressed().
|
virtual |
abstract methods inherited from PedestrianState
Implements MSPushButton.
Definition at line 64 of file MSPushButton.cpp.
References isActiveForEdge(), MSPushButton::m_crossingEdge, and MSPushButton::m_edge.
|
static |
Static method with the same behavior of isActivated.
Checks if the pushbutton has been pressed for a particular crossing from a edge.
TODO keep using >= 1 or switch to ==1. Should change return value from always active to active only when pressed? TODO If changed the swarm logic must be changed since it relies on this behavior that keeps it active
Definition at line 68 of file MSPushButton.cpp.
References Named::getID(), MSEdge::getLanes(), MSPerson::getNextEdgePtr(), MSEdge::getPersons(), MSEdge::getPredecessors(), MSEdge::getSuccessors(), MSBaseVehicle::getVClass(), MSLane::getVehiclesSecure(), MSBaseVehicle::getWaitingSeconds(), MSTransportable::getWaitingSeconds(), MSLane::releaseVehicles(), MSBaseVehicle::succEdge(), SVC_PEDESTRIAN, and WRITE_MESSAGE.
Referenced by isActivated(), and isActiveOnAnySideOfTheRoad().
|
static |
Static method to check if the push button is active on both side of the road.
[in] | A | crossing edge |
Definition at line 149 of file MSPushButton.cpp.
References Named::getID(), getWalkingAreas(), isActiveForEdge(), and WRITE_MESSAGE.
|
staticprivate |
Definition at line 198 of file MSPushButton.cpp.
References MSEdge::getAllEdges(), MSEdge::getCrossingEdges(), Named::getID(), MSEdge::isCrossing(), m_crossingEdgeMap, and m_crossingEdgeMapLoaded.
Referenced by loadPushButtons().
|
static |
Loads all the pushbuttons for all the controlled lanes of a stage.
[in] | A | phase definition |
Definition at line 163 of file MSPushButton.cpp.
References MSEdge::dictionary(), MSLane::dictionary(), MSLane::getEdge(), Named::getID(), MSPhaseDefinition::getState(), MSPhaseDefinition::getTargetLaneSet(), getWalkingAreas(), loadCrossingEdgeMap(), m_crossingEdgeMap, and WRITE_MESSAGE.
Referenced by MSSOTLTrafficLightLogic::isPushButtonPressed().
|
protectedinherited |
Definition at line 57 of file MSPushButton.h.
Referenced by isActivated(), and MSPushButton::MSPushButton().
|
staticprivate |
Definition at line 101 of file MSPushButton.h.
Referenced by loadCrossingEdgeMap(), and loadPushButtons().
|
staticprivate |
Definition at line 102 of file MSPushButton.h.
Referenced by loadCrossingEdgeMap().
|
protectedinherited |
Definition at line 56 of file MSPushButton.h.
Referenced by isActivated(), and MSPushButton::MSPushButton().