Eclipse SUMO - Simulation of Urban MObility
MSStage Class Referenceabstract

#include <MSStage.h>

Inheritance diagram for MSStage:
[legend]
Collaboration diagram for MSStage:
[legend]

Public Member Functions

virtual void abort (MSTransportable *)
 abort this stage (TraCI) More...
 
virtual MSStageclone () const =0
 
virtual double getAngle (SUMOTime now) const =0
 returns the angle of the transportable More...
 
virtual double getArrivalPos () const
 
SUMOTime getArrived () const
 get arrival time of stage More...
 
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
 
const std::string & getGroup () const
 return the id of the group of transportables traveling together More...
 
virtual const MSLanegetLane () const
 Returns the current lane (if applicable) More...
 
Position getLanePosition (const MSLane *lane, double at, double offset) const
 get position on lane at length at with orthogonal offset More...
 
virtual MSStoppingPlacegetOriginStop () const
 returns the origin stop (if any). only needed for MSStageTrip 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 bool isPerson) const =0
 return (brief) string representation of the current stage More...
 
virtual std::string getStageSummary (const bool isPerson) const =0
 return string summary of the current stage More...
 
MSStageType 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 loadState (MSTransportable *transportable, std::istringstream &state)
 Reconstructs the current state, standard implementation does nothing. More...
 
 MSStage (const MSEdge *destination, MSStoppingPlace *toStop, const double arrivalPos, MSStageType type, const std::string &group="")
 constructor More...
 
virtual void proceed (MSNet *net, MSTransportable *transportable, SUMOTime now, MSStage *previous)=0
 proceeds to this stage More...
 
virtual void routeOutput (const bool isPerson, OutputDevice &os, const bool withRouteLength, const MSStage *const previous) const =0
 Called on writing vehroute output. More...
 
virtual void saveState (std::ostringstream &out)
 Saves the current state into the given stream, standard implementation does nothing. More...
 
void setArrivalPos (double arrivalPos)
 
virtual const std::string setArrived (MSNet *net, MSTransportable *transportable, SUMOTime now, const bool vehicleArrived)
 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 =0
 Called on writing tripinfo output. More...
 
virtual ~MSStage ()
 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...
 
const std::string myGroup
 The id of the group of transportables traveling together. More...
 
MSStageType myType
 The type of this stage. More...
 

Static Protected Attributes

static const double ROADSIDE_OFFSET
 the offset for computing positions when standing at an edge More...
 

Private Member Functions

 MSStage (const MSStage &)
 Invalidated copy constructor. More...
 
MSStageoperator= (const MSStage &)=delete
 Invalidated assignment operator. More...
 

Detailed Description

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

Definition at line 68 of file MSStage.h.

Constructor & Destructor Documentation

◆ MSStage() [1/2]

MSStage::MSStage ( const MSEdge destination,
MSStoppingPlace toStop,
const double  arrivalPos,
MSStageType  type,
const std::string &  group = "" 
)

constructor

Definition at line 57 of file MSStage.cpp.

◆ ~MSStage()

MSStage::~MSStage ( )
virtual

destructor

Definition at line 67 of file MSStage.cpp.

◆ MSStage() [2/2]

MSStage::MSStage ( const MSStage )
private

Invalidated copy constructor.

Member Function Documentation

◆ abort()

virtual void MSStage::abort ( MSTransportable )
inlinevirtual

abort this stage (TraCI)

Reimplemented in MSStageDriving, MSStageWaiting, and MSPerson::MSPersonStage_Walking.

Definition at line 133 of file MSStage.h.

Referenced by GUIPerson::GUIPersonPopupMenu::onCmdRemoveObject().

Here is the caller graph for this function:

◆ clone()

◆ getAngle()

virtual double MSStage::getAngle ( SUMOTime  now) const
pure virtual

returns the angle of the transportable

Implemented in MSStageDriving, MSStageMoving, MSStageWaiting, MSStageTrip, and MSPerson::MSPersonStage_Access.

◆ getArrivalPos()

◆ getArrived()

SUMOTime MSStage::getArrived ( ) const

get arrival time of stage

Definition at line 126 of file MSStage.cpp.

References myArrived.

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

Here is the caller graph for this function:

◆ getDeparted()

SUMOTime MSStage::getDeparted ( ) const

get departure time of stage

Definition at line 121 of file MSStage.cpp.

References myDeparted.

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

Here is the caller graph for this function:

◆ getDestination()

◆ getDestinationStop()

MSStoppingPlace* MSStage::getDestinationStop ( ) const
inline

returns the destination stop (if any)

Definition at line 80 of file MSStage.h.

References myDestinationStop.

Referenced by MSPerson::checkAccess(), LIBSUMO_NAMESPACE::Person::getStage(), MSStageDriving::getStageSummary(), MSStageTranship::getStageSummary(), MSPModel_Striping::moveInDirectionOnLane(), GUIPerson::GUIPersonPopupMenu::onCmdRemoveObject(), MSRouteHandler::parseWalkPositions(), MSStageDriving::proceed(), MSTransportable::proceed(), MSTransportable::rerouteParkingArea(), and MSStageTrip::setArrived().

Here is the caller graph for this function:

◆ getDistance()

virtual double MSStage::getDistance ( ) const
pure virtual

get travel distance in this stage

Implemented in MSStageTranship, MSStageDriving, MSStageWaiting, MSStageTrip, MSPerson::MSPersonStage_Access, and MSPerson::MSPersonStage_Walking.

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

Here is the caller graph for this function:

◆ getEdge()

const MSEdge * MSStage::getEdge ( ) const
virtual

Returns the current edge.

Reimplemented in MSStageDriving, MSStageMoving, and MSStageTrip.

Definition at line 76 of file MSStage.cpp.

References myDestination.

Referenced by GUIPerson::GUIPersonPopupMenu::onCmdRemoveObject(), MSPerson::MSPersonStage_Walking::proceed(), MSStageWaiting::proceed(), MSStageDriving::proceed(), MSTransportable::proceed(), and MSStageDriving::routeOutput().

Here is the caller graph for this function:

◆ getEdgeAngle()

double MSStage::getEdgeAngle ( const MSEdge e,
double  at 
) const

get angle of the edge at a certain position

Definition at line 153 of file MSStage.cpp.

References MSEdge::getLanes().

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

Here is the caller graph for this function:

◆ getEdgePos()

double MSStage::getEdgePos ( SUMOTime  now) const
virtual

Reimplemented in MSStageDriving, MSStageMoving, and MSStageTrip.

Definition at line 88 of file MSStage.cpp.

References myArrivalPos.

Referenced by MSEdge::transportable_by_position_sorter::operator()(), MSPerson::MSPersonStage_Walking::proceed(), MSStageDriving::proceed(), and MSStageTranship::proceed().

Here is the caller graph for this function:

◆ getEdgePosition()

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

get position on edge e at length at with orthogonal offset

Definition at line 142 of file MSStage.cpp.

References getLanePosition(), and MSEdge::getLanes().

Referenced by MSStageTrip::getPosition(), MSStageWaiting::getPosition(), and MSStageDriving::getPosition().

Here is the caller graph for this function:

◆ getEdges()

ConstMSEdgeVector MSStage::getEdges ( ) const
virtual

the edges of the current stage

Reimplemented in MSStageDriving, and MSStageMoving.

Definition at line 106 of file MSStage.cpp.

References getDestination().

Referenced by LIBSUMO_NAMESPACE::Person::getStage(), LIBSUMO_NAMESPACE::Person::rerouteTraveltime(), and MSStageTrip::setArrived().

Here is the caller graph for this function:

◆ getFromEdge()

const MSEdge * MSStage::getFromEdge ( ) const
virtual

Reimplemented in MSStageDriving, and MSStageMoving.

Definition at line 82 of file MSStage.cpp.

References myDestination.

Referenced by MSTransportable::rerouteParkingArea().

Here is the caller graph for this function:

◆ getGroup()

const std::string& MSStage::getGroup ( ) const
inline

return the id of the group of transportables traveling together

Definition at line 119 of file MSStage.h.

References myGroup.

◆ getLane()

virtual const MSLane* MSStage::getLane ( ) const
inlinevirtual

Returns the current lane (if applicable)

Reimplemented in MSStageMoving.

Definition at line 109 of file MSStage.h.

◆ getLanePosition()

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

get position on lane at length at with orthogonal offset

Definition at line 147 of file MSStage.cpp.

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

Referenced by MSPModel_NonInteracting::CState::computeDuration(), getEdgePosition(), MSPModel_NonInteracting::PState::getPosition(), and MSPModel_Striping::PState::getPosition().

Here is the caller graph for this function:

◆ getOriginStop()

virtual MSStoppingPlace* MSStage::getOriginStop ( ) const
inlinevirtual

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

Reimplemented in MSStageDriving, and MSStageTrip.

Definition at line 85 of file MSStage.h.

Referenced by MSStageDriving::proceed().

Here is the caller graph for this function:

◆ getPosition()

virtual Position MSStage::getPosition ( SUMOTime  now) const
pure virtual

returns the position of the transportable

Implemented in MSStageDriving, MSStageMoving, MSStageWaiting, MSStageTrip, and MSPerson::MSPersonStage_Access.

◆ getSpeed()

double MSStage::getSpeed ( ) const
virtual

the speed of the transportable

Reimplemented in MSStageDriving, and MSStageMoving.

Definition at line 100 of file MSStage.cpp.

◆ getStageDescription()

virtual std::string MSStage::getStageDescription ( const bool  isPerson) const
pure virtual

return (brief) string representation of the current stage

Implemented in MSStageTranship, MSStageDriving, MSStageWaiting, MSStageTrip, MSPerson::MSPersonStage_Access, and MSPerson::MSPersonStage_Walking.

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

Here is the caller graph for this function:

◆ getStageSummary()

virtual std::string MSStage::getStageSummary ( const bool  isPerson) const
pure virtual

◆ getStageType()

MSStageType MSStage::getStageType ( ) const
inline

Definition at line 114 of file MSStage.h.

References myType.

Referenced by MSPerson::checkAccess(), LIBSUMO_NAMESPACE::Person::getStage(), MSStageDriving::proceed(), MSTransportable::proceed(), MSTransportable::rerouteParkingArea(), and MSStageDriving::routeOutput().

Here is the caller graph for this function:

◆ getVehicle()

virtual SUMOVehicle* MSStage::getVehicle ( ) const
inlinevirtual

Whether the transportable waits for a vehicle.

Reimplemented in MSStageDriving.

Definition at line 159 of file MSStage.h.

◆ getWaitingTime()

SUMOTime MSStage::getWaitingTime ( SUMOTime  now) const
virtual

the time this transportable spent waiting

Reimplemented in MSStageDriving, MSStageMoving, and MSStageWaiting.

Definition at line 94 of file MSStage.cpp.

◆ isWaiting4Vehicle()

virtual bool MSStage::isWaiting4Vehicle ( ) const
inlinevirtual

Whether the transportable waits for a vehicle.

Reimplemented in MSStageDriving.

Definition at line 154 of file MSStage.h.

◆ isWaitingFor()

bool MSStage::isWaitingFor ( const SUMOVehicle vehicle) const
virtual

Whether the transportable waits for the given vehicle.

Reimplemented in MSStageDriving.

Definition at line 137 of file MSStage.cpp.

◆ loadState()

virtual void MSStage::loadState ( MSTransportable transportable,
std::istringstream &  state 
)
inlinevirtual

Reconstructs the current state, standard implementation does nothing.

Reimplemented in MSStageDriving, and MSPerson::MSPersonStage_Walking.

Definition at line 211 of file MSStage.h.

References UNUSED_PARAMETER.

◆ operator=()

MSStage& MSStage::operator= ( const MSStage )
privatedelete

Invalidated assignment operator.

◆ proceed()

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

◆ routeOutput()

virtual void MSStage::routeOutput ( const bool  isPerson,
OutputDevice os,
const bool  withRouteLength,
const MSStage *const  previous 
) const
pure virtual

Called on writing vehroute output.

Parameters
[in]isPersonWhether we are writing person or container info
[in]osThe stream to write the information into
[in]withRouteLengthwhether route length shall be written
[in]previousThe previous stage for additional info such as from edge
Exceptions
IOErrornot yet implemented

Implemented in MSPerson::MSPersonStage_Access, MSStageTranship, MSStageDriving, MSStageWaiting, MSStageTrip, and MSPerson::MSPersonStage_Walking.

Referenced by MSTransportable::routeOutput(), and MSTransportable::saveState().

Here is the caller graph for this function:

◆ saveState()

virtual void MSStage::saveState ( std::ostringstream &  out)
inlinevirtual

Saves the current state into the given stream, standard implementation does nothing.

Reimplemented in MSStageDriving, and MSPerson::MSPersonStage_Walking.

Definition at line 205 of file MSStage.h.

References UNUSED_PARAMETER.

◆ setArrivalPos()

void MSStage::setArrivalPos ( double  arrivalPos)
inline

Definition at line 93 of file MSStage.h.

References myArrivalPos.

Referenced by MSStageTrip::setArrived().

Here is the caller graph for this function:

◆ setArrived()

const std::string MSStage::setArrived ( MSNet net,
MSTransportable transportable,
SUMOTime  now,
const bool  vehicleArrived 
)
virtual

logs end of the step

Reimplemented in MSStageDriving, and MSStageTrip.

Definition at line 131 of file MSStage.cpp.

References myArrived.

Referenced by MSTransportable::proceed(), MSStageTrip::setArrived(), and MSStageDriving::setArrived().

Here is the caller graph for this function:

◆ setDeparted()

void MSStage::setDeparted ( SUMOTime  now)

logs end of the step

Definition at line 114 of file MSStage.cpp.

References myDeparted.

◆ setDestination()

void MSStage::setDestination ( const MSEdge newDestination,
MSStoppingPlace newDestStop 
)

Definition at line 159 of file MSStage.cpp.

References MSStoppingPlace::getBeginLanePosition(), MSStoppingPlace::getEndLanePosition(), myArrivalPos, myDestination, and myDestinationStop.

Referenced by MSTransportable::rerouteParkingArea().

Here is the caller graph for this function:

◆ setSpeed()

virtual void MSStage::setSpeed ( double  )
inlinevirtual

sets the walking speed (ignored in other stages)

Reimplemented in MSPerson::MSPersonStage_Walking.

Definition at line 136 of file MSStage.h.

◆ tripInfoOutput()

virtual void MSStage::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 MSStageTranship, MSStageDriving, MSStageWaiting, MSStageTrip, MSPerson::MSPersonStage_Access, and MSPerson::MSPersonStage_Walking.

Field Documentation

◆ myArrivalPos

◆ myArrived

◆ myDeparted

◆ myDestination

◆ myDestinationStop

◆ myGroup

const std::string MSStage::myGroup
protected

The id of the group of transportables traveling together.

Definition at line 236 of file MSStage.h.

Referenced by MSStageDriving::clone(), getGroup(), and MSStageDriving::proceed().

◆ myType

MSStageType MSStage::myType
protected

The type of this stage.

Definition at line 233 of file MSStage.h.

Referenced by MSStageWaiting::clone(), getStageType(), MSStageWaiting::routeOutput(), and MSStageWaiting::tripInfoOutput().

◆ ROADSIDE_OFFSET

const double MSStage::ROADSIDE_OFFSET
staticprotected

the offset for computing positions when standing at an edge

Definition at line 239 of file MSStage.h.

Referenced by MSStageTrip::getPosition(), MSStageWaiting::getPosition(), and MSStageDriving::getPosition().


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