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

#include <MSPerson.h>

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

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...
 
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...
 
const MSEdge & getDestination () const
 returns the destination edge More...
 
const MSStoppingPlace * getDestinationStop () const
 returns the destination stop (if any) More...
 
const MSEdge * getEdge () 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 MSEdge * getFromEdge () const
 
Position getLanePosition (const MSLane *lane, double at, double offset) const
 get position on lane at length at with orthogonal offset More...
 
Position getPosition (SUMOTime now) const
 returns the position of the transportable More...
 
double getSpeed () const
 the speed of the transportable More...
 
std::string getStageDescription () const
 return string representation of the current stage More...
 
StageType getStageType () const
 
virtual SUMOVehicle * getVehicle () 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 std::string &line) const
 Whether the transportable waits for a vehicle of the line specified. More...
 
bool moveToNextEdge (MSPerson *person, SUMOTime currentTime, MSEdge *nextInternal=0)
 move forward and return whether the person arrived More...
 
 MSPersonStage_Walking (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
 Called on writing vehroute output. More...
 
void setArrived (SUMOTime now)
 logs end of the step More...
 
void setDeparted (SUMOTime now)
 logs end of the step More...
 
void setSpeed (double speed)
 sets the walking speed (ignored in other stages) More...
 
virtual void tripInfoOutput (OutputDevice &os) const
 Called on writing tripinfo output. More...
 
 ~MSPersonStage_Walking ()
 destructor More...
 
double getMaxSpeed () const
 accessors to be used by MSPModel More...
 
double getDepartPos () const
 
double getDepartPosLat () const
 
double getArrivalPos () const
 
const MSEdge * getRouteEdge () const
 
const MSEdge * getNextRouteEdge () const
 
const ConstMSEdgeVector & getRoute () const
 
PedestrianState * getPedestrianState () const
 

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 MSEdge & myDestination
 the next edge to reach by getting transported More...
 
MSStoppingPlace *const myDestinationStop
 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_Walking & operator= (const MSPersonStage_Walking &)
 Invalidated assignment operator. More...
 
double walkDistance () const
 compute total walking distance More...
 

Private Attributes

MSEdge * myCurrentInternalEdge
 The current internal edge this person is on or 0. More...
 
double myDepartPos
 
double myDepartPosLat
 
PedestrianState * myPedestrianState
 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...
 

Friends

class GUIPerson
 
class MSPModel
 

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 77 of file MSPerson.h.

Constructor & Destructor Documentation

MSPerson::MSPersonStage_Walking::MSPersonStage_Walking ( const ConstMSEdgeVector &  route,
MSStoppingPlace *  toStop,
SUMOTime  walkingTime,
double  speed,
double  departPos,
double  arrivalPos,
double  departPosLat 
)
MSPerson::MSPersonStage_Walking::~MSPersonStage_Walking ( )

destructor

Definition at line 78 of file MSPerson.cpp.

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

Invalidated copy constructor.

Member Function Documentation

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

abort this stage (TraCI)

Reimplemented from MSTransportable::Stage.

Definition at line 159 of file MSPerson.cpp.

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

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 230 of file MSPerson.cpp.

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

Referenced by getStageDescription().

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

Definition at line 171 of file MSPerson.cpp.

References myWalkingTime, STEPS2TIME, and walkDistance().

Referenced by getPedestrianState(), MSPersonStage_Walking(), and proceed().

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 237 of file MSPerson.cpp.

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

Referenced by getStageDescription().

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

returns the angle of the transportable

Implements MSTransportable::Stage.

Definition at line 111 of file MSPerson.cpp.

References PedestrianState::getAngle(), and myPedestrianState.

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().

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

Definition at line 156 of file MSPerson.h.

References myDepartPosLat.

const MSStoppingPlace* MSTransportable::Stage::getDestinationStop ( ) const
inlineinherited
const MSEdge * MSPerson::MSPersonStage_Walking::getEdge ( ) const
virtual
double MSTransportable::Stage::getEdgeAngle ( const MSEdge *  e,
double  at 
) const
inherited
double MSPerson::MSPersonStage_Walking::getEdgePos ( SUMOTime  now) const
virtual

Implements MSTransportable::Stage.

Definition at line 99 of file MSPerson.cpp.

References PedestrianState::getEdgePos(), and myPedestrianState.

Position MSTransportable::Stage::getEdgePosition ( const MSEdge *  e,
double  at,
double  offset 
) const
inherited
ConstMSEdgeVector MSPerson::MSPersonStage_Walking::getEdges ( ) const
virtual

the edges of the current stage

Implements MSTransportable::Stage.

Definition at line 129 of file MSPerson.cpp.

References myRoute.

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

Implements MSTransportable::Stage.

Definition at line 93 of file MSPerson.cpp.

References myRoute.

Position MSTransportable::Stage::getLanePosition ( const MSLane *  lane,
double  at,
double  offset 
) const
inherited
PedestrianState* MSPerson::MSPersonStage_Walking::getPedestrianState ( ) const
inline
Position MSPerson::MSPersonStage_Walking::getPosition ( SUMOTime  now) const
virtual

returns the position of the transportable

Implements MSTransportable::Stage.

Definition at line 105 of file MSPerson.cpp.

References PedestrianState::getPosition(), and myPedestrianState.

const ConstMSEdgeVector& MSPerson::MSPersonStage_Walking::getRoute ( ) const
inline
const MSEdge* MSPerson::MSPersonStage_Walking::getRouteEdge ( ) const
inline

Definition at line 164 of file MSPerson.h.

References myRouteStep.

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

the speed of the transportable

Implements MSTransportable::Stage.

Definition at line 123 of file MSPerson.cpp.

References PedestrianState::getSpeed(), and myPedestrianState.

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

return string representation of the current stage

Implements MSTransportable::Stage.

Definition at line 115 of file MSPerson.h.

References beginEventOutput(), endEventOutput(), moveToNextEdge(), routeOutput(), and tripInfoOutput().

StageType MSTransportable::Stage::getStageType ( ) const
inlineinherited
SUMOTime MSPerson::MSPersonStage_Walking::getWaitingTime ( SUMOTime  now) const
virtual

the time this transportable spent waiting

Implements MSTransportable::Stage.

Definition at line 117 of file MSPerson.cpp.

References PedestrianState::getWaitingTime(), and myPedestrianState.

Referenced by MSPModel_Striping::PState::getImpatience(), and MSPModel_Striping::PState::walk().

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

Whether the transportable waits for a vehicle.

Reimplemented in MSTransportable::Stage_Driving.

Definition at line 133 of file MSTransportable.h.

bool MSTransportable::Stage::isWaitingFor ( const std::string &  line) const
virtualinherited

Whether the transportable waits for a vehicle of the line specified.

Reimplemented in MSTransportable::Stage_Driving.

Definition at line 79 of file MSTransportable.cpp.

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

bool MSPerson::MSPersonStage_Walking::moveToNextEdge ( MSPerson *  person,
SUMOTime  currentTime,
MSEdge *  nextInternal = 0 
)
MSPersonStage_Walking& MSPerson::MSPersonStage_Walking::operator= ( const MSPersonStage_Walking &  )
private

Invalidated assignment operator.

Referenced by MSPerson::isSelected().

void MSPerson::MSPersonStage_Walking::routeOutput ( OutputDevice &  os) const
virtual

Called on writing vehroute output.

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

Implements MSTransportable::Stage.

Definition at line 218 of file MSPerson.cpp.

References OutputDevice::closeTag(), myRoute, mySpeed, myWalkingTime, OutputDevice::openTag(), SUMO_ATTR_DURATION, SUMO_ATTR_EDGES, SUMO_ATTR_SPEED, time2string(), and OutputDevice::writeAttr().

Referenced by getStageDescription().

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

logs end of the step

Definition at line 74 of file MSTransportable.cpp.

References MSTransportable::Stage::myArrived.

Referenced by MSContainer::proceed(), MSPerson::proceed(), and MSTransportable::Stage::setSpeed().

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

logs end of the step

Definition at line 67 of file MSTransportable.cpp.

References MSTransportable::Stage::myDeparted.

Referenced by MSTransportable::getVehicleType(), and MSTransportable::Stage::setSpeed().

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

sets the walking speed (ignored in other stages)

Reimplemented from MSTransportable::Stage.

Definition at line 165 of file MSPerson.cpp.

References mySpeed.

void MSPerson::MSPersonStage_Walking::tripInfoOutput ( OutputDevice &  os) 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 207 of file MSPerson.cpp.

References MSDevice_Tripinfo::addPedestrianData(), OutputDevice::closeTag(), MSTransportable::Stage::myArrivalPos, MSTransportable::Stage::myArrived, MSTransportable::Stage::myDeparted, OutputDevice::openTag(), time2string(), toString(), walkDistance(), and OutputDevice::writeAttr().

Referenced by getStageDescription().

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

compute total walking distance

XXX internal edges not included

Definition at line 177 of file MSPerson.cpp.

References MAX2(), MSTransportable::Stage::myArrivalPos, myDepartPos, myRoute, and POSITION_EPS.

Referenced by computeAverageSpeed(), getPedestrianState(), and tripInfoOutput().

Friends And Related Function Documentation

friend class GUIPerson
friend

Definition at line 79 of file MSPerson.h.

friend class MSPModel
friend

Definition at line 78 of file MSPerson.h.

Field Documentation

MSEdge* MSPerson::MSPersonStage_Walking::myCurrentInternalEdge
private

The current internal edge this person is on or 0.

Definition at line 201 of file MSPerson.h.

Referenced by getEdge(), and moveToNextEdge().

double MSPerson::MSPersonStage_Walking::myDepartPos
private

Definition at line 203 of file MSPerson.h.

Referenced by getDepartPos(), MSPersonStage_Walking(), proceed(), and walkDistance().

double MSPerson::MSPersonStage_Walking::myDepartPosLat
private

Definition at line 204 of file MSPerson.h.

Referenced by getDepartPosLat().

const MSEdge& MSTransportable::Stage::myDestination
protectedinherited
MSStoppingPlace* const MSTransportable::Stage::myDestinationStop
protectedinherited

the stop to reach by getting transported (if any)

Definition at line 189 of file MSTransportable.h.

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

PedestrianState* MSPerson::MSPersonStage_Walking::myPedestrianState
private

state that is to be manipulated by MSPModel

Definition at line 208 of file MSPerson.h.

Referenced by abort(), getAngle(), getEdgePos(), getPedestrianState(), getPosition(), getSpeed(), getWaitingTime(), and proceed().

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

Definition at line 198 of file MSPerson.h.

Referenced by getEdge(), getNextRouteEdge(), getRouteEdge(), moveToNextEdge(), and proceed().

double MSPerson::MSPersonStage_Walking::mySpeed
private

Definition at line 205 of file MSPerson.h.

Referenced by getMaxSpeed(), MSPersonStage_Walking(), proceed(), routeOutput(), and setSpeed().

StageType MSTransportable::Stage::myType
protectedinherited
SUMOTime MSPerson::MSPersonStage_Walking::myWalkingTime
private

the time the person is walking

Definition at line 192 of file MSPerson.h.

Referenced by computeAverageSpeed(), proceed(), and routeOutput().


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