Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MSPModel_NonInteracting::PState Class Reference

implementation of callbacks to retrieve various state information from the model More...

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

Public Member Functions

virtual SUMOTime computeDuration (const MSEdge *prev, const MSStageMoving &stage, SUMOTime currentTime)
 compute walking time on edge and update state members
MoveToNextEdgegetCommand () const
SUMOTime getEventTime () const
virtual const MSLanegetLane () const
 the current lane of the transportable
virtual double getPathLength () const
 return the total length of the current lane (in particular for on a walkingarea)
virtual SUMOTime getTotalWaitingTime () const
virtual bool isFinished () const
 whether the transportable has finished walking
virtual bool isJammed () const
 whether the transportable is jammed
virtual void moveTo (MSPerson *p, MSLane *lane, double lanePos, double lanePosLat, SUMOTime t)
 try to move transportable to the given position
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
 PState (MoveToNextEdge *cmd, std::istringstream *in=nullptr)
void saveState (std::ostringstream &out)
 Saves the current state into the given stream.
double getEdgePos (SUMOTime now) const
 abstract methods inherited from PedestrianState
int getDirection () const
 return the walking direction (FORWARD, BACKWARD, UNDEFINED_DIRECTION)
virtual Position getPosition (const MSStageMoving &stage, SUMOTime now) const
 return the network coordinate of the transportable
virtual double getAngle (const MSStageMoving &stage, SUMOTime now) const
 return the direction in which the transportable faces in degrees
SUMOTime getWaitingTime () const
 return the time the transportable spent standing consecutively
double getSpeed (const MSStageMoving &stage) const
 return the current speed of the transportable
const MSEdgegetNextEdge (const MSStageMoving &stage) const
 return the list of internal edges if the transportable is on an intersection

Protected Attributes

MoveToNextEdgemyCommand
double myCurrentBeginPos
SUMOTime myCurrentDuration
double myCurrentEndPos
SUMOTime myLastEntryTime

Detailed Description

implementation of callbacks to retrieve various state information from the model

Definition at line 106 of file MSPModel_NonInteracting.h.

Constructor & Destructor Documentation

◆ PState()

MSPModel_NonInteracting::PState::PState ( MoveToNextEdge * cmd,
std::istringstream * in = nullptr )

Definition at line 111 of file MSPModel_NonInteracting.cpp.

References myCommand, myCurrentDuration, and myLastEntryTime.

Referenced by MSPModel_NonInteracting::CState::CState().

Here is the caller graph for this function:

Member Function Documentation

◆ computeDuration()

SUMOTime MSPModel_NonInteracting::PState::computeDuration ( const MSEdge * prev,
const MSStageMoving & stage,
SUMOTime currentTime )
virtual

◆ getAngle()

double MSPModel_NonInteracting::PState::getAngle ( const MSStageMoving & stage,
SUMOTime now ) const
virtual

return the direction in which the transportable faces in degrees

Implements MSTransportableStateAdapter.

Reimplemented in MSPModel_NonInteracting::CState.

Definition at line 186 of file MSPModel_NonInteracting.cpp.

References MSStageMoving::getEdge(), MSStage::getEdgeAngle(), getEdgePos(), M_PI, myCurrentBeginPos, and myCurrentEndPos.

◆ getCommand()

MoveToNextEdge * MSPModel_NonInteracting::PState::getCommand ( ) const
inline

Definition at line 126 of file MSPModel_NonInteracting.h.

References myCommand.

◆ getDirection()

int MSPModel_NonInteracting::PState::getDirection ( ) const
virtual

return the walking direction (FORWARD, BACKWARD, UNDEFINED_DIRECTION)

Implements MSTransportableStateAdapter.

Definition at line 159 of file MSPModel_NonInteracting.cpp.

References MSPModel::BACKWARD, MSPModel::FORWARD, myCurrentBeginPos, myCurrentEndPos, and MSPModel::UNDEFINED_DIRECTION.

◆ getEdgePos()

double MSPModel_NonInteracting::PState::getEdgePos ( SUMOTime now) const
virtual

abstract methods inherited from PedestrianState

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

Implements MSTransportableStateAdapter.

Definition at line 153 of file MSPModel_NonInteracting.cpp.

References myCurrentBeginPos, myCurrentDuration, myCurrentEndPos, and myLastEntryTime.

Referenced by MSPModel_NonInteracting::CState::getAngle(), getAngle(), and getPosition().

Here is the caller graph for this function:

◆ getEventTime()

SUMOTime MSPModel_NonInteracting::PState::getEventTime ( ) const
inline

Definition at line 130 of file MSPModel_NonInteracting.h.

References myCurrentDuration, and myLastEntryTime.

Referenced by MSPModel_NonInteracting::loadState().

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_InteractingState.

Definition at line 220 of file MSPModel.h.

Referenced by MSPModel_Interacting::remove().

Here is the caller graph for this function:

◆ getNextEdge()

const MSEdge * MSPModel_NonInteracting::PState::getNextEdge ( const MSStageMoving & stage) const
virtual

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

Implements MSTransportableStateAdapter.

Definition at line 203 of file MSPModel_NonInteracting.cpp.

References MSStageMoving::getNextRouteEdge().

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

◆ getPosition()

Position MSPModel_NonInteracting::PState::getPosition ( const MSStageMoving & stage,
SUMOTime now ) const
virtual

◆ getSpeed()

double MSPModel_NonInteracting::PState::getSpeed ( const MSStageMoving & stage) const
virtual

return the current speed of the transportable

Implements MSTransportableStateAdapter.

Definition at line 197 of file MSPModel_NonInteracting.cpp.

References MSStageMoving::getMaxSpeed(), and myCommand.

◆ getTotalWaitingTime()

virtual SUMOTime MSTransportableStateAdapter::getTotalWaitingTime ( ) const
inlinevirtualinherited

Reimplemented in MSPModel_InteractingState.

Definition at line 173 of file MSPModel.h.

◆ getWaitingTime()

SUMOTime MSPModel_NonInteracting::PState::getWaitingTime ( ) const
inlinevirtual

return the time the transportable spent standing consecutively

Implements MSTransportableStateAdapter.

Definition at line 117 of file MSPModel_NonInteracting.h.

◆ isFinished()

virtual bool MSTransportableStateAdapter::isFinished ( ) const
inlinevirtualinherited

whether the transportable has finished walking

Reimplemented in MSPModel_JuPedSim::PState.

Definition at line 215 of file MSPModel.h.

◆ isJammed()

virtual bool MSTransportableStateAdapter::isJammed ( ) const
inlinevirtualinherited

whether the transportable is jammed

Reimplemented in MSPModel_InteractingState.

Definition at line 210 of file MSPModel.h.

Referenced by MSPerson::isJammed().

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

References TL, UNUSED_PARAMETER, and WRITE_WARNING.

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

Here is the caller graph for this function:

◆ saveState()

void MSPModel_NonInteracting::PState::saveState ( std::ostringstream & out)
virtual

Saves the current state into the given stream.

Reimplemented from MSTransportableStateAdapter.

Definition at line 209 of file MSPModel_NonInteracting.cpp.

References myCurrentDuration, and myLastEntryTime.

Field Documentation

◆ myCommand

MoveToNextEdge* MSPModel_NonInteracting::PState::myCommand
protected

Definition at line 143 of file MSPModel_NonInteracting.h.

Referenced by computeDuration(), getCommand(), getSpeed(), and PState().

◆ myCurrentBeginPos

double MSPModel_NonInteracting::PState::myCurrentBeginPos
protected

◆ myCurrentDuration

SUMOTime MSPModel_NonInteracting::PState::myCurrentDuration
protected

◆ myCurrentEndPos

double MSPModel_NonInteracting::PState::myCurrentEndPos
protected

◆ myLastEntryTime


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