Eclipse SUMO - Simulation of Urban MObility
MSStageTrip Class Reference

#include <MSStage.h>

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

Public Member Functions

virtual void abort (MSTransportable *)
 abort this stage (TraCI) More...
 
MSStageclone () const
 
double getAngle (SUMOTime now) const
 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...
 
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
 
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...
 
MSStoppingPlacegetOriginStop () const
 returns the origin stop (if any). only needed for MSStageTrip More...
 
Position getPosition (SUMOTime now) const
 returns the position of the transportable More...
 
virtual double getSpeed () const
 the speed of the transportable More...
 
std::string getStageDescription (const bool isPerson) const
 return (brief) string representation of the current stage More...
 
std::string getStageSummary (const bool isPerson) const
 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...
 
 MSStageTrip (const MSEdge *origin, MSStoppingPlace *fromStop, const MSEdge *destination, MSStoppingPlace *toStop, const SUMOTime duration, const SVCPermissions modeSet, const std::string &vTypes, const double speed, const double walkFactor, const std::string &group, const double departPosLat, const bool hasArrivalPos, const double arrivalPos)
 constructor More...
 
void proceed (MSNet *net, MSTransportable *transportable, SUMOTime now, MSStage *previous)
 proceeds to the next step More...
 
void routeOutput (const bool isPerson, OutputDevice &os, const bool withRouteLength, const MSStage *const previous) const
 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)
 
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)
 
void setOrigin (const MSEdge *origin)
 change origin for parking area rerouting More...
 
virtual void setSpeed (double)
 sets the walking speed (ignored in other stages) More...
 
void tripInfoOutput (OutputDevice &os, const MSTransportable *const transportable) const
 Called on writing tripinfo output. More...
 
virtual ~MSStageTrip ()
 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...
 
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

 MSStageTrip (const MSStageTrip &)
 Invalidated copy constructor. More...
 
MSStageTripoperator= (const MSStageTrip &)
 Invalidated assignment operator. More...
 

Private Attributes

double myDepartPos
 The depart position. More...
 
const double myDepartPosLat
 The lateral depart position. More...
 
SUMOTime myDuration
 the time the trip should take (applies to only walking) More...
 
std::string myGroup
 The group for this personTrip. More...
 
const bool myHaveArrivalPos
 whether an arrivalPos was in the input More...
 
const SVCPermissions myModeSet
 The allowed modes of transportation. More...
 
const MSEdgemyOrigin
 the origin edge More...
 
MSStoppingPlacemyOriginStop
 the origin edge More...
 
const double mySpeed
 The walking speed. More...
 
const std::string myVTypes
 The possible vehicles to use. More...
 
const double myWalkFactor
 The factor to apply to walking durations. More...
 

Detailed Description

A "placeholder" stage storing routing info which will result in real stages when routed

Definition at line 254 of file MSStage.h.

Constructor & Destructor Documentation

◆ MSStageTrip() [1/2]

MSStageTrip::MSStageTrip ( const MSEdge origin,
MSStoppingPlace fromStop,
const MSEdge destination,
MSStoppingPlace toStop,
const SUMOTime  duration,
const SVCPermissions  modeSet,
const std::string &  vTypes,
const double  speed,
const double  walkFactor,
const std::string &  group,
const double  departPosLat,
const bool  hasArrivalPos,
const double  arrivalPos 
)

constructor

Definition at line 172 of file MSStage.cpp.

References TRIP.

Referenced by clone().

Here is the caller graph for this function:

◆ ~MSStageTrip()

MSStageTrip::~MSStageTrip ( )
virtual

destructor

Definition at line 192 of file MSStage.cpp.

◆ MSStageTrip() [2/2]

MSStageTrip::MSStageTrip ( const MSStageTrip )
private

Invalidated copy constructor.

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

◆ getAngle()

double MSStageTrip::getAngle ( SUMOTime  now) const
virtual

returns the angle of the transportable

Implements MSStage.

Definition at line 210 of file MSStage.cpp.

References MSStage::getEdgeAngle(), MSGlobals::gLefthand, M_PI, myDepartPos, and myOrigin.

◆ 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:

◆ getDestination()

◆ getDestinationStop()

MSStoppingPlace* MSStage::getDestinationStop ( ) const
inlineinherited

returns the destination stop (if any)

Definition at line 80 of file MSStage.h.

References MSStage::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 setArrived().

Here is the caller graph for this function:

◆ getDistance()

double MSStageTrip::getDistance ( ) const
inlinevirtual

get travel distance in this stage

Implements MSStage.

Definition at line 281 of file MSStage.h.

◆ getEdge()

const MSEdge * MSStageTrip::getEdge ( ) const
virtual

Returns the current edge.

Reimplemented from MSStage.

Definition at line 217 of file MSStage.cpp.

References myOrigin.

◆ 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(), getAngle(), MSStageWaiting::getAngle(), and MSStageDriving::getAngle().

Here is the caller graph for this function:

◆ getEdgePos()

double MSStageTrip::getEdgePos ( SUMOTime  now) const
virtual

Reimplemented from MSStage.

Definition at line 223 of file MSStage.cpp.

References myDepartPos.

◆ 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 getPosition(), MSStageWaiting::getPosition(), and MSStageDriving::getPosition().

Here is the caller graph for this function:

◆ getEdges()

ConstMSEdgeVector MSStage::getEdges ( ) const
virtualinherited

the edges of the current stage

Reimplemented in MSStageDriving, and MSStageMoving.

Definition at line 106 of file MSStage.cpp.

References MSStage::getDestination().

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

Here is the caller graph for this function:

◆ getFromEdge()

const MSEdge * MSStage::getFromEdge ( ) const
virtualinherited

Reimplemented in MSStageDriving, and MSStageMoving.

Definition at line 82 of file MSStage.cpp.

References MSStage::myDestination.

Referenced by MSTransportable::rerouteParkingArea().

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

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

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

◆ getOriginStop()

MSStoppingPlace* MSStageTrip::getOriginStop ( ) const
inlinevirtual

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

Reimplemented from MSStage.

Definition at line 271 of file MSStage.h.

References myOriginStop.

◆ getPosition()

Position MSStageTrip::getPosition ( SUMOTime  now) const
virtual

returns the position of the transportable

Implements MSStage.

Definition at line 203 of file MSStage.cpp.

References MSStage::getEdgePosition(), MSGlobals::gLefthand, myDepartPos, myOrigin, and MSStage::ROADSIDE_OFFSET.

◆ getSpeed()

double MSStage::getSpeed ( ) const
virtualinherited

the speed of the transportable

Reimplemented in MSStageDriving, and MSStageMoving.

Definition at line 100 of file MSStage.cpp.

◆ getStageDescription()

std::string MSStageTrip::getStageDescription ( const bool  isPerson) const
inlinevirtual

return (brief) string representation of the current stage

Implements MSStage.

Definition at line 286 of file MSStage.h.

References UNUSED_PARAMETER.

◆ getStageSummary()

std::string MSStageTrip::getStageSummary ( const bool  isPerson) const
virtual

return string summary of the current stage

Implements MSStage.

Definition at line 399 of file MSStage.cpp.

References MSStage::getDestination(), Named::getID(), and myOrigin.

◆ 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:

◆ 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 MSStage::getWaitingTime ( SUMOTime  now) const
virtualinherited

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
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.

◆ operator=()

MSStageTrip& MSStageTrip::operator= ( const MSStageTrip )
private

Invalidated assignment operator.

◆ proceed()

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

proceeds to the next step

Implements MSStage.

Definition at line 392 of file MSStage.cpp.

References MSTransportable::proceed().

◆ routeOutput()

void MSStageTrip::routeOutput ( const bool  isPerson,
OutputDevice os,
const bool  withRouteLength,
const MSStage *const  previous 
) const
inlinevirtual

Called on writing vehroute output.

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

Implements MSStage.

Definition at line 319 of file MSStage.h.

References UNUSED_PARAMETER.

◆ 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 setArrived().

Here is the caller graph for this function:

◆ setArrived()

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

logs end of the step

Reimplemented from MSStage.

Definition at line 229 of file MSStage.cpp.

References MSVehicleControl::addVehicle(), MSTransportable::appendStage(), MSVehicleControl::buildVehicle(), IntermodalRouter< E, L, N, V >::compute(), DEFAULT_BIKETYPE_ID, DEFAULT_TAXITYPE_ID, MSVehicleControl::deleteVehicle(), SUMOVehicleParameter::depart, DEPART_TRIGGERED, SUMOVehicleParameter::departPos, SUMOVehicleParameter::departPosProcedure, MSGlobals::gCheckRoutes, MSStoppingPlace::getAccessPos(), MSStage::getArrivalPos(), MSNet::getCurrentTimeStep(), MSStage::getDestination(), MSStage::getDestinationStop(), MSStage::getEdges(), MSEdge::getFromJunction(), MSVehicleType::getID(), Named::getID(), MSNet::getInstance(), MSNet::getIntermodalRouter(), MSEdge::getLength(), MSTransportable::getMaxSpeed(), MSTransportable::getNextStage(), MSTransportable::getNumRemainingStages(), MSTransportable::getNumStages(), MSTransportable::getParameter(), MSEdge::getPermissions(), MSEdge::getPredecessors(), MSNet::getStoppingPlace(), MSEdge::getSuccessors(), MSEdge::getToJunction(), MSVehicleType::getVehicleClass(), MSNet::getVehicleControl(), MSVehicleControl::getVType(), GIVEN, StringTokenizer::hasNext(), MSEdge::isTazConnector(), MAX2(), MIN2(), MSStage::myArrivalPos, myDepartPos, myDepartPosLat, MSStage::myDestination, MSStage::myDestinationStop, myDuration, myGroup, myHaveArrivalPos, myModeSet, myOrigin, mySpeed, myVTypes, myWalkFactor, RandHelper::rand(), RANDOM, SUMOVehicle::replaceRouteEdges(), MSStage::setArrivalPos(), SUMOVehicle::setArrivalPos(), MSStage::setArrived(), SUMO_TAG_BUS_STOP, SVC_BICYCLE, SVC_IGNORING, SVC_PASSENGER, SVC_TAXI, TIME2STEPS, toString(), VEHPARS_DEPARTPOS_SET, VEHPARS_VTYPE_SET, and WRITE_WARNING.

◆ 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:

◆ setOrigin()

void MSStageTrip::setOrigin ( const MSEdge origin)
inline

change origin for parking area rerouting

Definition at line 297 of file MSStage.h.

References myOrigin.

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

void MSStageTrip::tripInfoOutput ( OutputDevice os,
const MSTransportable *const  transportable 
) const
inlinevirtual

Called on writing tripinfo output.

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

Implements MSStage.

Definition at line 309 of file MSStage.h.

References UNUSED_PARAMETER.

Field Documentation

◆ myArrivalPos

◆ myArrived

◆ myDeparted

◆ myDepartPos

double MSStageTrip::myDepartPos
private

The depart position.

Definition at line 352 of file MSStage.h.

Referenced by getAngle(), getEdgePos(), getPosition(), and setArrived().

◆ myDepartPosLat

const double MSStageTrip::myDepartPosLat
private

The lateral depart position.

Definition at line 355 of file MSStage.h.

Referenced by clone(), and setArrived().

◆ myDestination

◆ myDestinationStop

◆ myDuration

SUMOTime MSStageTrip::myDuration
private

the time the trip should take (applies to only walking)

Definition at line 334 of file MSStage.h.

Referenced by clone(), and setArrived().

◆ myGroup

std::string MSStageTrip::myGroup
private

The group for this personTrip.

Definition at line 349 of file MSStage.h.

Referenced by clone(), and setArrived().

◆ myHaveArrivalPos

const bool MSStageTrip::myHaveArrivalPos
private

whether an arrivalPos was in the input

Definition at line 358 of file MSStage.h.

Referenced by clone(), and setArrived().

◆ myModeSet

const SVCPermissions MSStageTrip::myModeSet
private

The allowed modes of transportation.

Definition at line 337 of file MSStage.h.

Referenced by clone(), and setArrived().

◆ myOrigin

const MSEdge* MSStageTrip::myOrigin
private

the origin edge

Definition at line 328 of file MSStage.h.

Referenced by clone(), getAngle(), getEdge(), getPosition(), getStageSummary(), setArrived(), and setOrigin().

◆ myOriginStop

MSStoppingPlace* MSStageTrip::myOriginStop
private

the origin edge

Definition at line 331 of file MSStage.h.

Referenced by clone(), and getOriginStop().

◆ mySpeed

const double MSStageTrip::mySpeed
private

The walking speed.

Definition at line 343 of file MSStage.h.

Referenced by clone(), and setArrived().

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

◆ myVTypes

const std::string MSStageTrip::myVTypes
private

The possible vehicles to use.

Definition at line 340 of file MSStage.h.

Referenced by clone(), and setArrived().

◆ myWalkFactor

const double MSStageTrip::myWalkFactor
private

The factor to apply to walking durations.

Definition at line 346 of file MSStage.h.

Referenced by clone(), and setArrived().

◆ 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 getPosition(), MSStageWaiting::getPosition(), and MSStageDriving::getPosition().


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