Eclipse SUMO - Simulation of Urban MObility
MSTransportable::Stage Class Referenceabstract

#include <MSTransportable.h>

Inheritance diagram for MSTransportable::Stage:
Collaboration diagram for MSTransportable::Stage:

Public Member Functions

virtual void abort (MSTransportable *)
 abort this stage (TraCI) More...
 
virtual void beginEventOutput (const MSTransportable &transportable, SUMOTime t, OutputDevice &os) const =0
 Called for writing the events output (begin of an action) More...
 
virtual Stageclone () const =0
 
virtual void endEventOutput (const MSTransportable &transportable, SUMOTime t, OutputDevice &os) const =0
 Called for writing the events output (end of an action) More...
 
virtual double getAngle (SUMOTime now) const =0
 returns the angle of the transportable More...
 
double getArrivalPos () const
 
SUMOTime getDeparted () const
 get departure time of stage More...
 
const MSEdgegetDestination () const
 returns the destination edge More...
 
MSStoppingPlacegetDestinationStop () const
 returns the destination stop (if any) More...
 
virtual double getDistance () const =0
 get travel distance in this stage More...
 
virtual 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...
 
virtual double getEdgePos (SUMOTime now) const
 
Position getEdgePosition (const MSEdge *e, double at, double offset) const
 get position on edge e at length at with orthogonal offset More...
 
virtual ConstMSEdgeVector getEdges () const
 the edges of the current stage More...
 
virtual const MSEdgegetFromEdge () const
 
Position getLanePosition (const MSLane *lane, double at, double offset) const
 get position on lane at length at with orthogonal offset More...
 
virtual const MSStoppingPlacegetOriginStop () const
 returns the origin stop (if any). only needed for Stage_Trip More...
 
virtual Position getPosition (SUMOTime now) const =0
 returns the position of the transportable More...
 
virtual double getSpeed () const
 the speed of the transportable More...
 
virtual std::string getStageDescription () const =0
 return (brief) string representation of the current stage More...
 
virtual std::string getStageSummary () const =0
 return string summary of the current stage More...
 
StageType getStageType () const
 
virtual SUMOVehiclegetVehicle () const
 Whether the transportable waits for a vehicle. More...
 
virtual SUMOTime getWaitingTime (SUMOTime now) const
 the time this transportable 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...
 
virtual void proceed (MSNet *net, MSTransportable *transportable, SUMOTime now, Stage *previous)=0
 proceeds to this stage More...
 
virtual void routeOutput (OutputDevice &os, const bool withRouteLength) const =0
 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...
 
 Stage (const MSEdge *destination, MSStoppingPlace *toStop, const double arrivalPos, StageType type)
 constructor More...
 
virtual void tripInfoOutput (OutputDevice &os, const MSTransportable *const transportable) const =0
 Called on writing tripinfo output. More...
 
virtual ~Stage ()
 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

Stageoperator= (const Stage &)
 Invalidated assignment operator. More...
 
 Stage (const Stage &)
 Invalidated copy constructor. More...
 

Detailed Description

The "abstract" class for a single stage of a movement Contains the destination of the current movement step

Definition at line 73 of file MSTransportable.h.

Constructor & Destructor Documentation

◆ Stage() [1/2]

MSTransportable::Stage::Stage ( const MSEdge destination,
MSStoppingPlace toStop,
const double  arrivalPos,
StageType  type 
)

constructor

Definition at line 51 of file MSTransportable.cpp.

◆ ~Stage()

MSTransportable::Stage::~Stage ( )
virtual

destructor

Definition at line 54 of file MSTransportable.cpp.

◆ Stage() [2/2]

MSTransportable::Stage::Stage ( const Stage )
private

Invalidated copy constructor.

Member Function Documentation

◆ abort()

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

◆ beginEventOutput()

virtual void MSTransportable::Stage::beginEventOutput ( const MSTransportable transportable,
SUMOTime  t,
OutputDevice os 
) const
pure virtual

Called for writing the events output (begin of an action)

Parameters
[in]osThe stream to write the information into
Exceptions
IOErrornot yet implemented

Implemented in MSTransportable::Stage_Driving, MSTransportable::Stage_Waiting, MSTransportable::Stage_Trip, MSPerson::MSPersonStage_Walking, MSContainer::MSContainerStage_Tranship, and MSPerson::MSPersonStage_Access.

◆ clone()

◆ endEventOutput()

virtual void MSTransportable::Stage::endEventOutput ( const MSTransportable transportable,
SUMOTime  t,
OutputDevice os 
) const
pure virtual

Called for writing the events output (end of an action)

Parameters
[in]osThe stream to write the information into
Exceptions
IOErrornot yet implemented

Implemented in MSTransportable::Stage_Driving, MSTransportable::Stage_Waiting, MSTransportable::Stage_Trip, MSPerson::MSPersonStage_Walking, MSContainer::MSContainerStage_Tranship, and MSPerson::MSPersonStage_Access.

◆ getAngle()

virtual double MSTransportable::Stage::getAngle ( SUMOTime  now) const
pure virtual

◆ getArrivalPos()

◆ getDeparted()

SUMOTime MSTransportable::Stage::getDeparted ( ) const

get departure time of stage

Definition at line 108 of file MSTransportable.cpp.

◆ getDestination()

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

◆ getDestinationStop()

◆ getDistance()

virtual double MSTransportable::Stage::getDistance ( ) const
pure virtual

◆ getEdge()

◆ getEdgeAngle()

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

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()

◆ getEdgePosition()

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

get position on edge e at length at with orthogonal offset

Definition at line 123 of file MSTransportable.cpp.

References MSEdge::getLanes().

◆ getEdges()

ConstMSEdgeVector MSTransportable::Stage::getEdges ( ) const
virtual

◆ getFromEdge()

const MSEdge * MSTransportable::Stage::getFromEdge ( ) const
virtual

◆ getLanePosition()

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

◆ getOriginStop()

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

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()

virtual Position MSTransportable::Stage::getPosition ( SUMOTime  now) const
pure virtual

◆ getSpeed()

double MSTransportable::Stage::getSpeed ( ) const
virtual

the speed of the transportable

Reimplemented in MSTransportable::Stage_Driving, MSContainer::MSContainerStage_Tranship, and MSPerson::MSPersonStage_Walking.

Definition at line 87 of file MSTransportable.cpp.

◆ getStageDescription()

virtual std::string MSTransportable::Stage::getStageDescription ( ) const
pure virtual

◆ getStageSummary()

virtual std::string MSTransportable::Stage::getStageSummary ( ) const
pure virtual

◆ getStageType()

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

◆ getVehicle()

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

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 MSTransportable::Stage::getWaitingTime ( SUMOTime  now) const
virtual

the time this transportable spent waiting

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

Definition at line 81 of file MSTransportable.cpp.

◆ isWaiting4Vehicle()

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

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
virtual

Whether the transportable waits for the given vehicle.

Reimplemented in MSTransportable::Stage_Driving.

Definition at line 118 of file MSTransportable.cpp.

◆ operator=()

Stage& MSTransportable::Stage::operator= ( const Stage )
private

Invalidated assignment operator.

◆ proceed()

virtual void MSTransportable::Stage::proceed ( MSNet net,
MSTransportable transportable,
SUMOTime  now,
Stage previous 
)
pure virtual

◆ routeOutput()

virtual void MSTransportable::Stage::routeOutput ( OutputDevice os,
const bool  withRouteLength 
) const
pure virtual

Called on writing vehroute output.

Parameters
[in]osThe stream to write the information into
[in]withRouteLengthwhether route length shall be written
Exceptions
IOErrornot yet implemented

Implemented in MSTransportable::Stage_Waiting, MSTransportable::Stage_Trip, MSPerson::MSPersonStage_Driving, MSContainer::MSContainerStage_Tranship, MSPerson::MSPersonStage_Walking, MSContainer::MSContainerStage_Driving, and MSPerson::MSPersonStage_Access.

◆ setArrived()

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

◆ setDeparted()

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

logs end of the step

Definition at line 101 of file MSTransportable.cpp.

◆ setDestination()

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

◆ setSpeed()

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

sets the walking speed (ignored in other stages)

Reimplemented in MSPerson::MSPersonStage_Walking.

Definition at line 127 of file MSTransportable.h.

◆ tripInfoOutput()

virtual void MSTransportable::Stage::tripInfoOutput ( OutputDevice os,
const MSTransportable *const  transportable 
) const
pure virtual

Called on writing tripinfo output.

Parameters
[in]osThe stream to write the information into
Exceptions
IOErrornot yet implemented

Implemented in MSTransportable::Stage_Waiting, MSPerson::MSPersonStage_Access, MSTransportable::Stage_Trip, MSPerson::MSPersonStage_Driving, MSContainer::MSContainerStage_Tranship, MSPerson::MSPersonStage_Walking, and MSContainer::MSContainerStage_Driving.

Field Documentation

◆ myArrivalPos

double MSTransportable::Stage::myArrivalPos
protected

the position at which we want to arrive

Definition at line 209 of file MSTransportable.h.

Referenced by getArrivalPos(), MSPerson::MSPersonStage_Walking::getArrivalPos(), and MSContainer::MSContainerStage_Tranship::getArrivalPos().

◆ myArrived

SUMOTime MSTransportable::Stage::myArrived
protected

the time at which this stage ended

Definition at line 215 of file MSTransportable.h.

◆ myDeparted

SUMOTime MSTransportable::Stage::myDeparted
protected

the time at which this stage started

Definition at line 212 of file MSTransportable.h.

◆ myDestination

const MSEdge* MSTransportable::Stage::myDestination
protected

the next edge to reach by getting transported

Definition at line 203 of file MSTransportable.h.

◆ myDestinationStop

MSStoppingPlace* MSTransportable::Stage::myDestinationStop
protected

the stop to reach by getting transported (if any)

Definition at line 206 of file MSTransportable.h.

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

◆ myType

StageType MSTransportable::Stage::myType
protected

The type of this stage.

Definition at line 218 of file MSTransportable.h.

Referenced by getStageType().


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