Eclipse SUMO - Simulation of Urban MObility
MSPModel_InteractingState Class Referenceabstract

Container for pedestrian state and individual position update function. More...

#include <MSPModel_Interacting.h>

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

Public Member Functions

virtual double getAngle (const MSStageMoving &, SUMOTime) const
 return the current orientation in degrees More...
 
virtual const std::string & getID () const
 return ID of the person (or sometimes vehicle) being represented More...
 
virtual double getLatOffset () const
 return the lateral offset to the lane center More...
 
virtual const MSLanegetNextCrossing () const
 placeholder function for the accessing the next crossing More...
 
virtual const MSEdgegetNextEdge (const MSStageMoving &stage) const =0
 return the list of internal edges if the transportable is on an intersection More...
 
virtual double getPathLength () const
 return the total length of the current lane (in particular for on a walkingarea) More...
 
MSPersongetPerson () const
 return the represented person More...
 
virtual Position getPosition (const MSStageMoving &stage, SUMOTime now) const =0
 return the network coordinate of the transportable More...
 
const PositiongetRemotePosition () const
 return the remote position if being controlled by TraCI or JuPedSim More...
 
MSStageMovinggetStage () const
 return the current stage More...
 
virtual bool isFinished () const
 whether the transportable has finished walking More...
 
bool isWaitingToEnter () const
 whether the person still waits to entere the network More...
 
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...
 
 MSPModel_InteractingState (MSPerson *person, MSStageMoving *stage, const MSLane *lane)
 constructor More...
 
virtual void saveState (std::ostringstream &out)
 Saves the current state into the given stream. More...
 
 ~MSPModel_InteractingState ()
 
double getEdgePos (SUMOTime) const
 abstract methods inherited from MSTransportableStateAdapter More...
 
int getDirection () const
 return the walking direction (FORWARD, BACKWARD, UNDEFINED_DIRECTION) More...
 
SUMOTime getWaitingTime () const
 return the time the transportable spent standing More...
 
double getSpeed (const MSStageMoving &) const
 return the current speed of the transportable More...
 
bool isJammed () const
 whether the transportable is jammed More...
 
const MSLanegetLane () const
 the current lane of the transportable More...
 

Protected Attributes

bool myAmJammed = false
 whether the person is jammed More...
 
double myAngle = std::numeric_limits<double>::max()
 cached angle More...
 
int myDir = MSPModel::UNDEFINED_DIRECTION
 the walking direction on the current lane (1 forward, -1 backward) More...
 
double myEdgePos = 0.
 the advancement along the current lane More...
 
const MSLanemyLane = nullptr
 the current lane of this pedestrian More...
 
MSPersonmyPerson = nullptr
 the person who is being represented More...
 
double myPosLat = 0.
 the orthogonal shift on the current lane More...
 
Position myRemoteXYPos = Position::INVALID
 remote-controlled position More...
 
double mySpeed = 0.
 the current walking speed More...
 
double mySpeedLat = 0.
 the current lateral walking speed More...
 
MSStageMovingmyStage = nullptr
 the current stage of this pedestrian More...
 
SUMOTime myWaitingTime = 0
 the consecutive time spent at speed 0 More...
 
bool myWaitingToEnter = false
 whether the pedestrian is waiting to start its walk More...
 

Private Member Functions

MSPModel_InteractingStateoperator= (const MSPModel_InteractingState &)=delete
 Invalidated assignment operator. More...
 

Detailed Description

Container for pedestrian state and individual position update function.

This contains trivial implementations and members for the most used access methods

Definition at line 126 of file MSPModel_Interacting.h.

Constructor & Destructor Documentation

◆ MSPModel_InteractingState()

MSPModel_InteractingState::MSPModel_InteractingState ( MSPerson person,
MSStageMoving stage,
const MSLane lane 
)
inline

constructor

Definition at line 129 of file MSPModel_Interacting.h.

◆ ~MSPModel_InteractingState()

MSPModel_InteractingState::~MSPModel_InteractingState ( )
inline

Definition at line 138 of file MSPModel_Interacting.h.

Member Function Documentation

◆ getAngle()

virtual double MSPModel_InteractingState::getAngle ( const MSStageMoving ,
SUMOTime   
) const
inlinevirtual

return the current orientation in degrees

Implements MSTransportableStateAdapter.

Reimplemented in MSPModel_Striping::PState.

Definition at line 209 of file MSPModel_Interacting.h.

References myAngle.

Referenced by MSPModel_JuPedSim::tryPedestrianInsertion().

Here is the caller graph for this function:

◆ getDirection()

int MSPModel_InteractingState::getDirection ( ) const
inlinevirtual

return the walking direction (FORWARD, BACKWARD, UNDEFINED_DIRECTION)

Implements MSTransportableStateAdapter.

Definition at line 148 of file MSPModel_Interacting.h.

References myDir.

Referenced by MSPModel_Striping::arriveAndAdvance(), MSPModel_Striping::MovePedestrians::execute(), MSPModel_Striping::getNeighboringObstacles(), MSPModel_Striping::getNextLane(), MSPModel_Striping::moveInDirection(), and MSPModel_Striping::moveInDirectionOnLane().

Here is the caller graph for this function:

◆ getEdgePos()

double MSPModel_InteractingState::getEdgePos ( SUMOTime  ) const
inlinevirtual

abstract methods inherited from MSTransportableStateAdapter

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

Implements MSTransportableStateAdapter.

Definition at line 143 of file MSPModel_Interacting.h.

References myEdgePos.

Referenced by MSPModel_Striping::moveInDirection(), MSPModel_Striping::moveInDirectionOnLane(), and MSPModel_Striping::by_xpos_sorter::operator()().

Here is the caller graph for this function:

◆ getID()

virtual const std::string& MSPModel_InteractingState::getID ( ) const
inlinevirtual

return ID of the person (or sometimes vehicle) being represented

Reimplemented in MSPModel_Striping::PStateVehicle.

Definition at line 204 of file MSPModel_Interacting.h.

References Named::getID(), and myPerson.

Referenced by MSPModel_Striping::getNeighboringObstacles(), MSPModel_Striping::by_xpos_sorter::operator()(), and MSPModel_Striping::PState::PState().

Here is the caller graph for this function:

◆ getLane()

const MSLane* MSPModel_InteractingState::getLane ( ) const
inlinevirtual

the current lane of the transportable

Reimplemented from MSTransportableStateAdapter.

Definition at line 168 of file MSPModel_Interacting.h.

References myLane.

Referenced by MSPModel_Striping::arriveAndAdvance(), MSPModel_JuPedSim::execute(), MSPModel_Striping::loadState(), MSPModel_Striping::moveInDirectionOnLane(), MSPModel_Striping::registerCrossingApproach(), and MSPModel_JuPedSim::remove().

Here is the caller graph for this function:

◆ getLatOffset()

virtual double MSPModel_InteractingState::getLatOffset ( ) const
inlinevirtual

return the lateral offset to the lane center

Reimplemented in MSPModel_Striping::PState.

Definition at line 179 of file MSPModel_Interacting.h.

References myPosLat.

◆ getNextCrossing()

virtual const MSLane* MSPModel_InteractingState::getNextCrossing ( ) const
inlinevirtual

placeholder function for the accessing the next crossing

Reimplemented in MSPModel_Striping::PState.

Definition at line 174 of file MSPModel_Interacting.h.

Referenced by MSPModel_Interacting::remove().

Here is the caller graph for this function:

◆ getNextEdge()

virtual const MSEdge* MSTransportableStateAdapter::getNextEdge ( const MSStageMoving stage) const
pure virtualinherited

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

Implemented in MSPModel_JuPedSim::PState, MSPModel_Striping::PState, and MSPModel_NonInteracting::PState.

Referenced by MSPerson::getNextEdgePtr().

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

Referenced by MSStageWalking::moveToNextEdge().

Here is the caller graph for this function:

◆ getPerson()

◆ getPosition()

virtual Position MSTransportableStateAdapter::getPosition ( const MSStageMoving stage,
SUMOTime  now 
) const
pure virtualinherited

return the network coordinate of the transportable

Implemented in MSPModel_Striping::PState, MSPModel_NonInteracting::CState, MSPModel_NonInteracting::PState, and MSPModel_JuPedSim::PState.

Referenced by MSStageMoving::getPosition().

Here is the caller graph for this function:

◆ getRemotePosition()

const Position& MSPModel_InteractingState::getRemotePosition ( ) const
inline

return the remote position if being controlled by TraCI or JuPedSim

Definition at line 199 of file MSPModel_Interacting.h.

References myRemoteXYPos.

Referenced by MSPModel_Striping::moveInDirectionOnLane().

Here is the caller graph for this function:

◆ getSpeed()

double MSPModel_InteractingState::getSpeed ( const MSStageMoving ) const
inlinevirtual

return the current speed of the transportable

Implements MSTransportableStateAdapter.

Definition at line 158 of file MSPModel_Interacting.h.

References mySpeed.

Referenced by MSPModel_Striping::moveInDirectionOnLane().

Here is the caller graph for this function:

◆ getStage()

MSStageMoving* MSPModel_InteractingState::getStage ( ) const
inline

◆ getWaitingTime()

SUMOTime MSPModel_InteractingState::getWaitingTime ( ) const
inlinevirtual

return the time the transportable spent standing

Implements MSTransportableStateAdapter.

Definition at line 153 of file MSPModel_Interacting.h.

References myWaitingTime.

◆ isFinished()

virtual bool MSTransportableStateAdapter::isFinished ( ) const
inlinevirtualinherited

whether the transportable has finished walking

Reimplemented in MSPModel_JuPedSim::PState.

Definition at line 211 of file MSPModel.h.

Referenced by MSStageMoving::~MSStageMoving().

Here is the caller graph for this function:

◆ isJammed()

bool MSPModel_InteractingState::isJammed ( ) const
inlinevirtual

whether the transportable is jammed

Reimplemented from MSTransportableStateAdapter.

Definition at line 163 of file MSPModel_Interacting.h.

References myAmJammed.

Referenced by MSPModel_Striping::getNeighboringObstacles(), MSPModel_Striping::getNextLaneObstacles(), and MSPModel_Striping::moveInDirectionOnLane().

Here is the caller graph for this function:

◆ isWaitingToEnter()

bool MSPModel_InteractingState::isWaitingToEnter ( ) const
inline

whether the person still waits to entere the network

Definition at line 194 of file MSPModel_Interacting.h.

References myWaitingToEnter.

Referenced by MSPModel_JuPedSim::add(), MSPModel_JuPedSim::execute(), MSPModel_Striping::getNeighboringObstacles(), MSPModel_Striping::getNextLaneObstacles(), MSPModel_Striping::moveInDirectionOnLane(), and MSPModel_Striping::Obstacle::Obstacle().

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 180 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 190 of file MSPModel.h.

References TL, UNUSED_PARAMETER, and WRITE_WARNING.

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

Here is the caller graph for this function:

◆ operator=()

MSPModel_InteractingState& MSPModel_InteractingState::operator= ( const MSPModel_InteractingState )
privatedelete

Invalidated assignment operator.

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

References UNUSED_PARAMETER.

Referenced by MSStageWalking::saveState().

Here is the caller graph for this function:

Field Documentation

◆ myAmJammed

bool MSPModel_InteractingState::myAmJammed = false
protected

whether the person is jammed

Definition at line 235 of file MSPModel_Interacting.h.

Referenced by isJammed(), and MSPModel_Striping::PState::PState().

◆ myAngle

double MSPModel_InteractingState::myAngle = std::numeric_limits<double>::max()
mutableprotected

cached angle

Definition at line 239 of file MSPModel_Interacting.h.

Referenced by getAngle(), and MSPModel_JuPedSim::PState::setAngle().

◆ myDir

int MSPModel_InteractingState::myDir = MSPModel::UNDEFINED_DIRECTION
protected

the walking direction on the current lane (1 forward, -1 backward)

Definition at line 225 of file MSPModel_Interacting.h.

Referenced by getDirection(), MSPModel_Striping::PState::PState(), and MSPModel_JuPedSim::PState::PState().

◆ myEdgePos

double MSPModel_InteractingState::myEdgePos = 0.
protected

◆ myLane

const MSLane* MSPModel_InteractingState::myLane = nullptr
protected

◆ myPerson

MSPerson* MSPModel_InteractingState::myPerson = nullptr
protected

the person who is being represented

Definition at line 215 of file MSPModel_Interacting.h.

Referenced by getID(), getPerson(), and MSPModel_Striping::PState::PState().

◆ myPosLat

◆ myRemoteXYPos

Position MSPModel_InteractingState::myRemoteXYPos = Position::INVALID
protected

remote-controlled position

Definition at line 237 of file MSPModel_Interacting.h.

Referenced by MSPModel_JuPedSim::PState::getPosition(), and getRemotePosition().

◆ mySpeed

double MSPModel_InteractingState::mySpeed = 0.
protected

the current walking speed

Definition at line 227 of file MSPModel_Interacting.h.

Referenced by getSpeed(), and MSPModel_Striping::PState::PState().

◆ mySpeedLat

double MSPModel_InteractingState::mySpeedLat = 0.
protected

the current lateral walking speed

Definition at line 229 of file MSPModel_Interacting.h.

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

◆ myStage

MSStageMoving* MSPModel_InteractingState::myStage = nullptr
protected

the current stage of this pedestrian

Definition at line 217 of file MSPModel_Interacting.h.

Referenced by getStage(), MSPModel_Striping::PState::PState(), and MSPModel_JuPedSim::PState::setStage().

◆ myWaitingTime

SUMOTime MSPModel_InteractingState::myWaitingTime = 0
protected

the consecutive time spent at speed 0

Definition at line 233 of file MSPModel_Interacting.h.

Referenced by getWaitingTime(), and MSPModel_Striping::PState::PState().

◆ myWaitingToEnter

bool MSPModel_InteractingState::myWaitingToEnter = false
protected

whether the pedestrian is waiting to start its walk

Definition at line 231 of file MSPModel_Interacting.h.

Referenced by isWaitingToEnter(), MSPModel_Striping::PState::PState(), and MSPModel_JuPedSim::PState::setAgentId().


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