![]() |
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 More... | |
Static Public Member Functions | |
static bool | isActiveForEdge (const MSEdge *walkingEdge, const MSEdge *crossing) |
Static method with the same behavior of isActivated. More... | |
static bool | isActiveOnAnySideOfTheRoad (const MSEdge *crossing) |
Static method to check if the push button is active on both side of the road. More... | |
static std::vector< MSPushButton * > | loadPushButtons (const MSPhaseDefinition *) |
Loads all the pushbuttons for all the controlled lanes of a stage. More... | |
Static Private Member Functions | |
static bool | anyActive (const std::vector< MSPushButton * > &) |
Checks if any pushbutton in the vector is active. More... | |
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 59 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 47 of file MSPushButton.cpp.
References MSEdge::getPermissions(), MSEdge::isCrossing(), MSEdge::isWalkingArea(), and SVC_PEDESTRIAN.
Referenced by loadPushButtons().
|
inlinevirtual |
Definition at line 67 of file MSPushButton.h.
|
staticinherited |
Checks if any pushbutton in the vector is active.
Definition at line 35 of file MSPushButton.cpp.
Referenced by MSSOTLTrafficLightLogic::isPushButtonPressed().
|
virtual |
abstract methods inherited from PedestrianState
Implements MSPushButton.
Definition at line 53 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 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 57 of file MSPushButton.cpp.
References DBG, Named::getID(), MSBaseVehicle::getID(), MSTransportable::getID(), MSEdge::getLanes(), MSPerson::getNextEdgePtr(), MSEdge::getPersons(), MSEdge::getPredecessors(), MSEdge::getSuccessors(), MSBaseVehicle::getVClass(), MSLane::getVehiclesSecure(), MSTransportable::getWaitingSeconds(), MSVehicle::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 136 of file MSPushButton.cpp.
References DBG, Named::getID(), getWalkingAreas(), isActiveForEdge(), and WRITE_MESSAGE.
|
staticprivate |
Definition at line 181 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 148 of file MSPushButton.cpp.
References DBG, MSLane::dictionary(), MSEdge::dictionary(), MSLane::getEdge(), Named::getID(), MSPhaseDefinition::getState(), MSPhaseDefinition::getTargetLaneSet(), getWalkingAreas(), loadCrossingEdgeMap(), m_crossingEdgeMap, MSPedestrianPushButton(), and WRITE_MESSAGE.
Referenced by MSSOTLTrafficLightLogic::isPushButtonPressed().
|
protectedinherited |
Definition at line 53 of file MSPushButton.h.
Referenced by isActivated(), and MSPushButton::MSPushButton().
|
staticprivate |
Definition at line 97 of file MSPushButton.h.
Referenced by loadCrossingEdgeMap(), and loadPushButtons().
|
staticprivate |
Definition at line 98 of file MSPushButton.h.
Referenced by loadCrossingEdgeMap().
|
protectedinherited |
Definition at line 52 of file MSPushButton.h.
Referenced by isActivated(), and MSPushButton::MSPushButton().