Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MSPedestrianPushButton Class Reference

#include <MSPushButton.h>

Inheritance diagram for MSPedestrianPushButton:
[legend]
Collaboration diagram for MSPedestrianPushButton:
[legend]

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 MSEdgem_crossingEdge
 
const MSEdgem_edge
 

Static Private Attributes

static std::map< std::string, std::vector< std::string > > m_crossingEdgeMap
 
static bool m_crossingEdgeMapLoaded = false
 

Detailed Description

Pedestrian push button

Definition at line 63 of file MSPushButton.h.

Constructor & Destructor Documentation

◆ MSPedestrianPushButton()

MSPedestrianPushButton::MSPedestrianPushButton ( const MSEdge walkingEdge,
const MSEdge crossingEdge 
)

MSPedestrianPushButton constructor

Parameters
[in]edgethe edge where the push button is located. Must be a walking area.
[in]crossingEdgethe 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.

◆ ~MSPedestrianPushButton()

virtual MSPedestrianPushButton::~MSPedestrianPushButton ( )
inlinevirtual

Definition at line 71 of file MSPushButton.h.

Member Function Documentation

◆ anyActive()

bool MSPushButton::anyActive ( const std::vector< MSPushButton * > &  pushButtons)
staticinherited

Checks if any pushbutton in the vector is active.

Returns
True if at least one pushbutton is active, false otherwise

Definition at line 48 of file MSPushButton.cpp.

Referenced by MSSOTLTrafficLightLogic::isPushButtonPressed().

Here is the caller graph for this function:

◆ isActivated()

bool MSPedestrianPushButton::isActivated ( ) const
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.

◆ isActiveForEdge()

bool MSPedestrianPushButton::isActiveForEdge ( const MSEdge walkingEdge,
const MSEdge crossing 
)
static

Static method with the same behavior of isActivated.

Checks if the pushbutton has been pressed for a particular crossing from a edge.

Returns
true if pressed, false otherwise

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().

Here is the caller graph for this function:

◆ isActiveOnAnySideOfTheRoad()

bool MSPedestrianPushButton::isActiveOnAnySideOfTheRoad ( const MSEdge crossing)
static

Static method to check if the push button is active on both side of the road.

Parameters
[in]Acrossing edge
Returns
true if pressed, false otherwise

Definition at line 149 of file MSPushButton.cpp.

References Named::getID(), getWalkingAreas(), isActiveForEdge(), and WRITE_MESSAGE.

◆ loadCrossingEdgeMap()

void MSPedestrianPushButton::loadCrossingEdgeMap ( )
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().

Here is the caller graph for this function:

◆ loadPushButtons()

std::vector< MSPushButton * > MSPedestrianPushButton::loadPushButtons ( const MSPhaseDefinition phase)
static

Loads all the pushbuttons for all the controlled lanes of a stage.

Parameters
[in]Aphase definition
Returns
A list of pushbuttons

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().

Here is the caller graph for this function:

Field Documentation

◆ m_crossingEdge

const MSEdge* MSPushButton::m_crossingEdge
protectedinherited

Definition at line 57 of file MSPushButton.h.

Referenced by isActivated(), and MSPushButton::MSPushButton().

◆ m_crossingEdgeMap

std::map< std::string, std::vector< std::string > > MSPedestrianPushButton::m_crossingEdgeMap
staticprivate

Definition at line 101 of file MSPushButton.h.

Referenced by loadCrossingEdgeMap(), and loadPushButtons().

◆ m_crossingEdgeMapLoaded

bool MSPedestrianPushButton::m_crossingEdgeMapLoaded = false
staticprivate

Definition at line 102 of file MSPushButton.h.

Referenced by loadCrossingEdgeMap().

◆ m_edge

const MSEdge* MSPushButton::m_edge
protectedinherited

Definition at line 56 of file MSPushButton.h.

Referenced by isActivated(), and MSPushButton::MSPushButton().


The documentation for this class was generated from the following files: