Eclipse SUMO - Simulation of Urban MObility
MSPModel_JuPedSim::PState Class Reference

Holds pedestrian state and performs updates. More...

Inheritance diagram for MSPModel_JuPedSim::PState:
[legend]
Collaboration diagram for MSPModel_JuPedSim::PState:
[legend]

Public Member Functions

bool advanceNextWaypoint ()
 
JPS_AgentId getAgentId () const
 
double getAngle (const MSStageMoving &stage, SUMOTime now) const override
 return the direction in which the transportable faces in degrees More...
 
int getDirection (const MSStageMoving &stage, SUMOTime now) const override
 return the walking direction (FORWARD, BACKWARD) More...
 
double getEdgePos (const MSStageMoving &stage, SUMOTime now) const override
 return the offset from the start of the current edge measured in its natural direction More...
 
JPS_JourneyId getJourneyId () const
 
virtual const MSLanegetLane () const
 the current lane of the transportable More...
 
const MSEdgegetNextEdge (const MSStageMoving &stage) const override
 return the list of internal edges if the transportable is on an intersection More...
 
const MSPModel_JuPedSim::WaypointDescgetNextWaypoint (const int offset=0) const
 
virtual double getPathLength () const
 return the total length of the current lane (in particular for on a walkingarea) More...
 
MSPersongetPerson () const
 
Position getPosition (const MSStageMoving &stage, SUMOTime now) const override
 return the network coordinate of the transportable More...
 
Position getPreviousPosition () const
 
double getSpeed (const MSStageMoving &stage) const override
 return the current speed of the transportable More...
 
MSStageMovinggetStage () const
 
JPS_StageId getStageId () const
 first stage of the journey More...
 
SUMOTime getWaitingTime (const MSStageMoving &stage, SUMOTime now) const override
 return the time the transportable spent standing More...
 
bool isFinished () const override
 whether the transportable has finished walking More...
 
virtual bool isJammed () const
 whether the transportable is jammed More...
 
bool isWaitingToEnter () const
 
virtual void moveTo (MSPerson *p, MSLane *lane, double lanePos, double lanePosLat, SUMOTime t)
 try to move transportable to the given position More...
 
virtual void moveToXY (MSPerson *p, Position pos, MSLane *lane, double lanePos, double lanePosLat, double angle, int routeOffset, const ConstMSEdgeVector &edges, SUMOTime t)
 try to move transportable to the given position More...
 
 PState (MSPerson *person, MSStageMoving *stage, JPS_JourneyId journeyId, JPS_StageId stageId, const std::vector< WaypointDesc > &waypoints)
 
void reinit (MSStageMoving *stage, JPS_JourneyId journeyId, JPS_StageId stageId, const std::vector< WaypointDesc > &waypoints)
 
virtual void saveState (std::ostringstream &out)
 Saves the current state into the given stream. More...
 
void setAgentId (JPS_AgentId id)
 
void setAngle (double angle)
 
void setLanePosition (double lanePosition)
 
void setPosition (double x, double y)
 
void setPreviousPosition (Position previousPosition)
 
void setStage (MSStageMoving *const stage)
 
 ~PState () override
 

Private Attributes

JPS_AgentId myAgentId
 
double myAngle
 
JPS_JourneyId myJourneyId
 id of the journey, needed for modifying it More...
 
double myLanePosition
 
MSPersonmyPerson
 
Position myPosition
 
Position myPreviousPosition
 
MSStageMovingmyStage
 
JPS_StageId myStageId
 
bool myWaitingToEnter
 whether the pedestrian is waiting to start its walk More...
 
std::vector< MSPModel_JuPedSim::WaypointDescmyWaypoints
 

Detailed Description

Holds pedestrian state and performs updates.

Definition at line 83 of file MSPModel_JuPedSim.h.

Constructor & Destructor Documentation

◆ PState()

MSPModel_JuPedSim::PState::PState ( MSPerson person,
MSStageMoving stage,
JPS_JourneyId  journeyId,
JPS_StageId  stageId,
const std::vector< WaypointDesc > &  waypoints 
)

Definition at line 1145 of file MSPModel_JuPedSim.cpp.

◆ ~PState()

MSPModel_JuPedSim::PState::~PState ( )
override

Definition at line 1166 of file MSPModel_JuPedSim.cpp.

Member Function Documentation

◆ advanceNextWaypoint()

bool MSPModel_JuPedSim::PState::advanceNextWaypoint ( )
inline

Definition at line 136 of file MSPModel_JuPedSim.h.

References myWaypoints.

Referenced by MSPModel_JuPedSim::execute().

Here is the caller graph for this function:

◆ getAgentId()

JPS_AgentId MSPModel_JuPedSim::PState::getAgentId ( ) const

Definition at line 1247 of file MSPModel_JuPedSim.cpp.

Referenced by MSPModel_JuPedSim::add(), and MSPModel_JuPedSim::execute().

Here is the caller graph for this function:

◆ getAngle()

double MSPModel_JuPedSim::PState::getAngle ( const MSStageMoving stage,
SUMOTime  now 
) const
overridevirtual

return the direction in which the transportable faces in degrees

Implements MSTransportableStateAdapter.

Definition at line 1185 of file MSPModel_JuPedSim.cpp.

◆ getDirection()

int MSPModel_JuPedSim::PState::getDirection ( const MSStageMoving stage,
SUMOTime  now 
) const
overridevirtual

return the walking direction (FORWARD, BACKWARD)

Implements MSTransportableStateAdapter.

Definition at line 1221 of file MSPModel_JuPedSim.cpp.

References MSPModel::UNDEFINED_DIRECTION.

◆ getEdgePos()

double MSPModel_JuPedSim::PState::getEdgePos ( const MSStageMoving stage,
SUMOTime  now 
) const
overridevirtual

return the offset from the start of the current edge measured in its natural direction

Implements MSTransportableStateAdapter.

Definition at line 1216 of file MSPModel_JuPedSim.cpp.

◆ getJourneyId()

JPS_JourneyId MSPModel_JuPedSim::PState::getJourneyId ( ) const
inline

Definition at line 123 of file MSPModel_JuPedSim.h.

References myJourneyId.

Referenced by MSPModel_JuPedSim::tryPedestrianInsertion().

Here is the caller graph for this function:

◆ getLane()

virtual const MSLane* MSTransportableStateAdapter::getLane ( ) const
inlinevirtualinherited

the current lane of the transportable

Reimplemented in MSPModel_Striping::PState.

Definition at line 218 of file MSPModel.h.

Referenced by MSStageMoving::getLane(), and MSStageWalking::loadState().

Here is the caller graph for this function:

◆ getNextEdge()

const MSEdge * MSPModel_JuPedSim::PState::getNextEdge ( const MSStageMoving stage) const
overridevirtual

return the list of internal edges if the transportable is on an intersection

Implements MSTransportableStateAdapter.

Definition at line 1236 of file MSPModel_JuPedSim.cpp.

References MSStageMoving::getNextRouteEdge().

◆ getNextWaypoint()

const MSPModel_JuPedSim::WaypointDesc * MSPModel_JuPedSim::PState::getNextWaypoint ( const int  offset = 0) const

Definition at line 1242 of file MSPModel_JuPedSim.cpp.

Referenced by MSPModel_JuPedSim::execute().

Here is the caller graph for this function:

◆ getPathLength()

virtual double MSTransportableStateAdapter::getPathLength ( ) const
inlinevirtualinherited

return the total length of the current lane (in particular for on a walkingarea)

Reimplemented in MSPModel_Striping::PState.

Definition at line 223 of file MSPModel.h.

Referenced by MSStageWalking::moveToNextEdge().

Here is the caller graph for this function:

◆ getPerson()

MSPerson * MSPModel_JuPedSim::PState::getPerson ( ) const

Definition at line 1206 of file MSPModel_JuPedSim.cpp.

Referenced by MSPModel_JuPedSim::execute(), and MSPModel_JuPedSim::tryPedestrianInsertion().

Here is the caller graph for this function:

◆ getPosition()

Position MSPModel_JuPedSim::PState::getPosition ( const MSStageMoving stage,
SUMOTime  now 
) const
overridevirtual

return the network coordinate of the transportable

Implements MSTransportableStateAdapter.

Definition at line 1170 of file MSPModel_JuPedSim.cpp.

Referenced by MSPModel_JuPedSim::add(), and MSPModel_JuPedSim::execute().

Here is the caller graph for this function:

◆ getPreviousPosition()

Position MSPModel_JuPedSim::PState::getPreviousPosition ( ) const

◆ getSpeed()

double MSPModel_JuPedSim::PState::getSpeed ( const MSStageMoving stage) const
overridevirtual

return the current speed of the transportable

Implements MSTransportableStateAdapter.

Definition at line 1231 of file MSPModel_JuPedSim.cpp.

References DELTA_T, and STEPS2TIME.

◆ getStage()

MSStageMoving * MSPModel_JuPedSim::PState::getStage ( ) const

Definition at line 1195 of file MSPModel_JuPedSim.cpp.

Referenced by MSPModel_JuPedSim::add(), MSPModel_JuPedSim::execute(), and MSPModel_JuPedSim::remove().

Here is the caller graph for this function:

◆ getStageId()

JPS_StageId MSPModel_JuPedSim::PState::getStageId ( ) const
inline

first stage of the journey

Definition at line 128 of file MSPModel_JuPedSim.h.

References myStageId.

Referenced by MSPModel_JuPedSim::tryPedestrianInsertion().

Here is the caller graph for this function:

◆ getWaitingTime()

SUMOTime MSPModel_JuPedSim::PState::getWaitingTime ( const MSStageMoving stage,
SUMOTime  now 
) const
overridevirtual

return the time the transportable spent standing

Implements MSTransportableStateAdapter.

Definition at line 1226 of file MSPModel_JuPedSim.cpp.

◆ isFinished()

bool MSPModel_JuPedSim::PState::isFinished ( ) const
inlineoverridevirtual

whether the transportable has finished walking

Reimplemented from MSTransportableStateAdapter.

Definition at line 114 of file MSPModel_JuPedSim.h.

References myWaypoints.

◆ isJammed()

virtual bool MSTransportableStateAdapter::isJammed ( ) const
inlinevirtualinherited

whether the transportable is jammed

Reimplemented in MSPModel_Striping::PState.

Definition at line 208 of file MSPModel.h.

Referenced by MSPerson::isJammed().

Here is the caller graph for this function:

◆ isWaitingToEnter()

bool MSPModel_JuPedSim::PState::isWaitingToEnter ( ) const
inline

Definition at line 132 of file MSPModel_JuPedSim.h.

References myWaitingToEnter.

Referenced by MSPModel_JuPedSim::add(), and MSPModel_JuPedSim::execute().

Here is the caller graph for this function:

◆ moveTo()

virtual void MSTransportableStateAdapter::moveTo ( MSPerson p,
MSLane lane,
double  lanePos,
double  lanePosLat,
SUMOTime  t 
)
inlinevirtualinherited

try to move transportable to the given position

Reimplemented in MSPModel_Striping::PState.

Definition at line 182 of file MSPModel.h.

References TL, UNUSED_PARAMETER, and WRITE_WARNING.

Referenced by LIBSUMO_NAMESPACE::Person::moveTo().

Here is the caller graph for this function:

◆ moveToXY()

virtual void MSTransportableStateAdapter::moveToXY ( MSPerson p,
Position  pos,
MSLane lane,
double  lanePos,
double  lanePosLat,
double  angle,
int  routeOffset,
const ConstMSEdgeVector edges,
SUMOTime  t 
)
inlinevirtualinherited

try to move transportable to the given position

Reimplemented in MSPModel_Striping::PState.

Definition at line 192 of file MSPModel.h.

References TL, UNUSED_PARAMETER, and WRITE_WARNING.

Referenced by MSPerson::Influencer::postProcessRemoteControl().

Here is the caller graph for this function:

◆ reinit()

void MSPModel_JuPedSim::PState::reinit ( MSStageMoving stage,
JPS_JourneyId  journeyId,
JPS_StageId  stageId,
const std::vector< WaypointDesc > &  waypoints 
)

Definition at line 1154 of file MSPModel_JuPedSim.cpp.

Referenced by MSPModel_JuPedSim::add().

Here is the caller graph for this function:

◆ saveState()

virtual void MSTransportableStateAdapter::saveState ( std::ostringstream &  out)
inlinevirtualinherited

Saves the current state into the given stream.

Reimplemented in MSPModel_Striping::PState, and MSPModel_NonInteracting::PState.

Definition at line 229 of file MSPModel.h.

References UNUSED_PARAMETER.

Referenced by MSStageWalking::saveState().

Here is the caller graph for this function:

◆ setAgentId()

void MSPModel_JuPedSim::PState::setAgentId ( JPS_AgentId  id)
inline

Definition at line 118 of file MSPModel_JuPedSim.h.

References myAgentId, and myWaitingToEnter.

Referenced by MSPModel_JuPedSim::tryPedestrianInsertion().

Here is the caller graph for this function:

◆ setAngle()

void MSPModel_JuPedSim::PState::setAngle ( double  angle)

Definition at line 1190 of file MSPModel_JuPedSim.cpp.

Referenced by MSPModel_JuPedSim::add(), and MSPModel_JuPedSim::execute().

Here is the caller graph for this function:

◆ setLanePosition()

void MSPModel_JuPedSim::PState::setLanePosition ( double  lanePosition)

Definition at line 1211 of file MSPModel_JuPedSim.cpp.

Referenced by MSPModel_JuPedSim::add(), and MSPModel_JuPedSim::execute().

Here is the caller graph for this function:

◆ setPosition()

void MSPModel_JuPedSim::PState::setPosition ( double  x,
double  y 
)

Definition at line 1175 of file MSPModel_JuPedSim.cpp.

Referenced by MSPModel_JuPedSim::add(), and MSPModel_JuPedSim::execute().

Here is the caller graph for this function:

◆ setPreviousPosition()

void MSPModel_JuPedSim::PState::setPreviousPosition ( Position  previousPosition)

Definition at line 1180 of file MSPModel_JuPedSim.cpp.

Referenced by MSPModel_JuPedSim::add(), and MSPModel_JuPedSim::execute().

Here is the caller graph for this function:

◆ setStage()

void MSPModel_JuPedSim::PState::setStage ( MSStageMoving *const  stage)

Definition at line 1201 of file MSPModel_JuPedSim.cpp.

Referenced by MSPModel_JuPedSim::remove().

Here is the caller graph for this function:

Field Documentation

◆ myAgentId

JPS_AgentId MSPModel_JuPedSim::PState::myAgentId
private

Definition at line 148 of file MSPModel_JuPedSim.h.

Referenced by setAgentId().

◆ myAngle

double MSPModel_JuPedSim::PState::myAngle
private

Definition at line 151 of file MSPModel_JuPedSim.h.

◆ myJourneyId

JPS_JourneyId MSPModel_JuPedSim::PState::myJourneyId
private

id of the journey, needed for modifying it

Definition at line 145 of file MSPModel_JuPedSim.h.

Referenced by getJourneyId().

◆ myLanePosition

double MSPModel_JuPedSim::PState::myLanePosition
private

Definition at line 152 of file MSPModel_JuPedSim.h.

◆ myPerson

MSPerson* MSPModel_JuPedSim::PState::myPerson
private

Definition at line 142 of file MSPModel_JuPedSim.h.

◆ myPosition

Position MSPModel_JuPedSim::PState::myPosition
private

Definition at line 149 of file MSPModel_JuPedSim.h.

◆ myPreviousPosition

Position MSPModel_JuPedSim::PState::myPreviousPosition
private

Definition at line 150 of file MSPModel_JuPedSim.h.

◆ myStage

MSStageMoving* MSPModel_JuPedSim::PState::myStage
private

Definition at line 143 of file MSPModel_JuPedSim.h.

◆ myStageId

JPS_StageId MSPModel_JuPedSim::PState::myStageId
private

Definition at line 146 of file MSPModel_JuPedSim.h.

Referenced by getStageId().

◆ myWaitingToEnter

bool MSPModel_JuPedSim::PState::myWaitingToEnter
private

whether the pedestrian is waiting to start its walk

Definition at line 154 of file MSPModel_JuPedSim.h.

Referenced by isWaitingToEnter(), and setAgentId().

◆ myWaypoints

std::vector<MSPModel_JuPedSim::WaypointDesc> MSPModel_JuPedSim::PState::myWaypoints
private

Definition at line 147 of file MSPModel_JuPedSim.h.

Referenced by advanceNextWaypoint(), and isFinished().


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