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

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

#include <MSPModel_Striping.h>

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

Public Member Functions

double distanceTo (const Obstacle &obs, const bool includeMinGap=true) const
 
double distToLaneEnd () const
 the absolute distance to the end of the lane in walking direction (or to the arrivalPos)
 
virtual const std::string & getID () const
 return the person id
 
double getImpatience (SUMOTime now) const
 returns the impatience
 
double getLength () const
 return the length of the pedestrian
 
virtual double getMaxX (const bool includeMinGap=true) const
 return the maximum position on the lane
 
double getMinGap () const
 return the minimum gap of the pedestrian
 
virtual double getMinX (const bool includeMinGap=true) const
 return the minimum position on the lane
 
virtual ObstacleType getOType () const
 
virtual double getWidth () const
 return the person width
 
bool ignoreRed (const MSLink *link) const
 whether the pedestrian may ignore a red light
 
bool isRemoteControlled () const
 whether the person is currently being controlled via TraCI
 
void mergeObstacles (Obstacles &into, const Obstacles &obs2)
 replace obstacles in the first vector with obstacles from the second if they are closer to me
 
bool moveToNextLane (SUMOTime currentTime)
 return whether this pedestrian has passed the end of the current lane and update myRelX if so
 
int otherStripe () const
 
int otherStripe (const double relY) const
 
 PState (MSPerson *person, MSStageMoving *stage, const MSLane *lane)
 
 PState (MSPerson *person, MSStageMoving *stage, std::istringstream *in=nullptr)
 constructor for loading state
 
void saveState (std::ostringstream &out)
 Saves the current state into the given stream.
 
int stripe () const
 
void walk (const Obstacles &obs, SUMOTime currentTime)
 perform position update
 
 ~PState ()
 
double getEdgePos (const MSStageMoving &stage, SUMOTime now) const
 abstract methods inherited from PedestrianState
 
int getDirection (const MSStageMoving &stage, SUMOTime now) const
 return the walking direction (FORWARD, BACKWARD)
 
Position getPosition (const MSStageMoving &stage, SUMOTime now) const
 return the network coordinate of the transportable
 
double getAngle (const MSStageMoving &stage, SUMOTime now) const
 return the direction in which the transportable faces in degrees
 
SUMOTime getWaitingTime (const MSStageMoving &stage, SUMOTime now) const
 return the time the transportable spent standing
 
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
 
void moveTo (MSPerson *p, MSLane *lane, double lanePos, double lanePosLat, SUMOTime t)
 try to move transportable to the given position
 
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
 
bool isJammed () const
 whether the transportable is jammed
 
const MSLanegetLane () const
 whether the transportable is jammed
 
double getPathLength () const
 return the total length of the current lane (in particular for on a walkingarea)
 

Static Public Member Functions

static void mergeObstacles (Obstacles &into, const Obstacles &obs2, int dir, int offset)
 replace obstacles in the first vector with obstacles from the second if they are closer in the given direction
 
static int stripe (const double relY)
 

Data Fields

bool myAmJammed
 whether the person is jammed
 
double myAngle
 cached angle
 
int myDir
 the walking direction on the current lane (1 forward, -1 backward)
 
const MSLanemyLane
 the current lane of this pedestrian
 
NextLaneInfo myNLI
 information about the upcoming lane
 
MSPersonmyPerson
 
double myRelX
 the advancement along the current lane
 
double myRelY
 the orthogonal shift on the current lane
 
Position myRemoteXYPos
 remote-controlled position
 
double mySpeed
 the current walking speed
 
double mySpeedLat
 the current lateral walking speed
 
MSStageMovingmyStage
 
SUMOTime myWaitingTime
 the consecutive time spent at speed 0
 
bool myWaitingToEnter
 whether the pedestrian is waiting to start its walk
 
const WalkingAreaPathmyWalkingAreaPath
 the current walkingAreaPath or 0
 

Protected Member Functions

 PState ()
 constructor for PStateVehicle
 

Private Member Functions

PStateoperator= (const PState &)=delete
 Invalidated assignment operator.
 

Detailed Description

Container for pedestrian state and individual position update function.

Definition at line 279 of file MSPModel_Striping.h.

Constructor & Destructor Documentation

◆ PState() [1/3]

◆ PState() [2/3]

MSPModel_Striping::PState::PState ( MSPerson person,
MSStageMoving stage,
std::istringstream *  in = nullptr 
)

◆ ~PState()

MSPModel_Striping::PState::~PState ( )
inline

Definition at line 306 of file MSPModel_Striping.h.

◆ PState() [3/3]

MSPModel_Striping::PState::PState ( )
protected

constructor for PStateVehicle

Definition at line 1644 of file MSPModel_Striping.cpp.

Member Function Documentation

◆ distanceTo()

double MSPModel_Striping::PState::distanceTo ( const Obstacle obs,
const bool  includeMinGap = true 
) const

◆ distToLaneEnd()

double MSPModel_Striping::PState::distToLaneEnd ( ) const

the absolute distance to the end of the lane in walking direction (or to the arrivalPos)

Definition at line 1838 of file MSPModel_Striping.cpp.

References DELTA_T, and MSPModel::FORWARD.

Referenced by MSPModel_Striping::arriveAndAdvance(), and MSPModel_Striping::moveInDirectionOnLane().

Here is the caller graph for this function:

◆ getAngle()

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

return the direction in which the transportable faces in degrees

Implements MSTransportableStateAdapter.

Definition at line 2296 of file MSPModel_Striping.cpp.

References MSPModel::BACKWARD, INVALID_DOUBLE, M_PI, MAX2(), and PositionVector::rotationAtOffset().

◆ getDirection()

int MSPModel_Striping::PState::getDirection ( const MSStageMoving stage,
SUMOTime  now 
) const
virtual

return the walking direction (FORWARD, BACKWARD)

Implements MSTransportableStateAdapter.

Definition at line 2256 of file MSPModel_Striping.cpp.

◆ getEdgePos()

double MSPModel_Striping::PState::getEdgePos ( const MSStageMoving stage,
SUMOTime  now 
) const
virtual

abstract methods inherited from PedestrianState

Implements MSTransportableStateAdapter.

Definition at line 2250 of file MSPModel_Striping.cpp.

◆ getID()

const std::string & MSPModel_Striping::PState::getID ( ) const
virtual

return the person id

Reimplemented in MSPModel_Striping::PStateVehicle.

Definition at line 2613 of file MSPModel_Striping.cpp.

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

Here is the caller graph for this function:

◆ getImpatience()

double MSPModel_Striping::PState::getImpatience ( SUMOTime  now) const

returns the impatience

Definition at line 2243 of file MSPModel_Striping.cpp.

References MAX2(), MSPModel_Striping::MAX_WAIT_TOLERANCE, MIN2(), and STEPS2TIME.

Referenced by MSPModel_Striping::moveInDirectionOnLane().

Here is the caller graph for this function:

◆ getLane()

const MSLane * MSPModel_Striping::PState::getLane ( ) const
virtual

whether the transportable is jammed

Reimplemented from MSTransportableStateAdapter.

Definition at line 2520 of file MSPModel_Striping.cpp.

Referenced by MSPModel_Striping::loadState().

Here is the caller graph for this function:

◆ getLength()

double MSPModel_Striping::PState::getLength ( ) const

return the length of the pedestrian

Definition at line 1789 of file MSPModel_Striping.cpp.

Referenced by MSPModel_Striping::blockedAtDist(), and MSPModel_Striping::moveInDirectionOnLane().

Here is the caller graph for this function:

◆ getMaxX()

double MSPModel_Striping::PState::getMaxX ( const bool  includeMinGap = true) const
virtual

return the maximum position on the lane

Reimplemented in MSPModel_Striping::PStateVehicle.

Definition at line 1779 of file MSPModel_Striping.cpp.

References MSPModel::FORWARD.

Referenced by MSPModel_Striping::getVehicleObstacles().

Here is the caller graph for this function:

◆ getMinGap()

double MSPModel_Striping::PState::getMinGap ( ) const

return the minimum gap of the pedestrian

Definition at line 1795 of file MSPModel_Striping.cpp.

Referenced by MSPModel_Striping::moveInDirectionOnLane().

Here is the caller graph for this function:

◆ getMinX()

double MSPModel_Striping::PState::getMinX ( const bool  includeMinGap = true) const
virtual

return the minimum position on the lane

Reimplemented in MSPModel_Striping::PStateVehicle.

Definition at line 1769 of file MSPModel_Striping.cpp.

References MSPModel::FORWARD.

Referenced by MSPModel_Striping::getVehicleObstacles().

Here is the caller graph for this function:

◆ getNextEdge()

const MSEdge * MSPModel_Striping::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 2336 of file MSPModel_Striping.cpp.

◆ getOType()

virtual ObstacleType MSPModel_Striping::PState::getOType ( ) const
inlinevirtual

Reimplemented in MSPModel_Striping::PStateVehicle.

Definition at line 389 of file MSPModel_Striping.h.

References MSPModel_Striping::OBSTACLE_PED.

◆ getPathLength()

double MSPModel_Striping::PState::getPathLength ( ) const
virtual

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

Reimplemented from MSTransportableStateAdapter.

Definition at line 2525 of file MSPModel_Striping.cpp.

◆ getPosition()

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

return the network coordinate of the transportable

Implements MSTransportableStateAdapter.

Definition at line 2262 of file MSPModel_Striping.cpp.

References DEG2RAD, MSPModel::FORWARD, MSStage::getLanePosition(), Position::INVALID, INVALID_DOUBLE, and MSPModel_Striping::stripeWidth.

Referenced by MSPModel_Striping::getNextLaneObstacles(), and MSPModel_Striping::moveInDirection().

Here is the caller graph for this function:

◆ getSpeed()

double MSPModel_Striping::PState::getSpeed ( const MSStageMoving stage) const
virtual

return the current speed of the transportable

Implements MSTransportableStateAdapter.

Definition at line 2330 of file MSPModel_Striping.cpp.

◆ getWaitingTime()

SUMOTime MSPModel_Striping::PState::getWaitingTime ( const MSStageMoving stage,
SUMOTime  now 
) const
virtual

return the time the transportable spent standing

Implements MSTransportableStateAdapter.

Definition at line 2324 of file MSPModel_Striping.cpp.

◆ getWidth()

double MSPModel_Striping::PState::getWidth ( ) const
virtual

return the person width

Reimplemented in MSPModel_Striping::PStateVehicle.

Definition at line 2618 of file MSPModel_Striping.cpp.

◆ ignoreRed()

bool MSPModel_Striping::PState::ignoreRed ( const MSLink link) const

whether the pedestrian may ignore a red light

Definition at line 2595 of file MSPModel_Striping.cpp.

References DEBUGCOND, MSNet::getInstance(), MSLink::getLastStateChange(), MSLink::haveRed(), SIMTIME, STEPS2TIME, and SUMO_ATTR_JM_DRIVE_AFTER_RED_TIME.

Referenced by MSPModel_Striping::moveInDirectionOnLane().

Here is the caller graph for this function:

◆ isJammed()

bool MSPModel_Striping::PState::isJammed ( ) const
virtual

whether the transportable is jammed

Reimplemented from MSTransportableStateAdapter.

Definition at line 2515 of file MSPModel_Striping.cpp.

◆ isRemoteControlled()

bool MSPModel_Striping::PState::isRemoteControlled ( ) const

whether the person is currently being controlled via TraCI

Definition at line 2624 of file MSPModel_Striping.cpp.

Referenced by MSPModel_Striping::arriveAndAdvance().

Here is the caller graph for this function:

◆ mergeObstacles() [1/2]

void MSPModel_Striping::PState::mergeObstacles ( Obstacles into,
const Obstacles obs2 
)

replace obstacles in the first vector with obstacles from the second if they are closer to me

Definition at line 2554 of file MSPModel_Striping.cpp.

References gDebugFlag1, MSPModel_Striping::OBSTACLE_PED, and MSPModel_Striping::OBSTACLE_VEHICLE.

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

Here is the caller graph for this function:

◆ mergeObstacles() [2/2]

void MSPModel_Striping::PState::mergeObstacles ( Obstacles into,
const Obstacles obs2,
int  dir,
int  offset 
)
static

replace obstacles in the first vector with obstacles from the second if they are closer in the given direction

Definition at line 2576 of file MSPModel_Striping.cpp.

References MSPModel::FORWARD.

◆ moveTo()

◆ moveToNextLane()

bool MSPModel_Striping::PState::moveToNextLane ( SUMOTime  currentTime)

return whether this pedestrian has passed the end of the current lane and update myRelX if so

Definition at line 1852 of file MSPModel_Striping.cpp.

References MSPModel::BACKWARD, DEBUGCOND, MSPModel::FORWARD, MSEdge::getFromJunction(), Named::getID(), Named::getIDSecure(), MSPModel_Striping::getNextLane(), OptionsCont::getOptions(), MSPModel_Striping::getStripeOffset(), MSEdge::getToJunction(), MSPModel_Striping::getWalkingAreaPath(), NORMAL, MSPModel_Striping::numStripes(), SIMTIME, MSPModel_Striping::stripeWidth, TLF, MSPModel::UNDEFINED_DIRECTION, and UNUSED_PARAMETER.

Referenced by MSPModel_Striping::arriveAndAdvance().

Here is the caller graph for this function:

◆ moveToXY()

◆ operator=()

PState & MSPModel_Striping::PState::operator= ( const PState )
privatedelete

Invalidated assignment operator.

◆ otherStripe() [1/2]

int MSPModel_Striping::PState::otherStripe ( ) const

Definition at line 1832 of file MSPModel_Striping.cpp.

References MAX2(), MIN2(), and MSPModel_Striping::numStripes().

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

Here is the caller graph for this function:

◆ otherStripe() [2/2]

int MSPModel_Striping::PState::otherStripe ( const double  relY) const

◆ saveState()

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

Saves the current state into the given stream.

Reimplemented from MSTransportableStateAdapter.

Definition at line 1734 of file MSPModel_Striping.cpp.

◆ stripe() [1/2]

int MSPModel_Striping::PState::stripe ( ) const

Definition at line 1826 of file MSPModel_Striping.cpp.

References MAX2(), MIN2(), and MSPModel_Striping::numStripes().

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

Here is the caller graph for this function:

◆ stripe() [2/2]

int MSPModel_Striping::PState::stripe ( const double  relY)
static

Definition at line 1801 of file MSPModel_Striping.cpp.

References MSPModel_Striping::stripeWidth.

◆ walk()

void MSPModel_Striping::PState::walk ( const Obstacles obs,
SUMOTime  currentTime 
)

perform position update

Definition at line 1991 of file MSPModel_Striping.cpp.

References MSPModel::BACKWARD, MSPModel_Striping::dawdling, DEBUGCOND, DELTA_T, MSPModel_Striping::Obstacle::description, DIST2SPEED, MSPModel_Striping::DIST_OVERLAP, MSPModel::FORWARD, MSNet::getInstance(), MSNet::getPersonControl(), MSPModel_Striping::getReserved(), MSPModel_Striping::INAPPROPRIATE_PENALTY, MSPModel_Striping::jamTime, MSPModel_Striping::jamTimeCrossing, MSPModel_Striping::jamTimeNarrow, MSPModel_Striping::LATERAL_PENALTY, MSPModel_Striping::LATERAL_SPEED_FACTOR, MSPModel_Striping::LOOKAHEAD_ONCOMING, MSPModel_Striping::LOOKAHEAD_SAMEDIR, MAX2(), MIN2(), MIN3(), MSPModel_Striping::MIN_STARTUP_DIST, MSPModel_Striping::myWalkingAreaFoes, MSPModel_Striping::numStripes(), MSPModel_Striping::OBSTACLE_END, MSPModel_Striping::OBSTACLE_PED, MSPModel_Striping::OBSTACLE_VEHICLE, MSPModel_Striping::OBSTRUCTED_PENALTY, MSPModel_Striping::OBSTRUCTION_THRESHOLD, MSPModel_Striping::ONCOMING_CONFLICT_PENALTY, RandHelper::rand(), MSTransportableControl::registerJammed(), MSPModel_Striping::RESERVE_FOR_ONCOMING_FACTOR, MSPModel_Striping::RESERVE_FOR_ONCOMING_FACTOR_JUNCTIONS, SIMSTEP, SIMTIME, MSPModel_Striping::Obstacle::speed, SPEED2DIST, MSPModel_Striping::stripeWidth, SUMO_const_haltingSpeed, SVC_PEDESTRIAN, time2string(), TL, WRITE_WARNINGF, MSPModel_Striping::Obstacle::xBack, and MSPModel_Striping::Obstacle::xFwd.

Referenced by MSPModel_Striping::moveInDirectionOnLane().

Here is the caller graph for this function:

Field Documentation

◆ myAmJammed

bool MSPModel_Striping::PState::myAmJammed

◆ myAngle

double MSPModel_Striping::PState::myAngle
mutable

cached angle

Definition at line 334 of file MSPModel_Striping.h.

◆ myDir

◆ myLane

const MSLane* MSPModel_Striping::PState::myLane

◆ myNLI

NextLaneInfo MSPModel_Striping::PState::myNLI

information about the upcoming lane

Definition at line 326 of file MSPModel_Striping.h.

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

◆ myPerson

◆ myRelX

◆ myRelY

◆ myRemoteXYPos

Position MSPModel_Striping::PState::myRemoteXYPos

remote-controlled position

Definition at line 332 of file MSPModel_Striping.h.

Referenced by MSPModel_Striping::moveInDirectionOnLane().

◆ mySpeed

double MSPModel_Striping::PState::mySpeed

the current walking speed

Definition at line 318 of file MSPModel_Striping.h.

Referenced by MSPModel_Striping::moveInDirection(), MSPModel_Striping::moveInDirectionOnLane(), and PState().

◆ mySpeedLat

double MSPModel_Striping::PState::mySpeedLat

the current lateral walking speed

Definition at line 320 of file MSPModel_Striping.h.

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

◆ myStage

◆ myWaitingTime

SUMOTime MSPModel_Striping::PState::myWaitingTime

the consecutive time spent at speed 0

Definition at line 324 of file MSPModel_Striping.h.

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

◆ myWaitingToEnter

bool MSPModel_Striping::PState::myWaitingToEnter

◆ myWalkingAreaPath

const WalkingAreaPath* MSPModel_Striping::PState::myWalkingAreaPath

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