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

#include <MSContainer.h>

Inheritance diagram for MSContainer::MSContainerStage_Tranship:
Inheritance graph
Collaboration diagram for MSContainer::MSContainerStage_Tranship:
Collaboration graph

Public Member Functions

virtual void beginEventOutput (const MSTransportable &c, SUMOTime t, OutputDevice &os) const
 Called for writing the events output. More...
 
virtual void endEventOutput (const MSTransportable &c, 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 container. More...
 
SUMOReal getArrivalPos () const
 
CStategetContainerState () const
 
MSStoppingPlacegetDepartContainerStop () const
 returns the container stop from which the container departs More...
 
SUMOReal getDepartPos () 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
 Returns the offset from the start of the current edge measured in its natural direction. More...
 
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
 Returns first edge of the containers route. More...
 
Position getLanePosition (const MSLane *lane, SUMOReal at, SUMOReal offset) const
 get position on lane at length at with orthogonal offset More...
 
SUMOReal getMaxSpeed () const
 accessors to be used by MSCModel_NonInteracting More...
 
const MSEdgegetNextRouteEdge () const
 
Position getPosition (SUMOTime now) const
 Returns the position of the container. More...
 
SUMOReal getSpeed () const
 Returns the speed of the container. More...
 
std::string getStageDescription () const
 Returns the current stage description as a string. More...
 
StageType getStageType () const
 
const MSEdgegetToEdge () const
 Returns last edge of the containers route. More...
 
virtual SUMOVehiclegetVehicle () const
 Whether the transportable waits for a vehicle. More...
 
SUMOTime getWaitingTime (SUMOTime now) const
 Returns the time the container spent waiting. More...
 
virtual bool isWaiting4Vehicle () const
 Whether the transportable waits for a vehicle. More...
 
virtual bool isWaitingFor (const std::string &line) const
 Whether the transportable waits for a vehicle of the line specified. More...
 
bool moveToNextEdge (MSTransportable *container, SUMOTime currentTime, MSEdge *nextInternal=0)
 move forward and return whether the container arrived More...
 
 MSContainerStage_Tranship (const std::vector< const MSEdge * > &route, MSStoppingPlace *toStop, SUMOReal speed, SUMOReal departPos, SUMOReal arrivalPos)
 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...
 
virtual void tripInfoOutput (OutputDevice &os) const
 Called on writing tripinfo output. More...
 
 ~MSContainerStage_Tranship ()
 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_Tranship (const MSContainerStage_Tranship &)
 Invalidated copy constructor. More...
 
MSContainerStage_Transhipoperator= (const MSContainerStage_Tranship &)
 Invalidated assignment operator. More...
 

Private Attributes

CStatemyContainerState
 state that is to be manipulated by MSCModel More...
 
MSEdgemyCurrentInternalEdge
 The current internal edge this container is on or 0. More...
 
MSStoppingPlacemyDepartContainerStop
 The container stop from which the container departs. More...
 
SUMOReal myDepartPos
 the depart position More...
 
std::vector< const MSEdge * > myRoute
 The route of the container. More...
 
std::vector< const MSEdge * >::iterator myRouteStep
 current step More...
 
SUMOReal mySpeed
 the speed of the container More...
 

Friends

class MSCModel_NonInteracting
 

Detailed Description

A "real" stage performing the tranship of a container A container is in this stage if it gets transhipred between two stops that are assumed to be connected.

Definition at line 294 of file MSContainer.h.

Constructor & Destructor Documentation

MSContainer::MSContainerStage_Tranship::MSContainerStage_Tranship ( const std::vector< const MSEdge * > &  route,
MSStoppingPlace toStop,
SUMOReal  speed,
SUMOReal  departPos,
SUMOReal  arrivalPos 
)

constructor

Definition at line 293 of file MSContainer.cpp.

References SUMOVehicleParameter::interpretEdgePos(), myDepartPos, myRoute, and SUMO_ATTR_DEPARTPOS.

MSContainer::MSContainerStage_Tranship::~MSContainerStage_Tranship ( )

destructor

Definition at line 304 of file MSContainer.cpp.

MSContainer::MSContainerStage_Tranship::MSContainerStage_Tranship ( const MSContainerStage_Tranship )
private

Invalidated copy constructor.

Member Function Documentation

void MSContainer::MSContainerStage_Tranship::beginEventOutput ( const MSTransportable c,
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 381 of file MSContainer.cpp.

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

void MSContainer::MSContainerStage_Tranship::endEventOutput ( const MSTransportable c,
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 388 of file MSContainer.cpp.

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

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

Returns the angle of the container.

Implements MSTransportable::Stage.

Definition at line 347 of file MSContainer.cpp.

References CState::getAngle(), and myContainerState.

SUMOReal MSContainer::MSContainerStage_Tranship::getArrivalPos ( ) const
inline

Definition at line 376 of file MSContainer.h.

References MSTransportable::Stage::myArrivalPos.

Referenced by CState::computeTranshipTime().

CState* MSContainer::MSContainerStage_Tranship::getContainerState ( ) const
inline

Definition at line 384 of file MSContainer.h.

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

returns the container stop from which the container departs

Definition at line 362 of file MSContainer.cpp.

References myDepartContainerStop.

SUMOReal MSContainer::MSContainerStage_Tranship::getDepartPos ( ) const
inline

Definition at line 372 of file MSContainer.h.

Referenced by CState::computeTranshipTime().

const MSStoppingPlace* MSTransportable::Stage::getDestinationStop ( ) const
inlineinherited
const MSEdge * MSContainer::MSContainerStage_Tranship::getEdge ( ) const
virtual

Returns the current edge.

Implements MSTransportable::Stage.

Definition at line 318 of file MSContainer.cpp.

References myCurrentInternalEdge, and myRouteStep.

Referenced by CState::getAngle(), and moveToNextEdge().

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

Returns the offset from the start of the current edge measured in its natural direction.

Implements MSTransportable::Stage.

Definition at line 337 of file MSContainer.cpp.

References CState::getEdgePos(), and myContainerState.

Position MSTransportable::Stage::getEdgePosition ( const MSEdge e,
SUMOReal  at,
SUMOReal  offset 
) const
inherited
const MSEdge * MSContainer::MSContainerStage_Tranship::getFromEdge ( ) const
virtual

Returns first edge of the containers route.

Implements MSTransportable::Stage.

Definition at line 327 of file MSContainer.cpp.

References myRoute.

Referenced by CState::computeTranshipTime().

Position MSTransportable::Stage::getLanePosition ( const MSLane lane,
SUMOReal  at,
SUMOReal  offset 
) const
inherited
SUMOReal MSContainer::MSContainerStage_Tranship::getMaxSpeed ( ) const
inline

accessors to be used by MSCModel_NonInteracting

Definition at line 368 of file MSContainer.h.

Referenced by CState::computeTranshipTime(), CState::getPosition(), and CState::getSpeed().

const MSEdge* MSContainer::MSContainerStage_Tranship::getNextRouteEdge ( ) const
inline

Definition at line 380 of file MSContainer.h.

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

Returns the position of the container.

Implements MSTransportable::Stage.

Definition at line 342 of file MSContainer.cpp.

References CState::getPosition(), myContainerState, and SUMOReal.

SUMOReal MSContainer::MSContainerStage_Tranship::getSpeed ( ) const
virtual

Returns the speed of the container.

Implements MSTransportable::Stage.

Definition at line 357 of file MSContainer.cpp.

References CState::getSpeed(), and myContainerState.

std::string MSContainer::MSContainerStage_Tranship::getStageDescription ( ) const
inlinevirtual
const MSEdge * MSContainer::MSContainerStage_Tranship::getToEdge ( ) const

Returns last edge of the containers route.

Definition at line 332 of file MSContainer.cpp.

References myRoute, and SUMOReal.

Referenced by CState::computeTranshipTime().

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

Returns the time the container spent waiting.

Implements MSTransportable::Stage.

Definition at line 352 of file MSContainer.cpp.

References SUMOReal.

virtual bool MSTransportable::Stage::isWaiting4Vehicle ( ) const
inlinevirtualinherited

Whether the transportable waits for a vehicle.

Reimplemented in MSPerson::MSPersonStage_Driving, and MSContainer::MSContainerStage_Driving.

Definition at line 119 of file MSTransportable.h.

bool MSTransportable::Stage::isWaitingFor ( const std::string &  line) const
virtualinherited

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

Reimplemented in MSPerson::MSPersonStage_Driving, and MSContainer::MSContainerStage_Driving.

Definition at line 72 of file MSTransportable.cpp.

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

bool MSContainer::MSContainerStage_Tranship::moveToNextEdge ( MSTransportable container,
SUMOTime  currentTime,
MSEdge nextInternal = 0 
)
MSContainerStage_Tranship& MSContainer::MSContainerStage_Tranship::operator= ( const MSContainerStage_Tranship )
private

Invalidated assignment operator.

void MSContainer::MSContainerStage_Tranship::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 373 of file MSContainer.cpp.

References OutputDevice::closeTag(), myRoute, mySpeed, OutputDevice::openTag(), SUMO_ATTR_EDGES, SUMO_ATTR_SPEED, 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 MSContainer::MSContainerStage_Tranship::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 367 of file MSContainer.cpp.

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

Friends And Related Function Documentation

friend class MSCModel_NonInteracting
friend

Definition at line 295 of file MSContainer.h.

Field Documentation

CState* MSContainer::MSContainerStage_Tranship::myContainerState
private

state that is to be manipulated by MSCModel

Definition at line 405 of file MSContainer.h.

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

MSEdge* MSContainer::MSContainerStage_Tranship::myCurrentInternalEdge
private

The current internal edge this container is on or 0.

Definition at line 408 of file MSContainer.h.

Referenced by getEdge(), and moveToNextEdge().

MSStoppingPlace* MSContainer::MSContainerStage_Tranship::myDepartContainerStop
private

The container stop from which the container departs.

Definition at line 399 of file MSContainer.h.

Referenced by getDepartContainerStop().

SUMOTime MSTransportable::Stage::myDeparted
protectedinherited
SUMOReal MSContainer::MSContainerStage_Tranship::myDepartPos
private

the depart position

Definition at line 396 of file MSContainer.h.

Referenced by MSContainerStage_Tranship(), and proceed().

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(), MSPerson::MSPersonStage_Walking::moveToNextEdge(), and moveToNextEdge().

std::vector<const MSEdge*> MSContainer::MSContainerStage_Tranship::myRoute
private

The route of the container.

Definition at line 390 of file MSContainer.h.

Referenced by beginEventOutput(), endEventOutput(), getFromEdge(), getToEdge(), moveToNextEdge(), MSContainerStage_Tranship(), proceed(), and routeOutput().

std::vector<const MSEdge*>::iterator MSContainer::MSContainerStage_Tranship::myRouteStep
private

current step

Definition at line 393 of file MSContainer.h.

Referenced by getEdge(), moveToNextEdge(), and proceed().

SUMOReal MSContainer::MSContainerStage_Tranship::mySpeed
private

the speed of the container

Definition at line 402 of file MSContainer.h.

Referenced by routeOutput().

StageType MSTransportable::Stage::myType
protectedinherited

The type of this stage.

Definition at line 184 of file MSTransportable.h.

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


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