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

#include <MSPerson.h>

Inheritance diagram for MSPerson::MSPersonStage_Driving:
Inheritance graph
Collaboration diagram for MSPerson::MSPersonStage_Driving:
Collaboration graph

Public Member Functions

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...
 
SUMOReal getAngle (SUMOTime now) const
 returns the angle of the transportable More...
 
SUMOReal getArrivalPos () const
 
const MSEdgegetDestination () const
 returns the destination edge More...
 
const MSStoppingPlacegetDestinationStop () const
 returns the destination stop (if any) More...
 
const MSEdgegetEdge () const
 Returns the current edge. More...
 
SUMOReal getEdgeAngle (const MSEdge *e, SUMOReal at) const
 get angle of the edge at a certain position More...
 
SUMOReal getEdgePos (SUMOTime now) const
 
Position getEdgePosition (const MSEdge *e, SUMOReal at, SUMOReal offset) const
 get position on edge e at length at with orthogonal offset More...
 
const MSEdgegetFromEdge () const
 
Position getLanePosition (const MSLane *lane, SUMOReal at, SUMOReal 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...
 
SUMOReal getSpeed () const
 the speed of the transportable More...
 
std::string getStageDescription () const
 return string representation of the current stage More...
 
StageType getStageType () const
 
SUMOVehiclegetVehicle () const
 The vehicle the person is riding or 0. More...
 
SUMOTime getWaitingTime (SUMOTime now) const
 time spent waiting for a ride More...
 
bool isWaiting4Vehicle () const
 Whether the person waits for a vehicle. More...
 
bool isWaitingFor (const std::string &line) const
 Whether the person waits for a vehicle of the line specified. More...
 
 MSPersonStage_Driving (const MSEdge &destination, MSStoppingPlace *toStop, const SUMOReal arrivalPos, const std::vector< std::string > &lines)
 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 setVehicle (SUMOVehicle *v)
 
virtual void tripInfoOutput (OutputDevice &os) const
 Called on writing tripinfo output. More...
 
 ~MSPersonStage_Driving ()
 destructor More...
 

Protected Attributes

SUMOReal 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...
 
MSStoppingPlace *const myDestinationStop
 the stop to reach by getting transported (if any) More...
 
StageType myType
 The type of this stage. More...
 

Private Member Functions

 MSPersonStage_Driving (const MSPersonStage_Driving &)
 Invalidated copy constructor. More...
 
MSPersonStage_Drivingoperator= (const MSPersonStage_Driving &)
 Invalidated assignment operator. More...
 

Private Attributes

const std::set< std::string > myLines
 the lines to choose from More...
 
Position myStopWaitPos
 
SUMOVehiclemyVehicle
 The taken vehicle. More...
 
const MSEdgemyWaitingEdge
 
SUMOReal myWaitingPos
 
SUMOTime myWaitingSince
 The time since which this person is waiting for a ride. More...
 

Detailed Description

A "real" stage performing the travelling by a transport system The given route will be chosen. The travel time is computed by the simulation

Definition at line 219 of file MSPerson.h.

Constructor & Destructor Documentation

MSPerson::MSPersonStage_Driving::MSPersonStage_Driving ( const MSEdge destination,
MSStoppingPlace toStop,
const SUMOReal  arrivalPos,
const std::vector< std::string > &  lines 
)

constructor

Definition at line 225 of file MSPerson.cpp.

MSPerson::MSPersonStage_Driving::~MSPersonStage_Driving ( )

destructor

Definition at line 231 of file MSPerson.cpp.

MSPerson::MSPersonStage_Driving::MSPersonStage_Driving ( const MSPersonStage_Driving )
private

Invalidated copy constructor.

Member Function Documentation

void MSPerson::MSPersonStage_Driving::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 358 of file MSPerson.cpp.

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

void MSPerson::MSPersonStage_Driving::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 364 of file MSPerson.cpp.

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

SUMOReal MSPerson::MSPersonStage_Driving::getAngle ( SUMOTime  now) const
virtual

returns the angle of the transportable

Implements MSTransportable::Stage.

Definition at line 273 of file MSPerson.cpp.

References MSVehicle::getAngle(), MSTransportable::Stage::getEdgeAngle(), isWaiting4Vehicle(), M_PI, myVehicle, myWaitingEdge, and myWaitingPos.

const MSStoppingPlace* MSTransportable::Stage::getDestinationStop ( ) const
inlineinherited

returns the destination stop (if any)

Definition at line 79 of file MSTransportable.h.

References MSTransportable::Stage::myDestinationStop.

Referenced by MSPModel_Striping::moveInDirectionOnLane(), MSContainer::MSContainerStage_Driving::proceed(), and proceed().

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

Returns the current edge.

Implements MSTransportable::Stage.

Definition at line 235 of file MSPerson.cpp.

References SUMOVehicle::getEdge(), myVehicle, and myWaitingEdge.

Referenced by beginEventOutput(), endEventOutput(), and getEdgePos().

SUMOReal MSPerson::MSPersonStage_Driving::getEdgePos ( SUMOTime  now) const
virtual
Position MSTransportable::Stage::getEdgePosition ( const MSEdge e,
SUMOReal  at,
SUMOReal  offset 
) const
inherited
const MSEdge * MSPerson::MSPersonStage_Driving::getFromEdge ( ) const
virtual

Implements MSTransportable::Stage.

Definition at line 244 of file MSPerson.cpp.

References myWaitingEdge, and SUMOReal.

Referenced by routeOutput().

Position MSTransportable::Stage::getLanePosition ( const MSLane lane,
SUMOReal  at,
SUMOReal  offset 
) const
inherited
Position MSPerson::MSPersonStage_Driving::getPosition ( SUMOTime  now) const
virtual
SUMOReal MSPerson::MSPersonStage_Driving::getSpeed ( ) const
virtual

the speed of the transportable

Implements MSTransportable::Stage.

Definition at line 333 of file MSPerson.cpp.

References SUMOVehicle::getSpeed(), isWaiting4Vehicle(), and myVehicle.

std::string MSPerson::MSPersonStage_Driving::getStageDescription ( ) const
virtual

return string representation of the current stage

Implements MSTransportable::Stage.

Definition at line 339 of file MSPerson.cpp.

References isWaiting4Vehicle(), joinToString(), and myLines.

SUMOVehicle* MSPerson::MSPersonStage_Driving::getVehicle ( ) const
inlinevirtual

The vehicle the person is riding or 0.

Reimplemented from MSTransportable::Stage.

Definition at line 250 of file MSPerson.h.

References MSPerson::MSPersonStage_Walking::getSpeed(), MSPerson::MSPersonStage_Walking::getWaitingTime(), and SUMOReal.

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

time spent waiting for a ride

Implements MSTransportable::Stage.

Definition at line 327 of file MSPerson.cpp.

References isWaiting4Vehicle(), myWaitingSince, and SUMOReal.

bool MSPerson::MSPersonStage_Driving::isWaiting4Vehicle ( ) const
virtual

Whether the person waits for a vehicle.

Reimplemented from MSTransportable::Stage.

Definition at line 321 of file MSPerson.cpp.

References myVehicle.

Referenced by getAngle(), getEdgePos(), getPosition(), getSpeed(), getStageDescription(), and getWaitingTime().

bool MSPerson::MSPersonStage_Driving::isWaitingFor ( const std::string &  line) const
virtual

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

Reimplemented from MSTransportable::Stage.

Definition at line 315 of file MSPerson.cpp.

References myLines.

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

Invalidated assignment operator.

void MSPerson::MSPersonStage_Driving::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 351 of file MSPerson.cpp.

References OutputDevice::closeTag(), MSTransportable::Stage::getDestination(), getFromEdge(), MSTransportable::getID(), myLines, OutputDevice::openTag(), SUMO_ATTR_FROM, SUMO_ATTR_LINES, SUMO_ATTR_TO, and OutputDevice::writeAttr().

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

logs end of the step

Definition at line 67 of file MSTransportable.cpp.

References MSTransportable::Stage::myArrived.

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

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

logs end of the step

Definition at line 60 of file MSTransportable.cpp.

References MSTransportable::Stage::myDeparted.

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

void MSPerson::MSPersonStage_Driving::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 345 of file MSPerson.cpp.

References OutputDevice::closeTag(), MSTransportable::Stage::myArrived, MSTransportable::Stage::myDeparted, OutputDevice::openTag(), time2string(), and OutputDevice::writeAttr().

Field Documentation

SUMOTime MSTransportable::Stage::myDeparted
protectedinherited

the time at which this stage started

Definition at line 178 of file MSTransportable.h.

Referenced by MSTransportable::Stage::setDeparted(), MSContainer::MSContainerStage_Driving::tripInfoOutput(), and tripInfoOutput().

MSStoppingPlace* const MSTransportable::Stage::myDestinationStop
protectedinherited
const std::set<std::string> MSPerson::MSPersonStage_Driving::myLines
private

the lines to choose from

Definition at line 291 of file MSPerson.h.

Referenced by getStageDescription(), isWaitingFor(), proceed(), and routeOutput().

Position MSPerson::MSPersonStage_Driving::myStopWaitPos
private

Definition at line 300 of file MSPerson.h.

Referenced by getPosition(), and proceed().

StageType MSTransportable::Stage::myType
protectedinherited

The type of this stage.

Definition at line 184 of file MSTransportable.h.

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

SUMOVehicle* MSPerson::MSPersonStage_Driving::myVehicle
private

The taken vehicle.

Definition at line 294 of file MSPerson.h.

Referenced by getAngle(), getEdge(), getEdgePos(), getPosition(), getSpeed(), isWaiting4Vehicle(), and proceed().

const MSEdge* MSPerson::MSPersonStage_Driving::myWaitingEdge
private

Definition at line 299 of file MSPerson.h.

Referenced by getAngle(), getEdge(), getFromEdge(), getPosition(), and proceed().

SUMOReal MSPerson::MSPersonStage_Driving::myWaitingPos
private

Definition at line 296 of file MSPerson.h.

Referenced by getAngle(), getEdgePos(), getPosition(), and proceed().

SUMOTime MSPerson::MSPersonStage_Driving::myWaitingSince
private

The time since which this person is waiting for a ride.

Definition at line 298 of file MSPerson.h.

Referenced by getWaitingTime(), and proceed().


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