SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
MSPerson::MSPersonStage_Driving Class Reference

#include <MSPerson.h>

Inheritance diagram for MSPerson::MSPersonStage_Driving:
MSPerson::MSPersonStage

Public Member Functions

virtual void beginEventOutput (const MSPerson &p, SUMOTime t, OutputDevice &os) const
 Called for writing the events output. More...
 
virtual void endEventOutput (const MSPerson &p, SUMOTime t, OutputDevice &os) const
 Called for writing the events output (end of an action) More...
 
SUMOReal getAngle (SUMOTime now) const
 
const MSEdgegetDestination () const
 returns the destination edge More...
 
const MSEdgegetEdge () const
 Returns the current edge. More...
 
SUMOReal getEdgeAngle (const MSEdge *e, SUMOReal at) const
 
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
 
SUMOReal getSpeed () const
 the time this person spent waiting More...
 
std::string getStageDescription () const
 return string representation of the current stage More...
 
StageType getStageType () const
 
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, MSBusStop *toBS, const std::vector< std::string > &lines)
 constructor More...
 
virtual void proceed (MSNet *net, MSPerson *person, SUMOTime now, MSEdge *previousEdge, const SUMOReal at)
 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

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 (either by walking or driving) 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

MSBusStopmyDestinationBusStop
 
const std::set< std::string > myLines
 the lines to choose from More...
 
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 340 of file MSPerson.h.

Constructor & Destructor Documentation

MSPerson::MSPersonStage_Driving::MSPersonStage_Driving ( const MSEdge destination,
MSBusStop toBS,
const std::vector< std::string > &  lines 
)

constructor

Definition at line 286 of file MSPerson.cpp.

MSPerson::MSPersonStage_Driving::~MSPersonStage_Driving ( )

destructor

Definition at line 292 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 MSPerson 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 MSPerson::MSPersonStage.

Definition at line 410 of file MSPerson.cpp.

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

void MSPerson::MSPersonStage_Driving::endEventOutput ( const MSPerson 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 MSPerson::MSPersonStage.

Definition at line 416 of file MSPerson.cpp.

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

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

Implements MSPerson::MSPersonStage.

Definition at line 331 of file MSPerson.cpp.

References MSVehicle::getAngle().

const MSEdge & MSPerson::MSPersonStage::getDestination ( ) const
inherited

returns the destination edge

Definition at line 70 of file MSPerson.cpp.

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

Returns the current edge.

Implements MSPerson::MSPersonStage.

Definition at line 296 of file MSPerson.cpp.

SUMOReal MSPerson::MSPersonStage::getEdgeAngle ( const MSEdge e,
SUMOReal  at 
) const
inherited
SUMOReal MSPerson::MSPersonStage_Driving::getEdgePos ( SUMOTime  now) const
virtual

Implements MSPerson::MSPersonStage.

Definition at line 311 of file MSPerson.cpp.

References MSPerson::getEdge(), MSEdge::getLength(), and MIN2().

Position MSPerson::MSPersonStage::getEdgePosition ( const MSEdge e,
SUMOReal  at,
SUMOReal  offset 
) const
inherited

get position on edge e at length at with orthogonal offset

Definition at line 96 of file MSPerson.cpp.

References MSEdge::getLanes().

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

Implements MSPerson::MSPersonStage.

Definition at line 305 of file MSPerson.cpp.

Position MSPerson::MSPersonStage::getLanePosition ( const MSLane lane,
SUMOReal  at,
SUMOReal  offset 
) const
inherited

get position on lane at length at with orthogonal offset

Definition at line 102 of file MSPerson.cpp.

References MSLane::getShape(), MSLane::interpolateLanePosToGeometryPos(), and PositionVector::positionAtOffset().

Referenced by MSPModel_NonInteracting::PState::getPosition(), and MSPModel_Striping::PState::getPosition().

Position MSPerson::MSPersonStage_Driving::getPosition ( SUMOTime  now) const
virtual
Bug:
this fails while vehicle is driving across a junction

Implements MSPerson::MSPersonStage.

Definition at line 321 of file MSPerson.cpp.

References MSPModel::SIDEWALK_OFFSET.

SUMOReal MSPerson::MSPersonStage_Driving::getSpeed ( ) const
virtual

the time this person spent waiting

Implements MSPerson::MSPersonStage.

Definition at line 385 of file MSPerson.cpp.

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

return string representation of the current stage

Implements MSPerson::MSPersonStage.

Definition at line 391 of file MSPerson.cpp.

References MSPerson::isWaiting4Vehicle(), and joinToString().

StageType MSPerson::MSPersonStage::getStageType ( ) const
inlineinherited

Definition at line 103 of file MSPerson.h.

References MSPerson::MSPersonStage::myType.

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

time spent waiting for a ride

Implements MSPerson::MSPersonStage.

Definition at line 379 of file MSPerson.cpp.

References MSPerson::isWaiting4Vehicle().

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

Whether the person waits for a vehicle.

Reimplemented from MSPerson::MSPersonStage.

Definition at line 373 of file MSPerson.cpp.

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

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

Reimplemented from MSPerson::MSPersonStage.

Definition at line 367 of file MSPerson.cpp.

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 MSPerson::MSPersonStage.

Definition at line 403 of file MSPerson.cpp.

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

void MSPerson::MSPersonStage::setArrived ( SUMOTime  now)
inherited

logs end of the step

Definition at line 84 of file MSPerson.cpp.

void MSPerson::MSPersonStage::setDeparted ( SUMOTime  now)
inherited

logs end of the step

Definition at line 76 of file MSPerson.cpp.

void MSPerson::MSPersonStage_Driving::setVehicle ( SUMOVehicle v)
inline

Definition at line 375 of file MSPerson.h.

References myVehicle.

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 MSPerson::MSPersonStage.

Definition at line 397 of file MSPerson.cpp.

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

Field Documentation

SUMOTime MSPerson::MSPersonStage::myArrived
protectedinherited

the time at which this stage ended

Definition at line 174 of file MSPerson.h.

SUMOTime MSPerson::MSPersonStage::myDeparted
protectedinherited

the time at which this stage started

Definition at line 171 of file MSPerson.h.

const MSEdge& MSPerson::MSPersonStage::myDestination
protectedinherited

the next edge to reach (either by walking or driving)

Definition at line 168 of file MSPerson.h.

Referenced by MSPerson::MSPersonStage_Waiting::MSPersonStage_Waiting().

MSBusStop* MSPerson::MSPersonStage_Driving::myDestinationBusStop
private

Definition at line 412 of file MSPerson.h.

const std::set<std::string> MSPerson::MSPersonStage_Driving::myLines
private

the lines to choose from

Definition at line 407 of file MSPerson.h.

StageType MSPerson::MSPersonStage::myType
protectedinherited

The type of this stage.

Definition at line 177 of file MSPerson.h.

Referenced by MSPerson::MSPersonStage::getStageType().

SUMOVehicle* MSPerson::MSPersonStage_Driving::myVehicle
private

The taken vehicle.

Definition at line 410 of file MSPerson.h.

Referenced by setVehicle().

const MSEdge* MSPerson::MSPersonStage_Driving::myWaitingEdge
private

Definition at line 416 of file MSPerson.h.

SUMOReal MSPerson::MSPersonStage_Driving::myWaitingPos
private

Definition at line 413 of file MSPerson.h.

SUMOTime MSPerson::MSPersonStage_Driving::myWaitingSince
private

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

Definition at line 415 of file MSPerson.h.


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