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 183 of file MSContainer.cpp.

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

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 188 of file MSContainer.cpp.

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

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 129 of file MSContainer.cpp.

References MSVehicle::getAngle(), and M_PI.

SUMOReal MSTransportable::Stage::getArrivalPos ( ) const
inlineinherited

Definition at line 83 of file MSTransportable.h.

References MSTransportable::Stage::myArrivalPos.

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

returns the container stop from which the container departs

Definition at line 167 of file MSContainer.cpp.

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

returns the destination edge

Definition at line 54 of file MSTransportable.cpp.

Referenced by MSPModel_Striping::moveInDirectionOnLane().

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.

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

get angle of the edge at a certain position

Definition at line 87 of file MSTransportable.cpp.

References MSEdge::getLanes().

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

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

Implements MSTransportable::Stage.

Definition at line 111 of file MSContainer.cpp.

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

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

get position on edge e at length at with orthogonal offset

Definition at line 77 of file MSTransportable.cpp.

References MSEdge::getLanes().

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

Implements MSTransportable::Stage.

Definition at line 105 of file MSContainer.cpp.

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

returns the position of the transportable

Bug:
this fails while vehicle is driving across a junction

Implements MSTransportable::Stage.

Definition at line 120 of file MSContainer.cpp.

References MSContainer::ROADSIDE_OFFSET.

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 157 of file MSContainer.cpp.

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

returns the stage description as a string

Implements MSTransportable::Stage.

Definition at line 162 of file MSContainer.cpp.

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

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

Definition at line 99 of file MSTransportable.h.

References MSTransportable::Stage::myType.

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 myVehicle.

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

time spent waiting for a ride

Implements MSTransportable::Stage.

Definition at line 152 of file MSContainer.cpp.

References MSTransportable::isWaiting4Vehicle().

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

Whether the container waits for a vehicle.

Reimplemented from MSTransportable::Stage.

Definition at line 147 of file MSContainer.cpp.

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 142 of file MSContainer.cpp.

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

Invalidated assignment operator.

void MSContainer::MSContainerStage_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 177 of file MSContainer.cpp.

References OutputDevice::closeTag(), MSTransportable::getDestination(), MSTransportable::getFromEdge(), MSTransportable::getID(), 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.

Referenced by 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.

void MSContainer::MSContainerStage_Driving::setVehicle ( SUMOVehicle v)
inline

assign a vehicle to the container

Definition at line 131 of file MSContainer.h.

References myVehicle.

void MSContainer::MSContainerStage_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 172 of file MSContainer.cpp.

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

Field Documentation

SUMOReal MSTransportable::Stage::myArrivalPos
protectedinherited
SUMOTime MSTransportable::Stage::myArrived
protectedinherited

the time at which this stage ended

Definition at line 181 of file MSTransportable.h.

MSStoppingPlace* MSContainer::MSContainerStage_Driving::myDepartContainerStop
private

The container stop from which the container departs.

Definition at line 169 of file MSContainer.h.

SUMOTime MSTransportable::Stage::myDeparted
protectedinherited

the time at which this stage started

Definition at line 178 of file MSTransportable.h.

const MSEdge& MSTransportable::Stage::myDestination
protectedinherited

the next edge to reach by getting transported

Definition at line 169 of file MSTransportable.h.

MSStoppingPlace* const MSTransportable::Stage::myDestinationStop
protectedinherited

the stop to reach by getting transported (if any)

Definition at line 172 of file MSTransportable.h.

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

const std::set<std::string> MSContainer::MSContainerStage_Driving::myLines
private

the lines to choose from

Definition at line 163 of file MSContainer.h.

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 getVehicle(), and setVehicle().

const MSEdge* MSContainer::MSContainerStage_Driving::myWaitingEdge
private

Definition at line 176 of file MSContainer.h.

SUMOReal MSContainer::MSContainerStage_Driving::myWaitingPos
private

Definition at line 171 of file MSContainer.h.

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.


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