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 abort (MSTransportable *)
 abort this stage (TraCI) More...
 
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...
 
double getAngle (SUMOTime now) const
 Returns the angle of the container. More...
 
double getArrivalPos () const
 
CStategetContainerState () const
 
double getDepartPos () const
 
const MSEdgegetDestination () const
 returns the destination edge More...
 
MSStoppingPlacegetDestinationStop () const
 returns the destination stop (if any) More...
 
const MSEdgegetEdge () const
 Returns the current edge. More...
 
double getEdgeAngle (const MSEdge *e, double at) const
 get angle of the edge at a certain position More...
 
double 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, double at, double offset) const
 get position on edge e at length at with orthogonal offset More...
 
ConstMSEdgeVector getEdges () const
 the edges of the current stage More...
 
const MSEdgegetFromEdge () const
 Returns first edge of the containers route. More...
 
Position getLanePosition (const MSLane *lane, double at, double offset) const
 get position on lane at length at with orthogonal offset More...
 
double 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...
 
double getSpeed () const
 Returns the speed of the container. More...
 
std::string getStageDescription () const
 Returns the current stage description as a string. More...
 
std::string getStageSummary () const
 return string summary of the current stage 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, double speed, double departPos, double 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 bool withRouteLength) const
 Called on writing vehroute output. More...
 
virtual void setArrived (MSNet *net, MSTransportable *transportable, SUMOTime now)
 logs end of the step More...
 
void setDeparted (SUMOTime now)
 logs end of the step More...
 
virtual void setSpeed (double)
 sets the walking speed (ignored in other stages) More...
 
virtual void tripInfoOutput (OutputDevice &os, const MSTransportable *const transportable) const
 Called on writing tripinfo output. More...
 
 ~MSContainerStage_Tranship ()
 destructor More...
 

Protected Attributes

double 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...
 
MSStoppingPlacemyDestinationStop
 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...
 
double 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...
 
double 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 106 of file MSContainer.h.

Constructor & Destructor Documentation

◆ MSContainerStage_Tranship() [1/2]

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

constructor

Definition at line 130 of file MSContainer.cpp.

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

◆ ~MSContainerStage_Tranship()

MSContainer::MSContainerStage_Tranship::~MSContainerStage_Tranship ( )

destructor

Definition at line 141 of file MSContainer.cpp.

◆ MSContainerStage_Tranship() [2/2]

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

Invalidated copy constructor.

Member Function Documentation

◆ abort()

virtual void MSTransportable::Stage::abort ( MSTransportable )
inlinevirtualinherited

abort this stage (TraCI)

Reimplemented in MSTransportable::Stage_Driving, MSTransportable::Stage_Waiting, and MSPerson::MSPersonStage_Walking.

Definition at line 118 of file MSTransportable.h.

◆ beginEventOutput()

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

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

◆ endEventOutput()

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

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

◆ getAngle()

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

Returns the angle of the container.

Implements MSTransportable::Stage.

Definition at line 183 of file MSContainer.cpp.

References CState::getAngle(), and myContainerState.

◆ getArrivalPos()

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

Definition at line 189 of file MSContainer.h.

References MSTransportable::Stage::myArrivalPos.

Referenced by CState::computeTranshipTime().

◆ getContainerState()

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

Definition at line 197 of file MSContainer.h.

◆ getDepartPos()

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

Definition at line 185 of file MSContainer.h.

Referenced by CState::computeTranshipTime().

◆ getDestination()

◆ getDestinationStop()

◆ getEdge()

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

Returns the current edge.

Reimplemented from MSTransportable::Stage.

Definition at line 154 of file MSContainer.cpp.

References myCurrentInternalEdge, and myRouteStep.

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

◆ getEdgeAngle()

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

◆ getEdgePos()

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

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

Reimplemented from MSTransportable::Stage.

Definition at line 173 of file MSContainer.cpp.

References CState::getEdgePos(), and myContainerState.

◆ getEdgePosition()

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

◆ getEdges()

ConstMSEdgeVector MSContainer::MSContainerStage_Tranship::getEdges ( ) const
virtual

the edges of the current stage

Reimplemented from MSTransportable::Stage.

Definition at line 199 of file MSContainer.cpp.

References myRoute.

◆ getFromEdge()

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

Returns first edge of the containers route.

Reimplemented from MSTransportable::Stage.

Definition at line 163 of file MSContainer.cpp.

References myRoute.

Referenced by CState::computeTranshipTime().

◆ getLanePosition()

Position MSTransportable::Stage::getLanePosition ( const MSLane lane,
double  at,
double  offset 
) const
inherited

◆ getMaxSpeed()

double MSContainer::MSContainerStage_Tranship::getMaxSpeed ( ) const
inline

accessors to be used by MSCModel_NonInteracting

Definition at line 181 of file MSContainer.h.

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

◆ getNextRouteEdge()

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

Definition at line 193 of file MSContainer.h.

◆ getPosition()

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

Returns the position of the container.

Implements MSTransportable::Stage.

Definition at line 178 of file MSContainer.cpp.

References CState::getPosition(), and myContainerState.

◆ getSpeed()

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

Returns the speed of the container.

Reimplemented from MSTransportable::Stage.

Definition at line 193 of file MSContainer.cpp.

References CState::getSpeed(), and myContainerState.

◆ getStageDescription()

std::string MSContainer::MSContainerStage_Tranship::getStageDescription ( ) const
inlinevirtual

◆ getStageSummary()

std::string MSContainer::MSContainerStage_Tranship::getStageSummary ( ) const
virtual

return string summary of the current stage

Implements MSTransportable::Stage.

Definition at line 269 of file MSContainer.cpp.

References MSTransportable::Stage::getDestination(), MSTransportable::Stage::getDestinationStop(), and Named::getID().

◆ getStageType()

◆ getToEdge()

const MSEdge * MSContainer::MSContainerStage_Tranship::getToEdge ( ) const

Returns last edge of the containers route.

Definition at line 168 of file MSContainer.cpp.

References myRoute.

Referenced by CState::computeTranshipTime().

◆ getVehicle()

◆ getWaitingTime()

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

Returns the time the container spent waiting.

Reimplemented from MSTransportable::Stage.

Definition at line 188 of file MSContainer.cpp.

◆ isWaiting4Vehicle()

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

Whether the transportable waits for a vehicle.

Reimplemented in MSTransportable::Stage_Driving.

Definition at line 133 of file MSTransportable.h.

◆ isWaitingFor()

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

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

Reimplemented in MSTransportable::Stage_Driving.

Definition at line 113 of file MSTransportable.cpp.

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

◆ moveToNextEdge()

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

◆ operator=()

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

Invalidated assignment operator.

◆ proceed()

void MSContainer::MSContainerStage_Tranship::proceed ( MSNet net,
MSTransportable container,
SUMOTime  now,
Stage previous 
)
virtual

◆ routeOutput()

void MSContainer::MSContainerStage_Tranship::routeOutput ( OutputDevice os,
const bool  withRouteLength 
) 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 222 of file MSContainer.cpp.

References OutputDevice::closeTag(), MSTransportable::Stage::myArrived, MSTransportable::Stage::myDeparted, myRoute, mySpeed, OutputDevice::openTag(), SUMO_ATTR_EDGES, SUMO_ATTR_SPEED, and OutputDevice::writeAttr().

◆ setArrived()

◆ setDeparted()

void MSTransportable::Stage::setDeparted ( SUMOTime  now)
inherited

logs end of the step

Definition at line 101 of file MSTransportable.cpp.

References MSTransportable::Stage::myDeparted.

Referenced by MSTransportable::getVehicleType(), and MSTransportable::Stage::setSpeed().

◆ setSpeed()

virtual void MSTransportable::Stage::setSpeed ( double  )
inlinevirtualinherited

sets the walking speed (ignored in other stages)

Reimplemented in MSPerson::MSPersonStage_Walking.

Definition at line 121 of file MSTransportable.h.

References MSTransportable::Stage::isWaitingFor(), MSTransportable::Stage::setArrived(), and MSTransportable::Stage::setDeparted().

Referenced by MSTransportable::getVehicle().

◆ tripInfoOutput()

void MSContainer::MSContainerStage_Tranship::tripInfoOutput ( OutputDevice os,
const MSTransportable *const  transportable 
) 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 205 of file MSContainer.cpp.

References OutputDevice::closeTag(), MSTransportable::Stage::myArrivalPos, MSTransportable::Stage::myArrived, MSTransportable::Stage::myDeparted, myDepartPos, mySpeed, OutputDevice::openTag(), STEPS2TIME, time2string(), and OutputDevice::writeAttr().

Friends And Related Function Documentation

◆ MSCModel_NonInteracting

friend class MSCModel_NonInteracting
friend

Definition at line 107 of file MSContainer.h.

Field Documentation

◆ myArrivalPos

◆ myArrived

◆ myContainerState

CState* MSContainer::MSContainerStage_Tranship::myContainerState
private

state that is to be manipulated by MSCModel

Definition at line 215 of file MSContainer.h.

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

◆ myCurrentInternalEdge

MSEdge* MSContainer::MSContainerStage_Tranship::myCurrentInternalEdge
private

The current internal edge this container is on or 0.

Definition at line 218 of file MSContainer.h.

Referenced by getEdge(), and moveToNextEdge().

◆ myDeparted

◆ myDepartPos

double MSContainer::MSContainerStage_Tranship::myDepartPos
private

the depart position

Definition at line 209 of file MSContainer.h.

Referenced by MSContainerStage_Tranship(), proceed(), and tripInfoOutput().

◆ myDestination

◆ myDestinationStop

◆ myRoute

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

◆ myRouteStep

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

current step

Definition at line 206 of file MSContainer.h.

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

◆ mySpeed

double MSContainer::MSContainerStage_Tranship::mySpeed
private

the speed of the container

Definition at line 212 of file MSContainer.h.

Referenced by routeOutput(), and tripInfoOutput().

◆ myType

StageType MSTransportable::Stage::myType
protectedinherited

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