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

#include <MSContainer.h>

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

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...
 
Stageclone () const
 
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
 
SUMOTime getDeparted () const
 get departure time of stage More...
 
double getDepartPos () const
 
const MSEdgegetDestination () const
 returns the destination edge More...
 
MSStoppingPlacegetDestinationStop () const
 returns the destination stop (if any) More...
 
double getDistance () const
 get travel distance in this stage 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
 
virtual const MSStoppingPlacegetOriginStop () const
 returns the origin stop (if any). only needed for Stage_Trip More...
 
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 SUMOVehicle *vehicle) const
 Whether the transportable waits for the given vehicle. 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...
 
void setDestination (const MSEdge *newDestination, MSStoppingPlace *newDestStop)
 
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 107 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 136 of file MSContainer.cpp.

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

◆ ~MSContainerStage_Tranship()

MSContainer::MSContainerStage_Tranship::~MSContainerStage_Tranship ( )

destructor

Definition at line 150 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

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

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

◆ clone()

MSTransportable::Stage * MSContainer::MSContainerStage_Tranship::clone ( ) const
virtual

Implements MSTransportable::Stage.

Definition at line 154 of file MSContainer.cpp.

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

References OutputDevice::closeTag(), MSTransportable::getID(), 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 200 of file MSContainer.cpp.

◆ getArrivalPos()

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

Definition at line 195 of file MSContainer.h.

References MSTransportable::Stage::myArrivalPos.

Referenced by CState::computeTranshipTime().

◆ getContainerState()

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

Definition at line 203 of file MSContainer.h.

References myContainerState.

Referenced by MSCModel_NonInteracting::MoveToNextEdge::execute().

◆ getDeparted()

SUMOTime MSTransportable::Stage::getDeparted ( ) const
inherited

get departure time of stage

Definition at line 108 of file MSTransportable.cpp.

◆ getDepartPos()

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

Definition at line 191 of file MSContainer.h.

References myDepartPos.

Referenced by CState::computeTranshipTime().

◆ getDestination()

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

◆ getDestinationStop()

◆ getDistance()

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

get travel distance in this stage

Implements MSTransportable::Stage.

Definition at line 221 of file MSContainer.cpp.

References STEPS2TIME.

◆ getEdge()

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

Returns the current edge.

Reimplemented from MSTransportable::Stage.

Definition at line 171 of file MSContainer.cpp.

Referenced by MSCModel_NonInteracting::MoveToNextEdge::execute(), and CState::getAngle().

◆ getEdgeAngle()

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

get angle of the edge at a certain position

Definition at line 133 of file MSTransportable.cpp.

References MSEdge::getLanes().

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

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

◆ getEdgePosition()

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

get position on edge e at length at with orthogonal offset

Definition at line 123 of file MSTransportable.cpp.

References MSEdge::getLanes().

◆ getEdges()

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

the edges of the current stage

Reimplemented from MSTransportable::Stage.

Definition at line 216 of file MSContainer.cpp.

◆ getFromEdge()

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

Returns first edge of the containers route.

Reimplemented from MSTransportable::Stage.

Definition at line 180 of file MSContainer.cpp.

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 187 of file MSContainer.h.

References mySpeed.

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

◆ getNextRouteEdge()

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

Definition at line 199 of file MSContainer.h.

References myRoute, and myRouteStep.

◆ getOriginStop()

virtual const MSStoppingPlace* MSTransportable::Stage::getOriginStop ( ) const
inlinevirtualinherited

returns the origin stop (if any). only needed for Stage_Trip

Reimplemented in MSTransportable::Stage_Trip.

Definition at line 90 of file MSTransportable.h.

Referenced by MSPerson::MSPersonStage_Driving::proceed().

◆ getPosition()

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

Returns the position of the container.

Implements MSTransportable::Stage.

Definition at line 195 of file MSContainer.cpp.

◆ getSpeed()

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

Returns the speed of the container.

Reimplemented from MSTransportable::Stage.

Definition at line 210 of file MSContainer.cpp.

◆ getStageDescription()

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

Returns the current stage description as a string.

Implements MSTransportable::Stage.

Definition at line 153 of file MSContainer.h.

◆ getStageSummary()

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

return string summary of the current stage

Implements MSTransportable::Stage.

Definition at line 292 of file MSContainer.cpp.

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

◆ getStageType()

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

◆ getToEdge()

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

Returns last edge of the containers route.

Definition at line 185 of file MSContainer.cpp.

Referenced by CState::computeTranshipTime().

◆ getVehicle()

virtual SUMOVehicle* MSTransportable::Stage::getVehicle ( ) const
inlinevirtualinherited

Whether the transportable waits for a vehicle.

Reimplemented in MSTransportable::Stage_Driving.

Definition at line 147 of file MSTransportable.h.

Referenced by libsumo::Person::getStage().

◆ getWaitingTime()

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

Returns the time the container spent waiting.

Reimplemented from MSTransportable::Stage.

Definition at line 205 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 142 of file MSTransportable.h.

◆ isWaitingFor()

bool MSTransportable::Stage::isWaitingFor ( const SUMOVehicle vehicle) const
virtualinherited

Whether the transportable waits for the given vehicle.

Reimplemented in MSTransportable::Stage_Driving.

Definition at line 118 of file MSTransportable.cpp.

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

References OutputDevice::closeTag(), OutputDevice::openTag(), SUMO_ATTR_EDGES, SUMO_ATTR_SPEED, and OutputDevice::writeAttr().

◆ setArrived()

void MSTransportable::Stage::setArrived ( MSNet net,
MSTransportable transportable,
SUMOTime  now 
)
virtualinherited

◆ setDeparted()

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

logs end of the step

Definition at line 101 of file MSTransportable.cpp.

◆ setDestination()

void MSTransportable::Stage::setDestination ( const MSEdge newDestination,
MSStoppingPlace newDestStop 
)
inherited

◆ setSpeed()

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

sets the walking speed (ignored in other stages)

Reimplemented in MSPerson::MSPersonStage_Walking.

Definition at line 127 of file MSTransportable.h.

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

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

Friends And Related Function Documentation

◆ MSCModel_NonInteracting

friend class MSCModel_NonInteracting
friend

Definition at line 108 of file MSContainer.h.

Field Documentation

◆ myArrivalPos

double MSTransportable::Stage::myArrivalPos
protectedinherited

the position at which we want to arrive

Definition at line 209 of file MSTransportable.h.

Referenced by MSTransportable::Stage::getArrivalPos(), MSPerson::MSPersonStage_Walking::getArrivalPos(), and getArrivalPos().

◆ myArrived

SUMOTime MSTransportable::Stage::myArrived
protectedinherited

the time at which this stage ended

Definition at line 215 of file MSTransportable.h.

◆ myContainerState

CState* MSContainer::MSContainerStage_Tranship::myContainerState
private

state that is to be manipulated by MSCModel

Definition at line 221 of file MSContainer.h.

Referenced by getContainerState().

◆ myCurrentInternalEdge

MSEdge* MSContainer::MSContainerStage_Tranship::myCurrentInternalEdge
private

The current internal edge this container is on or 0.

Definition at line 224 of file MSContainer.h.

◆ myDeparted

SUMOTime MSTransportable::Stage::myDeparted
protectedinherited

the time at which this stage started

Definition at line 212 of file MSTransportable.h.

◆ myDepartPos

double MSContainer::MSContainerStage_Tranship::myDepartPos
private

the depart position

Definition at line 215 of file MSContainer.h.

Referenced by getDepartPos(), and MSContainerStage_Tranship().

◆ myDestination

const MSEdge* MSTransportable::Stage::myDestination
protectedinherited

the next edge to reach by getting transported

Definition at line 203 of file MSTransportable.h.

◆ myDestinationStop

MSStoppingPlace* MSTransportable::Stage::myDestinationStop
protectedinherited

the stop to reach by getting transported (if any)

Definition at line 206 of file MSTransportable.h.

Referenced by MSTransportable::Stage::getDestinationStop(), and MSPerson::MSPersonStage_Access::MSPersonStage_Access().

◆ myRoute

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

The route of the container.

Definition at line 209 of file MSContainer.h.

Referenced by getNextRouteEdge(), and MSContainerStage_Tranship().

◆ myRouteStep

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

current step

Definition at line 212 of file MSContainer.h.

Referenced by getNextRouteEdge().

◆ mySpeed

double MSContainer::MSContainerStage_Tranship::mySpeed
private

the speed of the container

Definition at line 218 of file MSContainer.h.

Referenced by getMaxSpeed().

◆ myType

StageType MSTransportable::Stage::myType
protectedinherited

The type of this stage.

Definition at line 218 of file MSTransportable.h.

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


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