Eclipse SUMO - Simulation of Urban MObility
MSPModel_Remote Class Reference

The pedestrian following model connected to the external JuPedSim simulation. More...

#include <MSPModel_Remote.h>

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

Data Structures

class  Event
 
class  PState
 Container for pedestrian state and individual position update function. More...
 

Public Member Functions

MSTransportableStateAdapteradd (MSTransportable *person, MSStageMoving *stage, SUMOTime now) override
 register the given person as a pedestrian More...
 
virtual bool blockedAtDist (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 More...
 
void clearState ()
 Resets pedestrians when quick-loading state. More...
 
SUMOTime execute (SUMOTime time)
 
int getActiveNumber ()
 return the number of active objects More...
 
virtual bool hasPedestrians (const MSLane *lane)
 whether the given lane has pedestrians on it More...
 
virtual MSTransportableStateAdapterloadState (MSTransportable *transportable, MSStageMoving *stage, std::istringstream &state)
 load the state of the given transportable More...
 
 MSPModel_Remote (const OptionsCont &oc, MSNet *net)
 
virtual 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 0 More...
 
void remove (MSTransportableStateAdapter *state) override
 remove the specified person from the pedestrian simulation More...
 
bool usingInternalLanes ()
 whether movements on intersections are modelled More...
 
 ~MSPModel_Remote ()
 

Static Public Member Functions

static int canTraverse (int dir, const ConstMSEdgeVector &route)
 

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 More...
 
static const double SAFETY_GAP
 
static const double SIDEWALK_OFFSET
 the offset for computing person positions when walking on edges without a sidewalk More...
 
static const int UNDEFINED_DIRECTION
 
static const double UNSPECIFIED_POS_LAT
 the default lateral offset for persons when starting a walk More...
 

Private Member Functions

MSLanegetFirstPedestrianLane (const MSEdge *const &edge)
 
void initialize ()
 

Private Attributes

std::map< const MSEdge *, std::tuple< int, int > > edgesTransitionsMapping
 
Boundary myBoundary
 
int myLastId = 0
 
int myLastTransitionId = 0
 
MSNetmyNet
 
std::map< int, PState * > remoteIdPStateMapping
 
std::map< int, const MSEdge * > transitionsEdgesMapping
 

Detailed Description

The pedestrian following model connected to the external JuPedSim simulation.

Definition at line 36 of file MSPModel_Remote.h.

Constructor & Destructor Documentation

◆ MSPModel_Remote()

MSPModel_Remote::MSPModel_Remote ( const OptionsCont oc,
MSNet net 
)

◆ ~MSPModel_Remote()

MSPModel_Remote::~MSPModel_Remote ( )

Definition at line 114 of file MSPModel_Remote.cpp.

Member Function Documentation

◆ add()

MSTransportableStateAdapter * MSPModel_Remote::add ( MSTransportable transportable,
MSStageMoving stage,
SUMOTime  now 
)
overridevirtual

register the given person as a pedestrian

Implements MSPModel.

Definition at line 40 of file MSPModel_Remote.cpp.

References MSTransportable::getCurrentStageType(), myLastId, and remoteIdPStateMapping.

◆ blockedAtDist()

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

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

Parameters
[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 in MSPModel_Striping.

Definition at line 81 of file MSPModel.h.

References UNUSED_PARAMETER.

Referenced by MSLink::getLeaderInfo().

Here is the caller graph for this function:

◆ canTraverse()

int MSPModel::canTraverse ( int  dir,
const ConstMSEdgeVector route 
)
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::PState::PState(), and MSPerson::MSPersonStage_Walking::walkDistance().

Here is the caller graph for this function:

◆ clearState()

void MSPModel_Remote::clearState ( )
virtual

Resets pedestrians when quick-loading state.

Implements MSPModel.

Definition at line 298 of file MSPModel_Remote.cpp.

◆ execute()

SUMOTime MSPModel_Remote::execute ( SUMOTime  time)

Definition at line 129 of file MSPModel_Remote.cpp.

References DELTA_T.

Referenced by MSPModel_Remote::Event::execute().

Here is the caller graph for this function:

◆ getActiveNumber()

int MSPModel_Remote::getActiveNumber ( )
inlinevirtual

return the number of active objects

Implements MSPModel.

Definition at line 58 of file MSPModel_Remote.h.

References remoteIdPStateMapping.

◆ getFirstPedestrianLane()

MSLane * MSPModel_Remote::getFirstPedestrianLane ( const MSEdge *const &  edge)
private

Definition at line 203 of file MSPModel_Remote.cpp.

References Named::getID(), MSEdge::getLanes(), and SVC_PEDESTRIAN.

◆ hasPedestrians()

virtual bool MSPModel::hasPedestrians ( const MSLane lane)
inlinevirtualinherited

whether the given lane has pedestrians on it

Reimplemented in MSPModel_Striping.

Definition at line 92 of file MSPModel.h.

References UNUSED_PARAMETER.

Referenced by MSLane::hasPedestrians().

Here is the caller graph for this function:

◆ initialize()

void MSPModel_Remote::initialize ( )
private

Definition at line 221 of file MSPModel_Remote.cpp.

Referenced by MSPModel_Remote().

Here is the caller graph for this function:

◆ 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 60 of file MSPModel.h.

References UNUSED_PARAMETER.

Referenced by MSPerson::MSPersonStage_Walking::loadState().

Here is the caller graph for this function:

◆ nextBlocking()

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

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

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 and the distance to it

Reimplemented in MSPModel_Striping.

Definition at line 106 of file MSPModel.h.

References UNUSED_PARAMETER.

Referenced by MSLane::nextBlocking().

Here is the caller graph for this function:

◆ remove()

void MSPModel_Remote::remove ( MSTransportableStateAdapter state)
overridevirtual

remove the specified person from the pedestrian simulation

Implements MSPModel.

Definition at line 214 of file MSPModel_Remote.cpp.

◆ usingInternalLanes()

bool MSPModel_Remote::usingInternalLanes ( )
virtual

whether movements on intersections are modelled

Implements MSPModel.

Definition at line 293 of file MSPModel_Remote.cpp.

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

Field Documentation

◆ BACKWARD

◆ edgesTransitionsMapping

std::map<const MSEdge*, std::tuple<int, int> > MSPModel_Remote::edgesTransitionsMapping
private

Definition at line 99 of file MSPModel_Remote.h.

◆ FORWARD

◆ myBoundary

Boundary MSPModel_Remote::myBoundary
private

Definition at line 95 of file MSPModel_Remote.h.

◆ myLastId

int MSPModel_Remote::myLastId = 0
private

Definition at line 101 of file MSPModel_Remote.h.

Referenced by add().

◆ myLastTransitionId

int MSPModel_Remote::myLastTransitionId = 0
private

Definition at line 102 of file MSPModel_Remote.h.

◆ myNet

MSNet* MSPModel_Remote::myNet
private

Definition at line 94 of file MSPModel_Remote.h.

◆ 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 131 of file MSPModel.h.

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

◆ remoteIdPStateMapping

std::map<int, PState*> MSPModel_Remote::remoteIdPStateMapping
private

Definition at line 98 of file MSPModel_Remote.h.

Referenced by add(), and getActiveNumber().

◆ 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 125 of file MSPModel.h.

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

◆ transitionsEdgesMapping

std::map<int, const MSEdge*> MSPModel_Remote::transitionsEdgesMapping
private

Definition at line 100 of file MSPModel_Remote.h.

◆ UNDEFINED_DIRECTION

◆ UNSPECIFIED_POS_LAT

const double MSPModel::UNSPECIFIED_POS_LAT
staticinherited

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