Eclipse SUMO - Simulation of Urban MObility
MSStageMoving Class Referenceabstract

#include <MSStage.h>

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

Public Member Functions

virtual void abort (MSTransportable *)
 abort this stage (TraCI) More...
 
virtual MSStageclone () const =0
 
double getAngle (SUMOTime now) const
 Returns the angle of the container. More...
 
virtual double getArrivalPos () const
 
SUMOTime getArrived () const
 get arrival time of stage More...
 
SUMOTime getDeparted () const
 get departure time of stage More...
 
double getDepartPos () const
 
double getDepartPosLat () const
 
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...
 
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...
 
const std::string & getGroup () const
 return the id of the group of transportables traveling together More...
 
const MSLanegetLane () const
 Returns the current lane. More...
 
Position getLanePosition (const MSLane *lane, double at, double offset) const
 get position on lane at length at with orthogonal offset More...
 
virtual double getMaxSpeed (const MSTransportable *const transportable=nullptr) const =0
 the maximum speed of the transportable More...
 
virtual const MSEdgegetNextRouteEdge () const =0
 
virtual MSStoppingPlacegetOriginStop () const
 returns the origin stop (if any). only needed for MSStageTrip More...
 
Position getPosition (SUMOTime now) const
 Returns the position of the container. More...
 
const std::vector< const MSEdge * > & getRoute () const
 
const std::vector< const MSEdge * >::iterator getRouteStep () const
 
double getSpeed () const
 Returns the speed of the container. 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 MSTransportableStateAdaptergetState () const
 
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...
 
virtual void loadState (MSTransportable *transportable, std::istringstream &state)
 Reconstructs the current state, standard implementation does nothing. More...
 
virtual bool moveToNextEdge (MSTransportable *transportable, SUMOTime currentTime, MSEdge *nextInternal=0)=0
 move forward and return whether the transportable arrived More...
 
 MSStageMoving (const std::vector< const MSEdge * > &route, MSStoppingPlace *toStop, const double speed, const double departPos, const double arrivalPos, const double departPosLat, MSStageType type)
 constructor More...
 
virtual void proceed (MSNet *net, MSTransportable *transportable, SUMOTime now, MSStage *previous)=0
 proceeds to this stage More...
 
virtual void replaceRoute (MSTransportable *const transportable, const ConstMSEdgeVector &edges, int routeOffset)
 
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 setRouteIndex (MSTransportable *const transportable, int routeOffset)
 place transportable on a previously passed edge More...
 
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 ~MSStageMoving ()
 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...
 
MSEdgemyCurrentInternalEdge = nullptr
 The current internal edge this transportable is on or nullptr. More...
 
SUMOTime myDeparted
 the time at which this stage started More...
 
double myDepartPos
 the depart position More...
 
double myDepartPosLat
 the lateral depart position 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...
 
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 transportable More...
 
MSTransportableStateAdaptermyState
 state that is to be manipulated by MSPModel 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...
 

Detailed Description

An abstract stage providing additional interface for the movement models

Definition at line 450 of file MSStage.h.

Constructor & Destructor Documentation

◆ MSStageMoving()

MSStageMoving::MSStageMoving ( const std::vector< const MSEdge * > &  route,
MSStoppingPlace toStop,
const double  speed,
const double  departPos,
const double  arrivalPos,
const double  departPosLat,
MSStageType  type 
)
inline

constructor

Definition at line 453 of file MSStage.h.

◆ ~MSStageMoving()

MSStageMoving::~MSStageMoving ( )
virtual

destructor

Definition at line 532 of file MSStage.cpp.

References myState.

Member Function Documentation

◆ abort()

virtual void MSStage::abort ( MSTransportable )
inlinevirtualinherited

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

virtual MSStage* MSStage::clone ( ) const
pure virtualinherited

◆ getAngle()

double MSStageMoving::getAngle ( SUMOTime  now) const
virtual

Returns the angle of the container.

Implements MSStage.

Definition at line 567 of file MSStage.cpp.

References MSTransportableStateAdapter::getAngle(), and myState.

◆ getArrivalPos()

◆ getArrived()

SUMOTime MSStage::getArrived ( ) const
inherited

get arrival time of stage

Definition at line 126 of file MSStage.cpp.

References MSStage::myArrived.

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

Here is the caller graph for this function:

◆ getDeparted()

SUMOTime MSStage::getDeparted ( ) const
inherited

get departure time of stage

Definition at line 121 of file MSStage.cpp.

References MSStage::myDeparted.

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

Here is the caller graph for this function:

◆ getDepartPos()

double MSStageMoving::getDepartPos ( ) const
inline

Definition at line 513 of file MSStage.h.

References myDepartPos.

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

Here is the caller graph for this function:

◆ getDepartPosLat()

double MSStageMoving::getDepartPosLat ( ) const
inline

Definition at line 517 of file MSStage.h.

References myDepartPosLat.

◆ getDestination()

◆ getDestinationStop()

MSStoppingPlace* MSStage::getDestinationStop ( ) const
inlineinherited

◆ getDistance()

virtual double MSStage::getDistance ( ) const
pure virtualinherited

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 * MSStageMoving::getEdge ( ) const
virtual

Returns the current edge.

Reimplemented from MSStage.

Definition at line 537 of file MSStage.cpp.

References myCurrentInternalEdge, and myRouteStep.

Referenced by MSPModel_NonInteracting::PState::computeDuration(), MSPModel_NonInteracting::PState::getAngle(), MSPModel_NonInteracting::CState::getAngle(), MSPModel_NonInteracting::PState::getPosition(), MSStageTranship::moveToNextEdge(), replaceRoute(), and setRouteIndex().

Here is the caller graph for this function:

◆ getEdgeAngle()

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

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 MSStageMoving::getEdgePos ( SUMOTime  now) const
virtual

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

Reimplemented from MSStage.

Definition at line 557 of file MSStage.cpp.

References MSTransportableStateAdapter::getEdgePos(), and myState.

◆ getEdgePosition()

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

get position on edge e at length at with orthogonal offset

Definition at line 142 of file MSStage.cpp.

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

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

Here is the caller graph for this function:

◆ getEdges()

ConstMSEdgeVector MSStageMoving::getEdges ( ) const
virtual

the edges of the current stage

Reimplemented from MSStage.

Definition at line 551 of file MSStage.cpp.

References myRoute.

Referenced by MSPModel_NonInteracting::CState::computeDuration(), and LIBSUMO_NAMESPACE::Person::moveToXY().

Here is the caller graph for this function:

◆ getFromEdge()

const MSEdge * MSStageMoving::getFromEdge ( ) const
virtual

Returns first edge of the containers route.

Reimplemented from MSStage.

Definition at line 546 of file MSStage.cpp.

References myRoute.

Referenced by MSPModel_NonInteracting::CState::computeDuration().

Here is the caller graph for this function:

◆ getGroup()

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

return the id of the group of transportables traveling together

Definition at line 119 of file MSStage.h.

References MSStage::myGroup.

◆ getLane()

const MSLane * MSStageMoving::getLane ( ) const
virtual

Returns the current lane.

Reimplemented from MSStage.

Definition at line 582 of file MSStage.cpp.

References MSTransportableStateAdapter::getLane(), and myState.

◆ getLanePosition()

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

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(), MSStage::getEdgePosition(), MSPModel_NonInteracting::PState::getPosition(), and MSPModel_Striping::PState::getPosition().

Here is the caller graph for this function:

◆ getMaxSpeed()

virtual double MSStageMoving::getMaxSpeed ( const MSTransportable *const  transportable = nullptr) const
pure virtual

the maximum speed of the transportable

Implemented in MSStageTranship, and MSPerson::MSPersonStage_Walking.

Referenced by MSPModel_NonInteracting::PState::computeDuration(), MSPModel_NonInteracting::CState::computeDuration(), MSPModel_Striping::getNextLane(), MSPModel_NonInteracting::CState::getPosition(), MSPModel_NonInteracting::PState::getSpeed(), MSPModel_Striping::moveInDirectionOnLane(), and MSPModel_Striping::PState::PState().

Here is the caller graph for this function:

◆ getNextRouteEdge()

virtual const MSEdge* MSStageMoving::getNextRouteEdge ( ) const
pure virtual

Implemented in MSStageTranship, and MSPerson::MSPersonStage_Walking.

Referenced by MSPModel_NonInteracting::PState::computeDuration(), MSPModel_NonInteracting::PState::getNextEdge(), and MSPModel_Striping::getNextLane().

Here is the caller graph for this function:

◆ getOriginStop()

virtual MSStoppingPlace* MSStage::getOriginStop ( ) const
inlinevirtualinherited

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

Position MSStageMoving::getPosition ( SUMOTime  now) const
virtual

Returns the position of the container.

Implements MSStage.

Definition at line 562 of file MSStage.cpp.

References MSTransportableStateAdapter::getPosition(), Position::INVALID, and myState.

◆ getRoute()

const std::vector<const MSEdge*>& MSStageMoving::getRoute ( ) const
inline

Definition at line 505 of file MSStage.h.

References myRoute.

Referenced by GUIPerson::drawGLAdditional(), MSPModel_Striping::getNextLane(), LIBSUMO_NAMESPACE::Person::moveToXY(), and MSPModel_Striping::PState::PState().

Here is the caller graph for this function:

◆ getRouteStep()

const std::vector<const MSEdge*>::iterator MSStageMoving::getRouteStep ( ) const
inline

Definition at line 509 of file MSStage.h.

References myRouteStep.

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

Here is the caller graph for this function:

◆ getSpeed()

double MSStageMoving::getSpeed ( ) const
virtual

Returns the speed of the container.

Reimplemented from MSStage.

Definition at line 577 of file MSStage.cpp.

References MSTransportableStateAdapter::getSpeed(), and myState.

◆ getStageDescription()

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

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 virtualinherited

◆ getStageType()

MSStageType MSStage::getStageType ( ) const
inlineinherited

Definition at line 114 of file MSStage.h.

References MSStage::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:

◆ getState()

virtual MSTransportableStateAdapter* MSStageMoving::getState ( ) const
inlinevirtual

Definition at line 463 of file MSStage.h.

References myState.

Referenced by GUIPerson::drawAction_drawWalkingareaPath(), MSPerson::getNextEdgePtr(), GUIPerson::isJammed(), and MSPerson::Influencer::postProcessRemoteControl().

Here is the caller graph for this function:

◆ getVehicle()

virtual SUMOVehicle* MSStage::getVehicle ( ) const
inlinevirtualinherited

Whether the transportable waits for a vehicle.

Reimplemented in MSStageDriving.

Definition at line 159 of file MSStage.h.

◆ getWaitingTime()

SUMOTime MSStageMoving::getWaitingTime ( SUMOTime  now) const
virtual

Returns the time the container spent waiting.

Reimplemented from MSStage.

Definition at line 572 of file MSStage.cpp.

References MSTransportableStateAdapter::getWaitingTime(), and myState.

◆ isWaiting4Vehicle()

virtual bool MSStage::isWaiting4Vehicle ( ) const
inlinevirtualinherited

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
virtualinherited

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

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.

◆ moveToNextEdge()

virtual bool MSStageMoving::moveToNextEdge ( MSTransportable transportable,
SUMOTime  currentTime,
MSEdge nextInternal = 0 
)
pure virtual

move forward and return whether the transportable arrived

Implemented in MSPerson::MSPersonStage_Walking, and MSStageTranship.

Referenced by MSPModel_Striping::arriveAndAdvance().

Here is the caller graph for this function:

◆ proceed()

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

◆ replaceRoute()

void MSStageMoving::replaceRoute ( MSTransportable *const  transportable,
const ConstMSEdgeVector edges,
int  routeOffset 
)
virtual

Definition at line 596 of file MSStage.cpp.

References MSEdge::addPerson(), getEdge(), myRoute, myRouteStep, and MSEdge::removePerson().

◆ routeOutput()

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

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

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

Definition at line 93 of file MSStage.h.

References MSStage::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 
)
virtualinherited

logs end of the step

Reimplemented in MSStageDriving, and MSStageTrip.

Definition at line 131 of file MSStage.cpp.

References MSStage::myArrived.

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

Here is the caller graph for this function:

◆ setDeparted()

void MSStage::setDeparted ( SUMOTime  now)
inherited

logs end of the step

Definition at line 114 of file MSStage.cpp.

References MSStage::myDeparted.

◆ setDestination()

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

Definition at line 159 of file MSStage.cpp.

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

Referenced by MSTransportable::rerouteParkingArea().

Here is the caller graph for this function:

◆ setRouteIndex()

void MSStageMoving::setRouteIndex ( MSTransportable *const  transportable,
int  routeOffset 
)
virtual

place transportable on a previously passed edge

Definition at line 587 of file MSStage.cpp.

References MSEdge::addPerson(), getEdge(), myRoute, myRouteStep, and MSEdge::removePerson().

◆ setSpeed()

virtual void MSStage::setSpeed ( double  )
inlinevirtualinherited

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 virtualinherited

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

◆ myCurrentInternalEdge

MSEdge* MSStageMoving::myCurrentInternalEdge = nullptr
protected

The current internal edge this transportable is on or nullptr.

Definition at line 532 of file MSStage.h.

Referenced by getEdge().

◆ myDeparted

◆ myDepartPos

◆ myDepartPosLat

double MSStageMoving::myDepartPosLat
protected

the lateral depart position

Definition at line 541 of file MSStage.h.

Referenced by getDepartPosLat().

◆ myDestination

◆ myDestinationStop

◆ myGroup

const std::string MSStage::myGroup
protectedinherited

The id of the group of transportables traveling together.

Definition at line 236 of file MSStage.h.

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

◆ myRoute

◆ myRouteStep

std::vector<const MSEdge*>::iterator MSStageMoving::myRouteStep
protected

◆ mySpeed

◆ myState

MSTransportableStateAdapter* MSStageMoving::myState
protected

state that is to be manipulated by MSPModel

Definition at line 523 of file MSStage.h.

Referenced by getAngle(), getEdgePos(), getLane(), getPosition(), getSpeed(), getState(), getWaitingTime(), MSStageTranship::proceed(), and ~MSStageMoving().

◆ myType

MSStageType MSStage::myType
protectedinherited

The type of this stage.

Definition at line 233 of file MSStage.h.

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

◆ ROADSIDE_OFFSET

const double MSStage::ROADSIDE_OFFSET
staticprotectedinherited

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: