Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MSPModel_Interacting Class Referenceabstract

The abstract superclass for pedestrian models which actually interact with vehicles. More...

#include <MSPModel_Interacting.h>

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

Public Member Functions

virtual MSTransportableStateAdapteradd (MSTransportable *transportable, MSStageMoving *stage, SUMOTime now)=0
 register the given person as a pedestrian
 
bool blockedAtDist (const SUMOTrafficObject *ego, const MSLane *lane, double vehSide, double vehWidth, double oncomingGap, std::vector< const MSPerson * > *collectBlockers)
 whether a pedestrian is blocking the crossing of lane for the given vehicle bondaries
 
virtual void clearState ()
 Resets pedestrians when quick-loading state.
 
int getActiveNumber ()
 return the number of active pedestrians
 
bool hasPedestrians (const MSLane *lane)
 whether the given lane has pedestrians on it
 
virtual MSTransportableStateAdapterloadState (MSTransportable *transportable, MSStageMoving *stage, std::istringstream &state)
 load the state of the given transportable
 
PersonDist nextBlocking (const MSLane *lane, double minPos, double minRight, double maxLeft, double stopTime=0, bool bidi=false)
 returns the next pedestrian beyond minPos that is laterally between minRight and maxLeft or nullptr
 
void registerActive ()
 increase the number of active pedestrians
 
virtual void remove (MSTransportableStateAdapter *state)
 remove the specified person from the pedestrian simulation
 
bool usingInternalLanes ()
 whether movements on intersections are modelled /
 
virtual bool usingShortcuts ()
 whether travel times and distances can reliably be calculated from the network alone
 
 ~MSPModel_Interacting ()
 

Static Public Member Functions

static int canTraverse (int dir, const ConstMSEdgeVector &route, int &passedEdges)
 
static void unregisterCrossingApproach (const MSPModel_InteractingState &ped, const MSLane *crossing)
 unregister pedestrian approach with the junction model
 
static bool usingInternalLanesStatic ()
 

Static Public Attributes

static const int BACKWARD
 
static const int FORWARD
 
static const double RANDOM_POS_LAT
 magic value to encode randomized lateral offset for persons when starting a walk
 
static const double SAFETY_GAP
 
static const double SIDEWALK_OFFSET
 the offset for computing person positions when walking on edges without a sidewalk
 
static const int UNDEFINED_DIRECTION
 
static const double UNSPECIFIED_POS_LAT
 the default lateral offset for persons when starting a walk
 

Protected Types

typedef std::map< const MSLane *, Pedestrians, ComparatorNumericalIdLessActiveLanes
 
typedef std::vector< MSPModel_InteractingState * > Pedestrians
 

Protected Member Functions

PedestriansgetPedestrians (const MSLane *lane)
 retrieves the pedestrian vector for the given lane (may be empty)
 

Protected Attributes

ActiveLanes myActiveLanes
 store of all lanes which have pedestrians on them
 
bool myAmActive = false
 whether an event for pedestrian processing was added
 
std::set< MSLink * > myApproachedCrossings
 all crossings being approached by pedestrians
 
int myNumActivePedestrians = 0
 the total number of active pedestrians
 

Static Protected Attributes

static Pedestrians noPedestrians
 empty pedestrian vector
 

Detailed Description

The abstract superclass for pedestrian models which actually interact with vehicles.

Definition at line 41 of file MSPModel_Interacting.h.

Member Typedef Documentation

◆ ActiveLanes

Definition at line 98 of file MSPModel_Interacting.h.

◆ Pedestrians

Definition at line 97 of file MSPModel_Interacting.h.

Constructor & Destructor Documentation

◆ ~MSPModel_Interacting()

MSPModel_Interacting::~MSPModel_Interacting ( )

Definition at line 41 of file MSPModel_Interacting.cpp.

References clearState().

Member Function Documentation

◆ add()

virtual MSTransportableStateAdapter * MSPModel::add ( MSTransportable transportable,
MSStageMoving stage,
SUMOTime  now 
)
pure virtualinherited

register the given person as a pedestrian

Implemented in MSPModel_JuPedSim, MSPModel_NonInteracting, and MSPModel_Striping.

Referenced by MSStageWalking::proceed(), and MSStageTranship::proceed().

Here is the caller graph for this function:

◆ blockedAtDist()

bool MSPModel_Interacting::blockedAtDist ( const SUMOTrafficObject ego,
const MSLane lane,
double  vehSide,
double  vehWidth,
double  oncomingGap,
std::vector< const MSPerson * > *  collectBlockers 
)
virtual

whether a pedestrian is blocking the crossing of lane for the given vehicle bondaries

Parameters
[in]egoThe object that inquires about blockage (and may electively ignore foes)
[in]laneThe crossing to check
[in]vehsideThe offset to the vehicle side near the start of the crossing
[in]vehWidthThe width of the vehicle
[in]oncomingGapThe distance which the vehicle wants to keep from oncoming pedestrians
[in]collectBlockersThe list of persons blocking the crossing
Returns
Whether the vehicle must wait

Reimplemented from MSPModel.

Definition at line 70 of file MSPModel_Interacting.cpp.

References DEBUGCOND, MSPModel::FORWARD, Named::getID(), getPedestrians(), MSLink::ignoreFoe(), SIMTIME, and TIME2STEPS.

◆ canTraverse()

int MSPModel::canTraverse ( int  dir,
const ConstMSEdgeVector route,
int &  passedEdges 
)
staticinherited

Definition at line 54 of file MSPModel.cpp.

References MSPModel::BACKWARD, MSPModel::FORWARD, MSEdge::getFromJunction(), MSEdge::getToJunction(), and MSPModel::UNDEFINED_DIRECTION.

Referenced by MSPModel_Striping::getNextLane(), MSPModel_Striping::PState::PState(), and MSStageWalking::walkDistance().

Here is the caller graph for this function:

◆ clearState()

void MSPModel_Interacting::clearState ( )
virtual

Resets pedestrians when quick-loading state.

Implements MSPModel.

Reimplemented in MSPModel_JuPedSim.

Definition at line 47 of file MSPModel_Interacting.cpp.

References myActiveLanes, myAmActive, and myNumActivePedestrians.

Referenced by ~MSPModel_Interacting().

Here is the caller graph for this function:

◆ getActiveNumber()

int MSPModel_Interacting::getActiveNumber ( )
inlinevirtual

return the number of active pedestrians

Implements MSPModel.

Definition at line 84 of file MSPModel_Interacting.h.

References myNumActivePedestrians.

◆ getPedestrians()

MSPModel_Interacting::Pedestrians & MSPModel_Interacting::getPedestrians ( const MSLane lane)
protected

retrieves the pedestrian vector for the given lane (may be empty)

Definition at line 164 of file MSPModel_Interacting.cpp.

References myActiveLanes, and noPedestrians.

Referenced by blockedAtDist(), MSPModel_Striping::getNextLaneObstacles(), hasPedestrians(), and nextBlocking().

Here is the caller graph for this function:

◆ hasPedestrians()

bool MSPModel_Interacting::hasPedestrians ( const MSLane lane)
virtual

whether the given lane has pedestrians on it

Reimplemented from MSPModel.

Definition at line 108 of file MSPModel_Interacting.cpp.

References getPedestrians().

◆ loadState()

virtual MSTransportableStateAdapter * MSPModel::loadState ( MSTransportable transportable,
MSStageMoving stage,
std::istringstream &  state 
)
inlinevirtualinherited

load the state of the given transportable

Reimplemented in MSPModel_NonInteracting, and MSPModel_Striping.

Definition at line 76 of file MSPModel.h.

References UNUSED_PARAMETER.

Referenced by MSStageWalking::loadState().

Here is the caller graph for this function:

◆ nextBlocking()

PersonDist MSPModel_Interacting::nextBlocking ( const MSLane lane,
double  minPos,
double  minRight,
double  maxLeft,
double  stopTime = 0,
bool  bidi = false 
)
virtual

returns the next pedestrian beyond minPos that is laterally between minRight and maxLeft or nullptr

Parameters
[in]lanethe lane to check
[in]minPosThe minimum offset along the lane after which to check
[in]minRightThe rightmost border of the vehicle (0 indicates driving on the right border)
[in]maxLeftThe leftmost border of the vehicle
[in]stopTimeThe time it would take the vehicle to come to a stop
[in]bidiWhether the vehicle is driving against the flow
Returns
The closest person (or nullptr) and the distance to it

Reimplemented from MSPModel.

Definition at line 126 of file MSPModel_Interacting.cpp.

References DEBUGCOND, MSPModel::FORWARD, Named::getID(), getPedestrians(), and MSLane::getWidth().

◆ registerActive()

void MSPModel_Interacting::registerActive ( )
inline

increase the number of active pedestrians

Definition at line 89 of file MSPModel_Interacting.h.

References myNumActivePedestrians.

Referenced by MSPModel_Striping::PState::moveToXY().

Here is the caller graph for this function:

◆ remove()

void MSPModel_Interacting::remove ( MSTransportableStateAdapter state)
virtual

remove the specified person from the pedestrian simulation

Implements MSPModel.

Reimplemented in MSPModel_JuPedSim.

Definition at line 55 of file MSPModel_Interacting.cpp.

References MSTransportableStateAdapter::getLane(), MSPModel_InteractingState::getNextCrossing(), myActiveLanes, myNumActivePedestrians, and unregisterCrossingApproach().

Referenced by MSPModel_Striping::PState::moveToXY().

Here is the caller graph for this function:

◆ unregisterCrossingApproach()

void MSPModel_Interacting::unregisterCrossingApproach ( const MSPModel_InteractingState ped,
const MSLane crossing 
)
static

unregister pedestrian approach with the junction model

Definition at line 175 of file MSPModel_Interacting.cpp.

References DEBUGCOND, Named::getID(), MSLane::getIncomingLanes(), MSPModel_InteractingState::getPerson(), and SIMTIME.

Referenced by MSPModel_Striping::getNextLane(), MSPModel_Striping::moveInDirectionOnLane(), and remove().

Here is the caller graph for this function:

◆ usingInternalLanes()

bool MSPModel_Interacting::usingInternalLanes ( )
virtual

whether movements on intersections are modelled /

Note
function declared as member for sake of inheritance (delegates to static function)

Implements MSPModel.

Definition at line 114 of file MSPModel_Interacting.cpp.

References usingInternalLanesStatic().

◆ usingInternalLanesStatic()

bool MSPModel_Interacting::usingInternalLanesStatic ( )
static

Definition at line 120 of file MSPModel_Interacting.cpp.

References MSNet::getInstance(), MSGlobals::gUsingInternalLanes, MSNet::hasInternalLinks(), and MSNet::hasPedestrianNetwork().

Referenced by MSPModel_Striping::getNextLane(), and usingInternalLanes().

Here is the caller graph for this function:

◆ usingShortcuts()

virtual bool MSPModel::usingShortcuts ( )
inlinevirtualinherited

whether travel times and distances can reliably be calculated from the network alone

Reimplemented in MSPModel_JuPedSim.

Definition at line 138 of file MSPModel.h.

Field Documentation

◆ BACKWARD

◆ FORWARD

const int MSPModel::FORWARD
staticinherited

Definition at line 54 of file MSPModel.h.

Referenced by MSPModel_JuPedSim::add(), MSPModel_Striping::addCloserObstacle(), MSPModel_Striping::addCrossingVehs(), blockedAtDist(), MSPModel::canTraverse(), MSPModel_Striping::Obstacle::closer(), MSPModel_NonInteracting::PState::computeDuration(), MSPModel_Striping::connectedDirection(), MSPModel_Striping::PState::distanceTo(), MSPModel_Striping::PState::distToLaneEnd(), MSE3Collector::enter(), MSPModel_Striping::MovePedestrians::execute(), MSPModel_NonInteracting::PState::getDirection(), MSStageDriving::getDirection(), MSPModel_Striping::PState::getMaxX(), MSPModel_Striping::PState::getMinX(), MSPModel_Striping::getNextLane(), MSPModel_Striping::getNextLaneObstacles(), MSPModel_Striping::getNextWalkingArea(), MSPModel_Striping::PState::getPosition(), MSPModel_Striping::getVehicleObstacles(), MSPModel_Striping::insertWalkArePaths(), MSE3Collector::leave(), MSPModel_Striping::PState::mergeObstacles(), MSPModel_Striping::moveInDirectionOnLane(), MSStageWalking::moveToNextEdge(), MSPModel_Striping::PState::moveToNextLane(), MSPModel_Striping::PState::moveToXY(), nextBlocking(), MSInductLoop::notifyLeave(), MSE3Collector::MSE3EntryReminder::notifyMove(), MSE2Collector::notifyMovePerson(), MSInductLoop::notifyMovePerson(), MSE3Collector::notifyMovePerson(), MSPModel_Striping::PState::PState(), MSPModel_JuPedSim::PState::PState(), MSPModel_Striping::transformToCurrentLanePositions(), MSPModel_Striping::PState::walk(), and MSStageWalking::walkDistance().

◆ myActiveLanes

◆ myAmActive

bool MSPModel_Interacting::myAmActive = false
protected

whether an event for pedestrian processing was added

Definition at line 110 of file MSPModel_Interacting.h.

Referenced by MSPModel_Striping::add(), clearState(), and MSPModel_Striping::loadState().

◆ myApproachedCrossings

std::set<MSLink*> MSPModel_Interacting::myApproachedCrossings
protected

all crossings being approached by pedestrians

Definition at line 113 of file MSPModel_Interacting.h.

◆ myNumActivePedestrians

◆ noPedestrians

MSPModel_Interacting::Pedestrians MSPModel_Interacting::noPedestrians
staticprotected

empty pedestrian vector

Definition at line 116 of file MSPModel_Interacting.h.

Referenced by getPedestrians().

◆ RANDOM_POS_LAT

const double MSPModel::RANDOM_POS_LAT
staticinherited

magic value to encode randomized lateral offset for persons when starting a walk

Definition at line 68 of file MSPModel.h.

Referenced by MSPModel_JuPedSim::add(), MSRouteHandler::interpretDepartPosLat(), and MSPModel_Striping::PState::PState().

◆ SAFETY_GAP

◆ SIDEWALK_OFFSET

const double MSPModel::SIDEWALK_OFFSET
staticinherited

the offset for computing person positions when walking on edges without a sidewalk

Definition at line 62 of file MSPModel.h.

Referenced by MSPModel_NonInteracting::PState::getPosition(), GUINet::initGUIStructures(), LIBSUMO_NAMESPACE::Person::moveTo(), and MSPModel_Striping::PState::moveToXY().

◆ UNDEFINED_DIRECTION

◆ UNSPECIFIED_POS_LAT

const double MSPModel::UNSPECIFIED_POS_LAT
staticinherited

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