![]() |
Eclipse SUMO - Simulation of Urban MObility
|
#include <MSStage.h>
Public Member Functions | |
virtual void | abort (MSTransportable *) |
abort this stage (TraCI) More... | |
virtual MSStage * | clone () 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 MSEdge * | getDestination () const |
returns the destination edge More... | |
MSStoppingPlace * | getDestinationStop () const |
returns the destination stop (if any) More... | |
virtual int | getDirection () const |
Return the movement directon on the edge. More... | |
virtual double | getDistance () const =0 |
get travel distance in this stage More... | |
virtual const MSEdge * | getEdge () 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 MSEdge * | getFromEdge () const |
const std::string & | getGroup () const |
return the id of the group of transportables traveling together More... | |
virtual const MSLane * | getLane () 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 MSStoppingPlace * | getOriginStop () 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 int | getRoutePosition () const |
return index of current edge within route 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 SUMOVehicle * | getVehicle () const |
Current vehicle in which the transportable is driving (or nullptr) 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... | |
void | markSet (int what) |
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... | |
bool | wasSet (int what) const |
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 MSEdge * | myDestination |
the next edge to reach by getting transported More... | |
MSStoppingPlace * | myDestinationStop |
the stop to reach by getting transported (if any) More... | |
const std::string | myGroup |
The id of the group of transportables traveling together. More... | |
int | myParametersSet |
Information on which parameter were set (mainly for vehroute output) 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... | |
MSStage & | operator= (const MSStage &)=delete |
Invalidated assignment operator. More... | |
The "abstract" class for a single stage of a movement Contains the destination of the current movement step
MSStage::MSStage | ( | const MSEdge * | destination, |
MSStoppingPlace * | toStop, | ||
const double | arrivalPos, | ||
MSStageType | type, | ||
const std::string & | group = "" |
||
) |
constructor
Definition at line 47 of file MSStage.cpp.
|
virtual |
destructor
Definition at line 58 of file MSStage.cpp.
|
private |
Invalidated copy constructor.
|
inlinevirtual |
abort this stage (TraCI)
Reimplemented in MSPerson::MSPersonStage_Walking, MSStageWaiting, and MSStageDriving.
Definition at line 136 of file MSStage.h.
Referenced by GUIPerson::GUIPersonPopupMenu::onCmdRemoveObject().
|
pure virtual |
Implemented in MSPerson::MSPersonStage_Walking, MSPerson::MSPersonStage_Access, MSStageDriving, MSStageTranship, MSStageTrip, and MSStageWaiting.
|
pure virtual |
returns the angle of the transportable
Implemented in MSPerson::MSPersonStage_Access, MSStageDriving, MSStageMoving, MSStageTrip, and MSStageWaiting.
|
inlinevirtual |
Reimplemented in MSPerson::MSPersonStage_Walking, MSStageDriving, and MSStageTranship.
Definition at line 89 of file MSStage.h.
References myArrivalPos.
Referenced by MSPModel_NonInteracting::PState::computeDuration(), MSPModel_NonInteracting::CState::computeDuration(), MSPModel_Striping::getNextLane(), LIBSUMO_NAMESPACE::Person::getStage(), GUIPerson::getStageArrivalPos(), MSStageDriving::loadState(), MSPModel_Striping::moveInDirectionOnLane(), LIBSUMO_NAMESPACE::Person::moveToXY(), MSRouteHandler::parseWalkPositions(), MSPModel_Striping::PState::PState(), MSTransportable::rerouteParkingArea(), LIBSUMO_NAMESPACE::Person::rerouteTraveltime(), MSStageWaiting::routeOutput(), and MSStageTrip::setArrived().
SUMOTime MSStage::getArrived | ( | ) | const |
get arrival time of stage
Definition at line 122 of file MSStage.cpp.
References myArrived.
Referenced by LIBSUMO_NAMESPACE::Person::getStage().
SUMOTime MSStage::getDeparted | ( | ) | const |
get departure time of stage
Definition at line 117 of file MSStage.cpp.
References myDeparted.
Referenced by LIBSUMO_NAMESPACE::Person::getStage().
const MSEdge * MSStage::getDestination | ( | ) | const |
returns the destination edge
Definition at line 61 of file MSStage.cpp.
References myDestination.
Referenced by MSPerson::checkAccess(), MSStageDriving::getArrivalPos(), getEdges(), MSStageDriving::getEdges(), MSStageDriving::getStageSummary(), MSStageTranship::getStageSummary(), MSStageTrip::getStageSummary(), MSStageWaiting::getStageSummary(), MSPModel_Striping::moveInDirectionOnLane(), MSRouteHandler::parseWalkPositions(), MSTransportable::proceed(), MSStageDriving::registerWaiting(), MSTransportable::rerouteParkingArea(), MSStageDriving::routeOutput(), MSStageWaiting::routeOutput(), and MSStageTrip::setArrived().
|
inline |
returns the destination stop (if any)
Definition at line 80 of file MSStage.h.
References myDestinationStop.
Referenced by MSPerson::checkAccess(), GUIPerson::getDestinationStopID(), LIBSUMO_NAMESPACE::Person::getStage(), MSStageDriving::getStageSummary(), MSStageTranship::getStageSummary(), MSStageWaiting::getStageSummary(), MSStageDriving::loadState(), MSPModel_Striping::moveInDirectionOnLane(), MSDevice_Transportable::notifyMove(), GUIPerson::GUIPersonPopupMenu::onCmdRemoveObject(), MSRouteHandler::parseWalkPositions(), MSStageDriving::proceed(), MSTransportable::proceed(), MSStageDriving::registerWaiting(), MSTransportable::rerouteParkingArea(), and MSStageTrip::setArrived().
|
virtual |
Return the movement directon on the edge.
Reimplemented in MSStageDriving, and MSStageMoving.
Definition at line 84 of file MSStage.cpp.
References MSPModel::UNDEFINED_DIRECTION.
|
pure virtual |
get travel distance in this stage
Implemented in MSPerson::MSPersonStage_Walking, MSPerson::MSPersonStage_Access, MSStageDriving, MSStageTranship, MSStageTrip, and MSStageWaiting.
Referenced by LIBSUMO_NAMESPACE::Person::getStage().
|
virtual |
Returns the current edge.
Reimplemented in MSStageDriving, MSStageMoving, and MSStageTrip.
Definition at line 67 of file MSStage.cpp.
References myDestination.
Referenced by MSStageDriving::loadState(), GUIPerson::GUIPersonPopupMenu::onCmdRemoveObject(), MSPerson::MSPersonStage_Walking::proceed(), MSStageDriving::proceed(), MSStageWaiting::proceed(), MSTransportable::proceed(), and MSStageDriving::routeOutput().
double MSStage::getEdgeAngle | ( | const MSEdge * | e, |
double | at | ||
) | const |
get angle of the edge at a certain position
Definition at line 149 of file MSStage.cpp.
References MSEdge::getLanes().
Referenced by MSPModel_NonInteracting::PState::getAngle(), MSPModel_NonInteracting::CState::getAngle(), MSStageDriving::getAngle(), MSStageTrip::getAngle(), and MSStageWaiting::getAngle().
|
virtual |
Reimplemented in MSStageDriving, MSStageMoving, and MSStageTrip.
Definition at line 79 of file MSStage.cpp.
References myArrivalPos.
Referenced by MSEdge::transportable_by_position_sorter::operator()(), MSPerson::MSPersonStage_Walking::proceed(), MSStageDriving::proceed(), and MSStageTranship::proceed().
get position on edge e at length at with orthogonal offset
Definition at line 138 of file MSStage.cpp.
References getLanePosition(), and MSEdge::getLanes().
Referenced by MSStageDriving::getPosition(), MSStageTrip::getPosition(), and MSStageWaiting::getPosition().
|
virtual |
the edges of the current stage
Reimplemented in MSStageDriving, and MSStageMoving.
Definition at line 102 of file MSStage.cpp.
References getDestination().
Referenced by LIBSUMO_NAMESPACE::Person::getStage(), LIBSUMO_NAMESPACE::Person::rerouteTraveltime(), and MSStageTrip::setArrived().
|
virtual |
Reimplemented in MSStageDriving, and MSStageMoving.
Definition at line 73 of file MSStage.cpp.
References myDestination.
Referenced by MSTransportable::rerouteParkingArea().
|
inline |
|
inlinevirtual |
Returns the current lane (if applicable)
Reimplemented in MSStageDriving, and MSStageMoving.
get position on lane at length at with orthogonal offset
Definition at line 143 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().
|
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 GUIPerson::getGUIPosition(), MSTransportableControl::loadAnyWaiting(), MSStageDriving::loadState(), MSStageDriving::proceed(), and MSTransportable::proceed().
returns the position of the transportable
Implemented in MSPerson::MSPersonStage_Access, MSStageDriving, MSStageMoving, MSStageTrip, and MSStageWaiting.
|
inlinevirtual |
return index of current edge within route
Reimplemented in MSPerson::MSPersonStage_Walking.
|
virtual |
the speed of the transportable
Reimplemented in MSPerson::MSPersonStage_Access, MSStageDriving, and MSStageMoving.
Definition at line 96 of file MSStage.cpp.
|
pure virtual |
return (brief) string representation of the current stage
Implemented in MSPerson::MSPersonStage_Walking, MSPerson::MSPersonStage_Access, MSStageDriving, MSStageTranship, MSStageTrip, and MSStageWaiting.
Referenced by LIBSUMO_NAMESPACE::Person::getStage().
|
pure virtual |
return string summary of the current stage
Implemented in MSPerson::MSPersonStage_Walking, MSPerson::MSPersonStage_Access, MSStageDriving, MSStageTranship, MSStageTrip, and MSStageWaiting.
|
inline |
Definition at line 117 of file MSStage.h.
References myType.
Referenced by MSPerson::checkAccess(), LIBSUMO_NAMESPACE::Person::getStage(), MSStageDriving::loadState(), MSStageDriving::proceed(), MSTransportable::proceed(), MSTransportable::rerouteParkingArea(), MSStageDriving::routeOutput(), and MSStageTrip::routeOutput().
|
inlinevirtual |
Current vehicle in which the transportable is driving (or nullptr)
Reimplemented in MSStageDriving.
Definition at line 162 of file MSStage.h.
Referenced by GUIPerson::getVehicleID().
the time this transportable spent waiting
Reimplemented in MSStageDriving, and MSStageMoving.
Definition at line 90 of file MSStage.cpp.
|
inlinevirtual |
Whether the transportable waits for a vehicle.
Reimplemented in MSStageDriving.
|
virtual |
Whether the transportable waits for the given vehicle.
Reimplemented in MSStageDriving.
Definition at line 133 of file MSStage.cpp.
|
inlinevirtual |
Reconstructs the current state, standard implementation does nothing.
Reimplemented in MSPerson::MSPersonStage_Walking, MSStageDriving, and MSStageWaiting.
Definition at line 219 of file MSStage.h.
References UNUSED_PARAMETER.
|
inline |
Definition at line 228 of file MSStage.h.
References myParametersSet.
Referenced by MSStageTrip::setArrived().
|
pure virtual |
proceeds to this stage
Implemented in MSPerson::MSPersonStage_Walking, MSPerson::MSPersonStage_Access, MSStageDriving, MSStageTranship, MSStageTrip, and MSStageWaiting.
|
pure virtual |
Called on writing vehroute output.
[in] | isPerson | Whether we are writing person or container info |
[in] | os | The stream to write the information into |
[in] | withRouteLength | whether route length shall be written |
[in] | previous | The previous stage for additional info such as from edge |
IOError | not yet implemented |
Implemented in MSPerson::MSPersonStage_Walking, MSStageDriving, MSStageTranship, MSStageTrip, MSStageWaiting, and MSPerson::MSPersonStage_Access.
Referenced by MSTransportable::routeOutput(), and MSTransportable::saveState().
|
inlinevirtual |
Saves the current state into the given stream, standard implementation does nothing.
Reimplemented in MSPerson::MSPersonStage_Walking, MSStageDriving, and MSStageWaiting.
Definition at line 213 of file MSStage.h.
References UNUSED_PARAMETER.
|
inline |
Definition at line 93 of file MSStage.h.
References myArrivalPos.
Referenced by MSTransportable::rerouteParkingArea(), and MSStageTrip::setArrived().
|
virtual |
logs end of the step
Reimplemented in MSStageDriving, and MSStageTrip.
Definition at line 127 of file MSStage.cpp.
References myArrived.
Referenced by MSTransportable::proceed(), MSStageDriving::setArrived(), and MSStageTrip::setArrived().
void MSStage::setDeparted | ( | SUMOTime | now | ) |
void MSStage::setDestination | ( | const MSEdge * | newDestination, |
MSStoppingPlace * | newDestStop | ||
) |
Definition at line 155 of file MSStage.cpp.
References MSStoppingPlace::getBeginLanePosition(), MSStoppingPlace::getEndLanePosition(), myArrivalPos, myDestination, and myDestinationStop.
Referenced by MSTransportable::rerouteParkingArea().
|
inlinevirtual |
sets the walking speed (ignored in other stages)
Reimplemented in MSPerson::MSPersonStage_Walking.
|
pure virtual |
Called on writing tripinfo output.
[in] | os | The stream to write the information into |
IOError | not yet implemented |
Implemented in MSPerson::MSPersonStage_Walking, MSPerson::MSPersonStage_Access, MSStageDriving, MSStageTranship, MSStageTrip, and MSStageWaiting.
|
inline |
Definition at line 224 of file MSStage.h.
References myParametersSet.
Referenced by MSStageTrip::routeOutput(), and MSStageTrip::setArrived().
|
protected |
the position at which we want to arrive
Definition at line 241 of file MSStage.h.
Referenced by MSStageDriving::clone(), MSStageTranship::clone(), MSStageTrip::clone(), MSStageWaiting::clone(), MSStageDriving::getAngle(), MSStageWaiting::getAngle(), MSPerson::MSPersonStage_Walking::getArrivalPos(), getArrivalPos(), MSStageDriving::getArrivalPos(), MSStageTranship::getArrivalPos(), getEdgePos(), MSStageDriving::getEdgePos(), MSStageDriving::getPosition(), MSStageWaiting::getPosition(), MSPerson::MSPersonStage_Walking::MSPersonStage_Walking(), MSStageTranship::MSStageTranship(), MSStageDriving::routeOutput(), MSStageTrip::routeOutput(), setArrivalPos(), MSStageDriving::setArrived(), MSStageTrip::setArrived(), setDestination(), MSStageTranship::tripInfoOutput(), MSStageWaiting::tripInfoOutput(), and MSStageDriving::unspecifiedArrivalPos().
|
protected |
the time at which this stage ended
Definition at line 247 of file MSStage.h.
Referenced by MSStageDriving::getAngle(), getArrived(), MSStageDriving::getDirection(), MSStageTranship::getDistance(), MSStageDriving::getEdge(), MSStageDriving::getEdgePos(), MSStageDriving::getPosition(), MSStageDriving::isWaiting4Vehicle(), MSStageDriving::loadState(), MSStageDriving::routeOutput(), MSStageTranship::routeOutput(), MSStageTrip::routeOutput(), MSStageWaiting::routeOutput(), MSStageDriving::saveState(), setArrived(), MSStageDriving::tripInfoOutput(), MSStageTranship::tripInfoOutput(), and MSStageWaiting::tripInfoOutput().
|
protected |
the time at which this stage started
Definition at line 244 of file MSStage.h.
Referenced by getDeparted(), MSStageTranship::getDistance(), MSStageDriving::loadState(), MSStageWaiting::loadState(), MSStageTranship::proceed(), MSStageWaiting::proceed(), MSStageDriving::routeOutput(), MSStageTranship::routeOutput(), MSStageWaiting::routeOutput(), MSStageDriving::saveState(), MSStageWaiting::saveState(), setDeparted(), MSStageDriving::tripInfoOutput(), MSStageTranship::tripInfoOutput(), and MSStageWaiting::tripInfoOutput().
|
protected |
the next edge to reach by getting transported
Definition at line 235 of file MSStage.h.
Referenced by MSStageDriving::abort(), MSStageDriving::clone(), MSStageTrip::clone(), MSStageWaiting::clone(), MSStageDriving::getAngle(), MSStageWaiting::getAngle(), getDestination(), getEdge(), MSStageDriving::getEdge(), getFromEdge(), MSStageDriving::getPosition(), MSStageWaiting::getPosition(), MSStageDriving::isWaitingFor(), MSStageWaiting::loadState(), MSStageTrip::routeOutput(), MSStageTrip::setArrived(), and setDestination().
|
protected |
the stop to reach by getting transported (if any)
Definition at line 238 of file MSStage.h.
Referenced by MSStageDriving::abort(), MSStageDriving::canLeaveVehicle(), MSStageDriving::clone(), MSStageTranship::clone(), MSStageTrip::clone(), MSStageWaiting::clone(), getDestinationStop(), MSStageDriving::getWaitingDescription(), MSStageDriving::isWaitingFor(), MSStageWaiting::loadState(), MSStageTranship::moveToNextEdge(), MSPerson::MSPersonStage_Access::MSPersonStage_Access(), MSStageWaiting::proceed(), MSStageDriving::routeOutput(), MSStageTranship::routeOutput(), MSStageTrip::routeOutput(), MSStageWaiting::routeOutput(), MSStageTrip::setArrived(), and setDestination().
|
protected |
The id of the group of transportables traveling together.
Definition at line 253 of file MSStage.h.
Referenced by MSStageDriving::abort(), MSStageDriving::clone(), MSStageTrip::clone(), getGroup(), MSStageDriving::registerWaiting(), MSStageTrip::routeOutput(), and MSStageTrip::setArrived().
|
protected |
|
protected |
The type of this stage.
Definition at line 250 of file MSStage.h.
Referenced by MSStageWaiting::abort(), MSStageWaiting::clone(), getStageType(), MSStageWaiting::routeOutput(), and MSStageWaiting::tripInfoOutput().
|
staticprotected |
the offset for computing positions when standing at an edge
Definition at line 259 of file MSStage.h.
Referenced by MSStageDriving::getPosition(), MSStageTrip::getPosition(), and MSStageWaiting::getPosition().