SUMO - Simulation of Urban MObility
MSContainer::MSContainerStage_Driving Class Reference

#include <MSContainer.h>

Inheritance diagram for MSContainer::MSContainerStage_Driving:
Inheritance graph
Collaboration diagram for MSContainer::MSContainerStage_Driving:
Collaboration graph

Public Member Functions

virtual void beginEventOutput (const MSTransportable &container, SUMOTime t, OutputDevice &os) const
 Called for writing the events output. More...
 
virtual void endEventOutput (const MSTransportable &container, SUMOTime t, OutputDevice &os) const
 Called for writing the events output (end of an action) More...
 
SUMOReal getAngle (SUMOTime now) const
 the angle of the vehicle or the angle of the edge + 90deg More...
 
SUMOReal getArrivalPos () const
 
MSStoppingPlacegetDepartContainerStop () const
 returns the container stop from which the container departs More...
 
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 container More...
 
std::string getStageDescription () const
 returns the stage description as a string 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 container waits for a vehicle. More...
 
bool isWaitingFor (const std::string &line) const
 Whether the container waits for a vehicle of the line specified. More...
 
 MSContainerStage_Driving (const MSEdge &destination, MSStoppingPlace *toStop, const SUMOReal arrivalPos, const std::vector< std::string > &lines)
 constructor More...
 
virtual void proceed (MSNet *net, MSTransportable *container, 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)
 assign a vehicle to the container More...
 
virtual void tripInfoOutput (OutputDevice &os) const
 Called on writing tripinfo output. More...
 
 ~MSContainerStage_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

 MSContainerStage_Driving (const MSContainerStage_Driving &)
 Invalidated copy constructor. More...
 
MSContainerStage_Drivingoperator= (const MSContainerStage_Driving &)
 Invalidated assignment operator. More...
 

Private Attributes

MSStoppingPlacemyDepartContainerStop
 The container stop from which the container departs. More...
 
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 container is waiting for a ride. More...
 

Detailed Description

A "real" stage performing the travelling by a transport system A container is in this stage if it is on a ride or if its waiting for a ride. The given route will be chosen. The travel time is computed by the simulation

Definition at line 79 of file MSContainer.h.

Constructor & Destructor Documentation

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

constructor

Definition at line 63 of file MSContainer.cpp.

MSContainer::MSContainerStage_Driving::~MSContainerStage_Driving ( )

destructor

Definition at line 69 of file MSContainer.cpp.

MSContainer::MSContainerStage_Driving::MSContainerStage_Driving ( const MSContainerStage_Driving )
private

Invalidated copy constructor.

Member Function Documentation

void MSContainer::MSContainerStage_Driving::beginEventOutput ( const MSTransportable container,
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 182 of file MSContainer.cpp.

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

Referenced by MSContainer::MSContainerStage_Waiting::getStageDescription(), MSContainer::MSContainerStage_Tranship::getStageDescription(), and setVehicle().

void MSContainer::MSContainerStage_Driving::endEventOutput ( const MSTransportable container,
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 187 of file MSContainer.cpp.

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

Referenced by MSContainer::MSContainerStage_Waiting::getStageDescription(), MSContainer::MSContainerStage_Tranship::getStageDescription(), and setVehicle().

SUMOReal MSContainer::MSContainerStage_Driving::getAngle ( SUMOTime  now) const
virtual

the angle of the vehicle or the angle of the edge + 90deg

Implements MSTransportable::Stage.

Definition at line 128 of file MSContainer.cpp.

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

MSStoppingPlace * MSContainer::MSContainerStage_Driving::getDepartContainerStop ( ) const

returns the container stop from which the container departs

Definition at line 166 of file MSContainer.cpp.

References myDepartContainerStop.

Referenced by MSContainer::MSContainerStage_Waiting::getStageDescription(), MSContainer::MSContainerStage_Tranship::getStageDescription(), and getVehicle().

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(), proceed(), and MSPerson::MSPersonStage_Driving::proceed().

const MSEdge * MSContainer::MSContainerStage_Driving::getEdge ( ) const
virtual

Returns the current edge.

Implements MSTransportable::Stage.

Definition at line 96 of file MSContainer.cpp.

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

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

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

Implements MSTransportable::Stage.

Definition at line 105 of file MSContainer.cpp.

References myWaitingEdge, and SUMOReal.

Referenced by routeOutput().

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

the speed of the container

If the container is still waiting for a ride zero will be returned. If the container is on a ride the speed of the corresponding vehicle will be returned.

Implements MSTransportable::Stage.

Definition at line 156 of file MSContainer.cpp.

References SUMOVehicle::getSpeed(), and myVehicle.

Referenced by getVehicle().

std::string MSContainer::MSContainerStage_Driving::getStageDescription ( ) const
virtual

returns the stage description as a string

Implements MSTransportable::Stage.

Definition at line 161 of file MSContainer.cpp.

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

SUMOVehicle* MSContainer::MSContainerStage_Driving::getVehicle ( ) const
inlinevirtual

The vehicle the person is riding or 0.

Reimplemented from MSTransportable::Stage.

Definition at line 109 of file MSContainer.h.

References getDepartContainerStop(), getSpeed(), getWaitingTime(), isWaiting4Vehicle(), myVehicle, and SUMOReal.

SUMOTime MSContainer::MSContainerStage_Driving::getWaitingTime ( SUMOTime  now) const
virtual

time spent waiting for a ride

Implements MSTransportable::Stage.

Definition at line 151 of file MSContainer.cpp.

References isWaiting4Vehicle(), myWaitingSince, and SUMOReal.

Referenced by getVehicle().

bool MSContainer::MSContainerStage_Driving::isWaiting4Vehicle ( ) const
virtual

Whether the container waits for a vehicle.

Reimplemented from MSTransportable::Stage.

Definition at line 146 of file MSContainer.cpp.

References myVehicle.

Referenced by getStageDescription(), getVehicle(), and getWaitingTime().

bool MSContainer::MSContainerStage_Driving::isWaitingFor ( const std::string &  line) const
virtual

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

Reimplemented from MSTransportable::Stage.

Definition at line 141 of file MSContainer.cpp.

References myLines.

MSContainerStage_Driving& MSContainer::MSContainerStage_Driving::operator= ( const MSContainerStage_Driving )
private

Invalidated assignment operator.

void MSContainer::MSContainerStage_Driving::routeOutput ( OutputDevice os) const
virtual
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 MSContainer::MSContainerStage_Driving::setVehicle ( SUMOVehicle v)
inline

assign a vehicle to the container

Definition at line 131 of file MSContainer.h.

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

void MSContainer::MSContainerStage_Driving::tripInfoOutput ( OutputDevice os) const
virtual

Field Documentation

MSStoppingPlace* MSContainer::MSContainerStage_Driving::myDepartContainerStop
private

The container stop from which the container departs.

Definition at line 169 of file MSContainer.h.

Referenced by getDepartContainerStop().

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(), tripInfoOutput(), and MSPerson::MSPersonStage_Driving::tripInfoOutput().

MSStoppingPlace* const MSTransportable::Stage::myDestinationStop
protectedinherited
const std::set<std::string> MSContainer::MSContainerStage_Driving::myLines
private

the lines to choose from

Definition at line 163 of file MSContainer.h.

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

StageType MSTransportable::Stage::myType
protectedinherited

The type of this stage.

Definition at line 184 of file MSTransportable.h.

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

SUMOVehicle* MSContainer::MSContainerStage_Driving::myVehicle
private

The taken vehicle.

Definition at line 166 of file MSContainer.h.

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

const MSEdge* MSContainer::MSContainerStage_Driving::myWaitingEdge
private

Definition at line 176 of file MSContainer.h.

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

SUMOReal MSContainer::MSContainerStage_Driving::myWaitingPos
private

Definition at line 171 of file MSContainer.h.

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

SUMOTime MSContainer::MSContainerStage_Driving::myWaitingSince
private

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

Definition at line 174 of file MSContainer.h.

Referenced by getWaitingTime(), and proceed().


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