Eclipse SUMO - Simulation of Urban MObility
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:
Collaboration diagram for MSPModel_Striping::PState:

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) More...
 
virtual const std::string & getID () const
 return the person id More...
 
double getImpatience (SUMOTime now) const
 returns the impatience More...
 
double getLength () const
 return the length of the pedestrian More...
 
virtual double getMaxX (const bool includeMinGap=true) const
 return the maximum position on the lane More...
 
double getMinGap () const
 return the minimum gap of the pedestrian More...
 
virtual double getMinX (const bool includeMinGap=true) const
 return the minimum position on the lane More...
 
virtual double getWidth () const
 return the person width More...
 
bool ignoreRed (const MSLink *link) const
 whether the pedestrian may ignore a red light More...
 
void mergeObstacles (Obstacles &into, const Obstacles &obs2)
 replace obstacles in the first vector with obstacles from the second if they are closer to me More...
 
bool moveToNextLane (SUMOTime currentTime)
 return whether this pedestrian has passed the end of the current lane and update myRelX if so More...
 
int otherStripe () const
 
int otherStripe (const double relY) const
 
 PState (MSPerson *person, MSPerson::MSPersonStage_Walking *stage, const MSLane *lane)
 
int stripe () const
 
void walk (const Obstacles &obs, SUMOTime currentTime)
 perform position update More...
 
 ~PState ()
 
double getEdgePos (const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
 abstract methods inherited from PedestrianState More...
 
Position getPosition (const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
 return the network coordinate of the person More...
 
double getAngle (const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
 return the direction in which the person faces in degrees More...
 
SUMOTime getWaitingTime (const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const
 return the time the person spent standing More...
 
double getSpeed (const MSPerson::MSPersonStage_Walking &stage) const
 return the current speed of the person More...
 
const MSEdgegetNextEdge (const MSPerson::MSPersonStage_Walking &stage) const
 return the list of internal edges if the pedestrian is on an intersection More...
 
void moveToXY (MSPerson *p, Position pos, MSLane *lane, double lanePos, double lanePosLat, double angle, int routeOffset, const ConstMSEdgeVector &edges, SUMOTime t)
 try to move person to the given position More...
 

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 More...
 
static int stripe (const double relY)
 

Data Fields

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

Protected Member Functions

 PState ()
 constructor for PStateVehicle More...
 

Detailed Description

Container for pedestrian state and individual position update function.

Definition at line 265 of file MSPModel_Striping.h.

Constructor & Destructor Documentation

◆ PState() [1/2]

◆ ~PState()

MSPModel_Striping::PState::~PState ( )
inline

Definition at line 285 of file MSPModel_Striping.h.

◆ PState() [2/2]

MSPModel_Striping::PState::PState ( )
protected

constructor for PStateVehicle

Definition at line 1347 of file MSPModel_Striping.cpp.

Member Function Documentation

◆ distanceTo()

◆ distToLaneEnd()

double MSPModel_Striping::PState::distToLaneEnd ( ) const

◆ getAngle()

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

return the direction in which the person faces in degrees

Implements PedestrianState.

Definition at line 1817 of file MSPModel_Striping.cpp.

References MSPModel::BACKWARD, MSLane::getShape(), M_PI, myAngle, myDir, myLane, myRelX, myWalkingAreaPath, PositionVector::rotationAtOffset(), and MSPModel_Striping::WalkingAreaPath::shape.

◆ getEdgePos()

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

abstract methods inherited from PedestrianState

Implements PedestrianState.

Definition at line 1785 of file MSPModel_Striping.cpp.

References myRelX.

◆ getID()

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

return the person id

Reimplemented in MSPModel_Striping::PStateVehicle.

Definition at line 1982 of file MSPModel_Striping.cpp.

References MSTransportable::getID(), and myPerson.

Referenced by MSPModel_Striping::by_xpos_sorter::operator()().

◆ getImpatience()

◆ getLength()

double MSPModel_Striping::PState::getLength ( ) const

◆ 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 1375 of file MSPModel_Striping.cpp.

References MSPModel::FORWARD, getLength(), getMinGap(), myDir, and myRelX.

Referenced by distanceTo(), MSPModel_Striping::getVehicleObstacles(), and mergeObstacles().

◆ getMinGap()

double MSPModel_Striping::PState::getMinGap ( ) const

return the minimum gap of the pedestrian

Definition at line 1391 of file MSPModel_Striping.cpp.

References MSVehicleType::getMinGap(), MSTransportable::getVehicleType(), and myPerson.

Referenced by getMaxX(), getMinX(), and MSPModel_Striping::moveInDirectionOnLane().

◆ 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 1365 of file MSPModel_Striping.cpp.

References MSPModel::FORWARD, getLength(), getMinGap(), myDir, and myRelX.

Referenced by distanceTo(), MSPModel_Striping::getVehicleObstacles(), and mergeObstacles().

◆ getNextEdge()

const MSEdge * MSPModel_Striping::PState::getNextEdge ( const MSPerson::MSPersonStage_Walking stage) const
virtual

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

Implements PedestrianState.

Definition at line 1848 of file MSPModel_Striping.cpp.

References MSLane::getEdge(), MSPModel_Striping::NextLaneInfo::lane, and myNLI.

◆ getPosition()

◆ getSpeed()

double MSPModel_Striping::PState::getSpeed ( const MSPerson::MSPersonStage_Walking stage) const
virtual

return the current speed of the person

Implements PedestrianState.

Definition at line 1842 of file MSPModel_Striping.cpp.

References mySpeed.

◆ getWaitingTime()

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

return the time the person spent standing

Implements PedestrianState.

Definition at line 1836 of file MSPModel_Striping.cpp.

References myWaitingTime.

◆ getWidth()

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

return the person width

Reimplemented in MSPModel_Striping::PStateVehicle.

Definition at line 1987 of file MSPModel_Striping.cpp.

References MSTransportable::getVehicleType(), MSVehicleType::getWidth(), and myPerson.

Referenced by otherStripe().

◆ ignoreRed()

◆ 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 1923 of file MSPModel_Striping.cpp.

References distanceTo(), gDebugFlag1, getMaxX(), getMinX(), MSPModel_Striping::OBSTACLE_PED, and MSPModel_Striping::OBSTACLE_VEHICLE.

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

◆ 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 1945 of file MSPModel_Striping.cpp.

References MSPModel::FORWARD.

◆ moveToNextLane()

◆ moveToXY()

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

◆ otherStripe() [1/2]

◆ otherStripe() [2/2]

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

◆ stripe() [1/2]

◆ stripe() [2/2]

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

Definition at line 1397 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 1569 of file MSPModel_Striping.cpp.

References MSPModel::BACKWARD, MSPModel_Striping::dawdling, MSPModel_Striping::DEBUG_PRINT(), DEBUGCOND, DELTA_T, DIST2SPEED, MSPModel_Striping::DIST_OVERLAP, distanceTo(), MSPModel::FORWARD, MSPerson::MSPersonStage_Walking::getEdge(), MSLane::getEdge(), Named::getID(), MSTransportable::getID(), MSNet::getInstance(), MSPerson::MSPersonStage_Walking::getMaxSpeed(), MSNet::getPersonControl(), MSPerson::MSPersonStage_Walking::getWaitingTime(), MSPModel_Striping::INAPPROPRIATE_PENALTY, MSEdge::isCrossing(), MSEdge::isWalkingArea(), MSPModel_Striping::jamTime, MSPModel_Striping::jamTimeCrossing, 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, myAmJammed, myAngle, myDir, myLane, myPerson, myRelX, myRelY, mySpeed, myStage, myWaitingTime, myWaitingToEnter, NUMERICAL_EPS, 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, otherStripe(), RandHelper::rand(), MSTransportableControl::registerJammed(), MSPModel_Striping::RESERVE_FOR_ONCOMING_FACTOR, MSPModel_Striping::RESERVE_FOR_ONCOMING_FACTOR_JUNCTIONS, SIMTIME, SPEED2DIST, stripe(), MSPModel_Striping::stripeWidth, SUMO_const_haltingSpeed, time2string(), toString(), and WRITE_WARNING.

Referenced by MSPModel_Striping::moveInDirectionOnLane().

Field Documentation

◆ myAmJammed

bool MSPModel_Striping::PState::myAmJammed

whether the person is jammed

Definition at line 307 of file MSPModel_Striping.h.

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

◆ myAngle

double MSPModel_Striping::PState::myAngle
mutable

cached angle

Definition at line 311 of file MSPModel_Striping.h.

Referenced by getAngle(), moveToXY(), and walk().

◆ myDir

◆ myLane

◆ myNLI

NextLaneInfo MSPModel_Striping::PState::myNLI

information about the upcoming lane

Definition at line 303 of file MSPModel_Striping.h.

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

◆ myPerson

◆ myRelX

◆ myRelY

◆ myRemoteXYPos

Position MSPModel_Striping::PState::myRemoteXYPos

remote-controlled position

Definition at line 309 of file MSPModel_Striping.h.

Referenced by moveToXY().

◆ mySpeed

double MSPModel_Striping::PState::mySpeed

the current walking speed

Definition at line 297 of file MSPModel_Striping.h.

Referenced by getSpeed(), MSPModel_Striping::moveInDirection(), MSPModel_Striping::moveInDirectionOnLane(), and walk().

◆ myStage

◆ myWaitingTime

SUMOTime MSPModel_Striping::PState::myWaitingTime

the consecutive time spent at speed 0

Definition at line 301 of file MSPModel_Striping.h.

Referenced by MSPModel_Striping::blockedAtDist(), getWaitingTime(), and walk().

◆ myWaitingToEnter

bool MSPModel_Striping::PState::myWaitingToEnter

◆ myWalkingAreaPath


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