Eclipse SUMO - Simulation of Urban MObility
MSPerson::MSPersonStage_Walking Class Reference

#include <MSPerson.h>

Inheritance diagram for MSPerson::MSPersonStage_Walking:
Collaboration diagram for MSPerson::MSPersonStage_Walking:

Data Structures

class  arrival_finder
 

Public Member Functions

void abort (MSTransportable *)
 abort this stage (TraCI) More...
 
virtual void beginEventOutput (const MSTransportable &p, SUMOTime t, OutputDevice &os) const
 Called for writing the events output. More...
 
Stageclone () const
 
virtual void endEventOutput (const MSTransportable &p, SUMOTime t, OutputDevice &os) const
 Called for writing the events output (end of an action) More...
 
double getAngle (SUMOTime now) const
 returns the angle of the transportable More...
 
double getArrivalPos () const
 
SUMOTime getDeparted () const
 get departure time of stage More...
 
double getDepartPos () const
 
double getDepartPosLat () const
 
const MSEdgegetDestination () const
 returns the destination edge More...
 
MSStoppingPlacegetDestinationStop () const
 returns the destination stop (if any) More...
 
double getDistance () const
 get travel distance in this stage More...
 
const MSEdgegetEdge () const
 Returns the current edge. More...
 
double getEdgeAngle (const MSEdge *e, double at) const
 get angle of the edge at a certain position More...
 
double getEdgePos (SUMOTime now) const
 
Position getEdgePosition (const MSEdge *e, double at, double offset) const
 get position on edge e at length at with orthogonal offset More...
 
ConstMSEdgeVector getEdges () const
 the edges of the current stage More...
 
const MSEdgegetFromEdge () const
 
Position getLanePosition (const MSLane *lane, double at, double offset) const
 get position on lane at length at with orthogonal offset More...
 
double getMaxSpeed (const MSTransportable *const person) const
 accessors to be used by MSPModel More...
 
const MSEdgegetNextRouteEdge () const
 
virtual const MSStoppingPlacegetOriginStop () const
 returns the origin stop (if any). only needed for Stage_Trip More...
 
PedestrianStategetPedestrianState () const
 
Position getPosition (SUMOTime now) const
 returns the position of the transportable More...
 
const ConstMSEdgeVectorgetRoute () const
 
const MSEdgegetRouteEdge () const
 
const std::vector< const MSEdge * >::iterator getRouteStep () const
 
double getSpeed () const
 the speed of the transportable More...
 
std::string getStageDescription () const
 return (brief) string representation of the current stage More...
 
std::string getStageSummary () const
 return string summary of the current stage More...
 
StageType getStageType () const
 
virtual SUMOVehiclegetVehicle () const
 Whether the transportable waits for a vehicle. More...
 
SUMOTime getWaitingTime (SUMOTime now) const
 the time this transportable spent waiting More...
 
virtual bool isWaiting4Vehicle () const
 Whether the transportable waits for a vehicle. More...
 
virtual bool isWaitingFor (const SUMOVehicle *vehicle) const
 Whether the transportable waits for the given vehicle. More...
 
bool moveToNextEdge (MSPerson *person, SUMOTime currentTime, MSEdge *nextInternal=nullptr)
 move forward and return whether the person arrived More...
 
 MSPersonStage_Walking (const std::string &personID, const ConstMSEdgeVector &route, MSStoppingPlace *toStop, SUMOTime walkingTime, double speed, double departPos, double arrivalPos, double departPosLat)
 constructor More...
 
virtual void proceed (MSNet *net, MSTransportable *person, SUMOTime now, Stage *previous)
 proceeds to the next step More...
 
virtual void routeOutput (OutputDevice &os, const bool withRouteLength) const
 Called on writing vehroute output. More...
 
virtual void setArrived (MSNet *net, MSTransportable *transportable, SUMOTime now)
 logs end of the step More...
 
void setDeparted (SUMOTime now)
 logs end of the step More...
 
void setDestination (const MSEdge *newDestination, MSStoppingPlace *newDestStop)
 
void setRouteIndex (MSPerson *person, int routeOffset)
 place person on a previously passed edge More...
 
void setSpeed (double speed)
 sets the walking speed (ignored in other stages) More...
 
virtual void tripInfoOutput (OutputDevice &os, const MSTransportable *const transportable) const
 Called on writing tripinfo output. More...
 
 ~MSPersonStage_Walking ()
 destructor More...
 

Protected Attributes

double myArrivalPos
 the position at which we want to arrive More...
 
SUMOTime myArrived
 the time at which this stage ended More...
 
SUMOTime myDeparted
 the time at which this stage started More...
 
const MSEdgemyDestination
 the next edge to reach by getting transported More...
 
MSStoppingPlacemyDestinationStop
 the stop to reach by getting transported (if any) More...
 
StageType myType
 The type of this stage. More...
 

Private Member Functions

double computeAverageSpeed () const
 
 MSPersonStage_Walking (const MSPersonStage_Walking &)
 Invalidated copy constructor. More...
 
MSPersonStage_Walkingoperator= (const MSPersonStage_Walking &)
 Invalidated assignment operator. More...
 
double walkDistance () const
 compute total walking distance More...
 

Private Attributes

MSEdgemyCurrentInternalEdge
 The current internal edge this person is on or 0. More...
 
double myDepartPos
 
double myDepartPosLat
 
SUMOTime myLastEdgeEntryTime
 the time the person entered the edge More...
 
PedestrianStatemyPedestrianState
 state that is to be manipulated by MSPModel More...
 
ConstMSEdgeVector myRoute
 The route of the person. More...
 
ConstMSEdgeVector::iterator myRouteStep
 
double mySpeed
 
SUMOTime myWalkingTime
 the time the person is walking More...
 

Detailed Description

A "real" stage performing the walking to an edge The walking does not need any route as it is not simulated. Only the duration is needed

Definition at line 70 of file MSPerson.h.

Constructor & Destructor Documentation

◆ MSPersonStage_Walking() [1/2]

MSPerson::MSPersonStage_Walking::MSPersonStage_Walking ( const std::string &  personID,
const ConstMSEdgeVector route,
MSStoppingPlace toStop,
SUMOTime  walkingTime,
double  speed,
double  departPos,
double  arrivalPos,
double  departPosLat 
)

◆ ~MSPersonStage_Walking()

MSPerson::MSPersonStage_Walking::~MSPersonStage_Walking ( )

destructor

Definition at line 79 of file MSPerson.cpp.

References MSPerson::myDummyState.

◆ MSPersonStage_Walking() [2/2]

MSPerson::MSPersonStage_Walking::MSPersonStage_Walking ( const MSPersonStage_Walking )
private

Invalidated copy constructor.

Member Function Documentation

◆ abort()

void MSPerson::MSPersonStage_Walking::abort ( MSTransportable )
virtual

abort this stage (TraCI)

Reimplemented from MSTransportable::Stage.

Definition at line 176 of file MSPerson.cpp.

References MSPModel::getModel(), and MSPModel::remove().

◆ beginEventOutput()

void MSPerson::MSPersonStage_Walking::beginEventOutput ( const MSTransportable p,
SUMOTime  t,
OutputDevice os 
) const
virtual

Called for writing the events output.

Parameters
[in]osThe stream to write the information into
Exceptions
IOErrornot yet implemented

Implements MSTransportable::Stage.

Definition at line 313 of file MSPerson.cpp.

References OutputDevice::closeTag(), MSTransportable::getID(), OutputDevice::openTag(), time2string(), and OutputDevice::writeAttr().

◆ clone()

MSTransportable::Stage * MSPerson::MSPersonStage_Walking::clone ( ) const
virtual

Implements MSTransportable::Stage.

Definition at line 86 of file MSPerson.cpp.

◆ computeAverageSpeed()

double MSPerson::MSPersonStage_Walking::computeAverageSpeed ( ) const
private

Definition at line 188 of file MSPerson.cpp.

References STEPS2TIME.

Referenced by MSPersonStage_Walking().

◆ endEventOutput()

void MSPerson::MSPersonStage_Walking::endEventOutput ( const MSTransportable p,
SUMOTime  t,
OutputDevice os 
) const
virtual

Called for writing the events output (end of an action)

Parameters
[in]osThe stream to write the information into
Exceptions
IOErrornot yet implemented

Implements MSTransportable::Stage.

Definition at line 320 of file MSPerson.cpp.

References OutputDevice::closeTag(), MSTransportable::getID(), OutputDevice::openTag(), time2string(), and OutputDevice::writeAttr().

◆ getAngle()

double MSPerson::MSPersonStage_Walking::getAngle ( SUMOTime  now) const
virtual

returns the angle of the transportable

Implements MSTransportable::Stage.

Definition at line 119 of file MSPerson.cpp.

◆ getArrivalPos()

◆ getDeparted()

SUMOTime MSTransportable::Stage::getDeparted ( ) const
inherited

get departure time of stage

Definition at line 108 of file MSTransportable.cpp.

◆ getDepartPos()

double MSPerson::MSPersonStage_Walking::getDepartPos ( ) const
inline

Definition at line 152 of file MSPerson.h.

References myDepartPos.

Referenced by MSPModel_Remote::add(), and MSPModel_NonInteracting::PState::computeWalkingTime().

◆ getDepartPosLat()

double MSPerson::MSPersonStage_Walking::getDepartPosLat ( ) const
inline

Definition at line 156 of file MSPerson.h.

References myDepartPosLat.

◆ getDestination()

const MSEdge * MSTransportable::Stage::getDestination ( ) const
inherited

◆ getDestinationStop()

◆ getDistance()

double MSPerson::MSPersonStage_Walking::getDistance ( ) const
inlinevirtual

get travel distance in this stage

Implements MSTransportable::Stage.

Definition at line 101 of file MSPerson.h.

References walkDistance().

◆ getEdge()

const MSEdge * MSPerson::MSPersonStage_Walking::getEdge ( ) const
virtual

◆ getEdgeAngle()

double MSTransportable::Stage::getEdgeAngle ( const MSEdge e,
double  at 
) const
inherited

get angle of the edge at a certain position

Definition at line 133 of file MSTransportable.cpp.

References MSEdge::getLanes().

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

◆ getEdgePos()

double MSPerson::MSPersonStage_Walking::getEdgePos ( SUMOTime  now) const
virtual

Reimplemented from MSTransportable::Stage.

Definition at line 107 of file MSPerson.cpp.

◆ getEdgePosition()

Position MSTransportable::Stage::getEdgePosition ( const MSEdge e,
double  at,
double  offset 
) const
inherited

get position on edge e at length at with orthogonal offset

Definition at line 123 of file MSTransportable.cpp.

References MSEdge::getLanes().

◆ getEdges()

ConstMSEdgeVector MSPerson::MSPersonStage_Walking::getEdges ( ) const
virtual

the edges of the current stage

Reimplemented from MSTransportable::Stage.

Definition at line 137 of file MSPerson.cpp.

Referenced by libsumo::Person::moveToXY().

◆ getFromEdge()

const MSEdge * MSPerson::MSPersonStage_Walking::getFromEdge ( ) const
virtual

Reimplemented from MSTransportable::Stage.

Definition at line 101 of file MSPerson.cpp.

◆ getLanePosition()

Position MSTransportable::Stage::getLanePosition ( const MSLane lane,
double  at,
double  offset 
) const
inherited

◆ getMaxSpeed()

◆ getNextRouteEdge()

const MSEdge* MSPerson::MSPersonStage_Walking::getNextRouteEdge ( ) const
inline

◆ getOriginStop()

virtual const MSStoppingPlace* MSTransportable::Stage::getOriginStop ( ) const
inlinevirtualinherited

returns the origin stop (if any). only needed for Stage_Trip

Reimplemented in MSTransportable::Stage_Trip.

Definition at line 90 of file MSTransportable.h.

Referenced by MSPerson::MSPersonStage_Driving::proceed().

◆ getPedestrianState()

◆ getPosition()

Position MSPerson::MSPersonStage_Walking::getPosition ( SUMOTime  now) const
virtual

returns the position of the transportable

Implements MSTransportable::Stage.

Definition at line 113 of file MSPerson.cpp.

◆ getRoute()

const ConstMSEdgeVector& MSPerson::MSPersonStage_Walking::getRoute ( ) const
inline

◆ getRouteEdge()

const MSEdge* MSPerson::MSPersonStage_Walking::getRouteEdge ( ) const
inline

Definition at line 168 of file MSPerson.h.

References myRouteStep.

◆ getRouteStep()

const std::vector<const MSEdge*>::iterator MSPerson::MSPersonStage_Walking::getRouteStep ( ) const
inline

Definition at line 164 of file MSPerson.h.

References myRouteStep.

Referenced by libsumo::Person::moveToXY().

◆ getSpeed()

double MSPerson::MSPersonStage_Walking::getSpeed ( ) const
virtual

the speed of the transportable

Reimplemented from MSTransportable::Stage.

Definition at line 131 of file MSPerson.cpp.

◆ getStageDescription()

std::string MSPerson::MSPersonStage_Walking::getStageDescription ( ) const
inlinevirtual

return (brief) string representation of the current stage

Implements MSTransportable::Stage.

Definition at line 112 of file MSPerson.h.

◆ getStageSummary()

std::string MSPerson::MSPersonStage_Walking::getStageSummary ( ) const
virtual

return string summary of the current stage

Implements MSTransportable::Stage.

Definition at line 383 of file MSPerson.cpp.

References MSTransportable::getDestination(), and Named::getID().

◆ getStageType()

StageType MSTransportable::Stage::getStageType ( ) const
inlineinherited

◆ getVehicle()

virtual SUMOVehicle* MSTransportable::Stage::getVehicle ( ) const
inlinevirtualinherited

Whether the transportable waits for a vehicle.

Reimplemented in MSTransportable::Stage_Driving.

Definition at line 147 of file MSTransportable.h.

Referenced by libsumo::Person::getStage().

◆ getWaitingTime()

SUMOTime MSPerson::MSPersonStage_Walking::getWaitingTime ( SUMOTime  now) const
virtual

the time this transportable spent waiting

Reimplemented from MSTransportable::Stage.

Definition at line 125 of file MSPerson.cpp.

◆ isWaiting4Vehicle()

virtual bool MSTransportable::Stage::isWaiting4Vehicle ( ) const
inlinevirtualinherited

Whether the transportable waits for a vehicle.

Reimplemented in MSTransportable::Stage_Driving.

Definition at line 142 of file MSTransportable.h.

◆ isWaitingFor()

bool MSTransportable::Stage::isWaitingFor ( const SUMOVehicle vehicle) const
virtualinherited

Whether the transportable waits for the given vehicle.

Reimplemented in MSTransportable::Stage_Driving.

Definition at line 118 of file MSTransportable.cpp.

◆ moveToNextEdge()

◆ operator=()

MSPersonStage_Walking& MSPerson::MSPersonStage_Walking::operator= ( const MSPersonStage_Walking )
private

Invalidated assignment operator.

◆ proceed()

◆ routeOutput()

void MSPerson::MSPersonStage_Walking::routeOutput ( OutputDevice os,
const bool  withRouteLength 
) const
virtual

Called on writing vehroute output.

Parameters
[in]osThe stream to write the information into
[in]withRouteLengthwhether route length shall be written
Exceptions
IOErrornot yet implemented

Implements MSTransportable::Stage.

Definition at line 291 of file MSPerson.cpp.

References OutputDevice::closeTag(), StringUtils::escapeXML(), OutputDevice::openTag(), SUMO_ATTR_BUS_STOP, SUMO_ATTR_DURATION, SUMO_ATTR_EDGES, SUMO_ATTR_SPEED, time2string(), and OutputDevice::writeAttr().

◆ setArrived()

void MSTransportable::Stage::setArrived ( MSNet net,
MSTransportable transportable,
SUMOTime  now 
)
virtualinherited

◆ setDeparted()

void MSTransportable::Stage::setDeparted ( SUMOTime  now)
inherited

logs end of the step

Definition at line 101 of file MSTransportable.cpp.

◆ setDestination()

void MSTransportable::Stage::setDestination ( const MSEdge newDestination,
MSStoppingPlace newDestStop 
)
inherited

◆ setRouteIndex()

void MSPerson::MSPersonStage_Walking::setRouteIndex ( MSPerson person,
int  routeOffset 
)

place person on a previously passed edge

Definition at line 369 of file MSPerson.cpp.

References MSTransportable::getEdge().

◆ setSpeed()

void MSPerson::MSPersonStage_Walking::setSpeed ( double  speed)
virtual

sets the walking speed (ignored in other stages)

Reimplemented from MSTransportable::Stage.

Definition at line 182 of file MSPerson.cpp.

◆ tripInfoOutput()

void MSPerson::MSPersonStage_Walking::tripInfoOutput ( OutputDevice os,
const MSTransportable *const  transportable 
) const
virtual

Called on writing tripinfo output.

Parameters
[in]osThe stream to write the information into
Exceptions
IOErrornot yet implemented

Implements MSTransportable::Stage.

Definition at line 270 of file MSPerson.cpp.

References MSDevice_Tripinfo::addPedestrianData(), OutputDevice::closeTag(), MSNet::getInstance(), MSTransportable::getMaxSpeed(), OutputDevice::openTag(), TIME2STEPS, time2string(), and OutputDevice::writeAttr().

◆ walkDistance()

double MSPerson::MSPersonStage_Walking::walkDistance ( ) const
private

Field Documentation

◆ myArrivalPos

double MSTransportable::Stage::myArrivalPos
protectedinherited

the position at which we want to arrive

Definition at line 209 of file MSTransportable.h.

Referenced by MSTransportable::Stage::getArrivalPos(), getArrivalPos(), and MSContainer::MSContainerStage_Tranship::getArrivalPos().

◆ myArrived

SUMOTime MSTransportable::Stage::myArrived
protectedinherited

the time at which this stage ended

Definition at line 215 of file MSTransportable.h.

◆ myCurrentInternalEdge

MSEdge* MSPerson::MSPersonStage_Walking::myCurrentInternalEdge
private

The current internal edge this person is on or 0.

Definition at line 208 of file MSPerson.h.

◆ myDeparted

SUMOTime MSTransportable::Stage::myDeparted
protectedinherited

the time at which this stage started

Definition at line 212 of file MSTransportable.h.

◆ myDepartPos

double MSPerson::MSPersonStage_Walking::myDepartPos
private

Definition at line 210 of file MSPerson.h.

Referenced by getDepartPos(), and MSPersonStage_Walking().

◆ myDepartPosLat

double MSPerson::MSPersonStage_Walking::myDepartPosLat
private

Definition at line 211 of file MSPerson.h.

Referenced by getDepartPosLat().

◆ myDestination

const MSEdge* MSTransportable::Stage::myDestination
protectedinherited

the next edge to reach by getting transported

Definition at line 203 of file MSTransportable.h.

◆ myDestinationStop

MSStoppingPlace* MSTransportable::Stage::myDestinationStop
protectedinherited

the stop to reach by getting transported (if any)

Definition at line 206 of file MSTransportable.h.

Referenced by MSTransportable::Stage::getDestinationStop(), and MSPerson::MSPersonStage_Access::MSPersonStage_Access().

◆ myLastEdgeEntryTime

SUMOTime MSPerson::MSPersonStage_Walking::myLastEdgeEntryTime
private

the time the person entered the edge

Definition at line 199 of file MSPerson.h.

◆ myPedestrianState

PedestrianState* MSPerson::MSPersonStage_Walking::myPedestrianState
private

state that is to be manipulated by MSPModel

Definition at line 215 of file MSPerson.h.

Referenced by getPedestrianState().

◆ myRoute

ConstMSEdgeVector MSPerson::MSPersonStage_Walking::myRoute
private

The route of the person.

Definition at line 202 of file MSPerson.h.

Referenced by getNextRouteEdge(), and getRoute().

◆ myRouteStep

ConstMSEdgeVector::iterator MSPerson::MSPersonStage_Walking::myRouteStep
private

Definition at line 205 of file MSPerson.h.

Referenced by getNextRouteEdge(), getRouteEdge(), and getRouteStep().

◆ mySpeed

double MSPerson::MSPersonStage_Walking::mySpeed
private

Definition at line 212 of file MSPerson.h.

Referenced by MSPersonStage_Walking().

◆ myType

StageType MSTransportable::Stage::myType
protectedinherited

The type of this stage.

Definition at line 218 of file MSTransportable.h.

Referenced by MSTransportable::Stage::getStageType().

◆ myWalkingTime

SUMOTime MSPerson::MSPersonStage_Walking::myWalkingTime
private

the time the person is walking

Definition at line 196 of file MSPerson.h.


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