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

#include <MSContainer.h>

Inheritance diagram for MSContainer::MSContainerStage_Driving:
MSContainer::MSContainerStage

Public Member Functions

virtual void beginEventOutput (const MSContainer &container, SUMOTime t, OutputDevice &os) const
 Called for writing the events output. More...
 
virtual void endEventOutput (const MSContainer &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...
 
MSContainerStopgetDepartContainerStop () const
 returns the container stop from which the container departs More...
 
const MSEdgegetDestination () const
 returns the destination edge 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 container 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
 
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, MSContainerStop *toCS, const std::vector< std::string > &lines)
 constructor More...
 
virtual void proceed (MSNet *net, MSContainer *container, 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)
 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

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

MSContainerStopmyDepartContainerStop
 The container stop from which the container departs. More...
 
MSContainerStopmyDestinationContainerStop
 The destination container stop. 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 205 of file MSContainer.h.

Constructor & Destructor Documentation

MSContainer::MSContainerStage_Driving::MSContainerStage_Driving ( const MSEdge destination,
MSContainerStop toCS,
const std::vector< std::string > &  lines 
)

constructor

Definition at line 110 of file MSContainer.cpp.

MSContainer::MSContainerStage_Driving::~MSContainerStage_Driving ( )

destructor

Definition at line 116 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 MSContainer 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 MSContainer::MSContainerStage.

Definition at line 226 of file MSContainer.cpp.

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

void MSContainer::MSContainerStage_Driving::endEventOutput ( const MSContainer 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 MSContainer::MSContainerStage.

Definition at line 231 of file MSContainer.cpp.

References MSContainer::getEdge(), Named::getID(), MSContainer::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 MSContainer::MSContainerStage.

Definition at line 172 of file MSContainer.cpp.

References MSVehicle::getAngle().

MSContainerStop * MSContainer::MSContainerStage_Driving::getDepartContainerStop ( ) const
virtual

returns the container stop from which the container departs

Implements MSContainer::MSContainerStage.

Definition at line 210 of file MSContainer.cpp.

const MSEdge & MSContainer::MSContainerStage::getDestination ( ) const
inherited

returns the destination edge

Definition at line 68 of file MSContainer.cpp.

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

Returns the current edge.

Implements MSContainer::MSContainerStage.

Definition at line 139 of file MSContainer.cpp.

SUMOReal MSContainer::MSContainerStage::getEdgeAngle ( const MSEdge e,
SUMOReal  at 
) const
inherited

get angle of the edge at a certain position

Definition at line 100 of file MSContainer.cpp.

References MSEdge::getLanes(), and PositionVector::rotationDegreeAtOffset().

Referenced by CState::getAngle().

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

Implements MSContainer::MSContainerStage.

Definition at line 154 of file MSContainer.cpp.

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

Position MSContainer::MSContainerStage::getEdgePosition ( const MSEdge e,
SUMOReal  at,
SUMOReal  offset 
) const
inherited

get position on edge e at length at with orthogonal offset

Definition at line 90 of file MSContainer.cpp.

References MSEdge::getLanes().

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

Implements MSContainer::MSContainerStage.

Definition at line 148 of file MSContainer.cpp.

Position MSContainer::MSContainerStage::getLanePosition ( const MSLane lane,
SUMOReal  at,
SUMOReal  offset 
) const
inherited

get position on lane at length at with orthogonal offset

Definition at line 95 of file MSContainer.cpp.

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

Referenced by CState::computeTranshipTime().

Position MSContainer::MSContainerStage_Driving::getPosition ( SUMOTime  now) const
virtual

returns the position of the container

Bug:
this fails while vehicle is driving across a junction

Implements MSContainer::MSContainerStage.

Definition at line 163 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 MSContainer::MSContainerStage.

Definition at line 200 of file MSContainer.cpp.

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

returns the stage description as a string

Implements MSContainer::MSContainerStage.

Definition at line 205 of file MSContainer.cpp.

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

StageType MSContainer::MSContainerStage::getStageType ( ) const
inlineinherited

Definition at line 108 of file MSContainer.h.

References MSContainer::MSContainerStage::myType.

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

time spent waiting for a ride

Implements MSContainer::MSContainerStage.

Definition at line 195 of file MSContainer.cpp.

References MSContainer::isWaiting4Vehicle().

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

Whether the container waits for a vehicle.

Reimplemented from MSContainer::MSContainerStage.

Definition at line 190 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 MSContainer::MSContainerStage.

Definition at line 185 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 MSContainer::MSContainerStage.

Definition at line 220 of file MSContainer.cpp.

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

void MSContainer::MSContainerStage::setArrived ( SUMOTime  now)
inherited

logs end of the step

Definition at line 80 of file MSContainer.cpp.

void MSContainer::MSContainerStage::setDeparted ( SUMOTime  now)
inherited

logs end of the step

Definition at line 73 of file MSContainer.cpp.

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

assign a vehicle to the container

Definition at line 252 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 MSContainer::MSContainerStage.

Definition at line 215 of file MSContainer.cpp.

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

Field Documentation

SUMOTime MSContainer::MSContainerStage::myArrived
protectedinherited

the time at which this stage ended

Definition at line 186 of file MSContainer.h.

MSContainerStop* MSContainer::MSContainerStage_Driving::myDepartContainerStop
private

The container stop from which the container departs.

Definition at line 293 of file MSContainer.h.

SUMOTime MSContainer::MSContainerStage::myDeparted
protectedinherited

the time at which this stage started

Definition at line 183 of file MSContainer.h.

const MSEdge& MSContainer::MSContainerStage::myDestination
protectedinherited

the next edge to reach by getting transported

Definition at line 180 of file MSContainer.h.

Referenced by MSContainer::MSContainerStage_Waiting::MSContainerStage_Waiting().

MSContainerStop* MSContainer::MSContainerStage_Driving::myDestinationContainerStop
private

The destination container stop.

Definition at line 290 of file MSContainer.h.

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

the lines to choose from

Definition at line 284 of file MSContainer.h.

StageType MSContainer::MSContainerStage::myType
protectedinherited

The type of this stage.

Definition at line 189 of file MSContainer.h.

Referenced by MSContainer::MSContainerStage::getStageType().

SUMOVehicle* MSContainer::MSContainerStage_Driving::myVehicle
private

The taken vehicle.

Definition at line 287 of file MSContainer.h.

Referenced by setVehicle().

const MSEdge* MSContainer::MSContainerStage_Driving::myWaitingEdge
private

Definition at line 300 of file MSContainer.h.

SUMOReal MSContainer::MSContainerStage_Driving::myWaitingPos
private

Definition at line 295 of file MSContainer.h.

SUMOTime MSContainer::MSContainerStage_Driving::myWaitingSince
private

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

Definition at line 298 of file MSContainer.h.


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