![]() |
SUMO - Simulation of Urban MObility
|
#include <MSContainer.h>
Public Member Functions | |
virtual void | beginEventOutput (const MSTransportable &c, SUMOTime t, OutputDevice &os) const |
Called for writing the events output. More... | |
virtual void | endEventOutput (const MSTransportable &c, SUMOTime t, OutputDevice &os) const |
Called for writing the events output (end of an action) More... | |
SUMOReal | getAngle (SUMOTime now) const |
Returns the angle of the container. More... | |
SUMOReal | getArrivalPos () const |
CState * | getContainerState () const |
SUMOReal | getDepartPos () const |
const MSEdge & | getDestination () const |
returns the destination edge More... | |
const MSStoppingPlace * | getDestinationStop () const |
returns the destination stop (if any) More... | |
const MSEdge * | getEdge () const |
Returns the current edge. More... | |
SUMOReal | getEdgeAngle (const MSEdge *e, SUMOReal at) const |
get angle of the edge at a certain position More... | |
SUMOReal | 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, SUMOReal at, SUMOReal offset) const |
get position on edge e at length at with orthogonal offset More... | |
const MSEdge * | getFromEdge () const |
Returns first edge of the containers route. More... | |
Position | getLanePosition (const MSLane *lane, SUMOReal at, SUMOReal offset) const |
get position on lane at length at with orthogonal offset More... | |
SUMOReal | getMaxSpeed () const |
accessors to be used by MSCModel_NonInteracting More... | |
const MSEdge * | getNextRouteEdge () const |
Position | getPosition (SUMOTime now) const |
Returns the position of the container. More... | |
SUMOReal | getSpeed () const |
Returns the speed of the container. More... | |
std::string | getStageDescription () const |
Returns the current stage description as a string. More... | |
StageType | getStageType () const |
const MSEdge * | getToEdge () const |
Returns last edge of the containers route. More... | |
virtual SUMOVehicle * | getVehicle () 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 std::string &line) const |
Whether the transportable waits for a vehicle of the line specified. More... | |
bool | moveToNextEdge (MSTransportable *container, SUMOTime currentTime, MSEdge *nextInternal=0) |
move forward and return whether the container arrived More... | |
MSContainerStage_Tranship (const std::vector< const MSEdge * > &route, MSStoppingPlace *toStop, SUMOReal speed, SUMOReal departPos, SUMOReal arrivalPos) | |
constructor More... | |
virtual void | proceed (MSNet *net, MSTransportable *container, SUMOTime now, Stage *previous) |
proceeds to the next step More... | |
virtual void | routeOutput (OutputDevice &os) const |
Called on writing vehroute output. More... | |
void | setArrived (SUMOTime now) |
logs end of the step More... | |
void | setDeparted (SUMOTime now) |
logs end of the step More... | |
virtual void | tripInfoOutput (OutputDevice &os) const |
Called on writing tripinfo output. More... | |
~MSContainerStage_Tranship () | |
destructor More... | |
Protected Attributes | |
SUMOReal | 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 *const | myDestinationStop |
the stop to reach by getting transported (if any) More... | |
StageType | myType |
The type of this stage. More... | |
Private Member Functions | |
MSContainerStage_Tranship (const MSContainerStage_Tranship &) | |
Invalidated copy constructor. More... | |
MSContainerStage_Tranship & | operator= (const MSContainerStage_Tranship &) |
Invalidated assignment operator. More... | |
Private Attributes | |
CState * | myContainerState |
state that is to be manipulated by MSCModel More... | |
MSEdge * | myCurrentInternalEdge |
The current internal edge this container is on or 0. More... | |
SUMOReal | myDepartPos |
the depart position More... | |
std::vector< const MSEdge * > | myRoute |
The route of the container. More... | |
std::vector< const MSEdge * >::iterator | myRouteStep |
current step More... | |
SUMOReal | mySpeed |
the speed of the container More... | |
Friends | |
class | MSCModel_NonInteracting |
A "real" stage performing the tranship of a container A container is in this stage if it gets transhipred between two stops that are assumed to be connected.
Definition at line 112 of file MSContainer.h.
MSContainer::MSContainerStage_Tranship::MSContainerStage_Tranship | ( | const std::vector< const MSEdge * > & | route, |
MSStoppingPlace * | toStop, | ||
SUMOReal | speed, | ||
SUMOReal | departPos, | ||
SUMOReal | arrivalPos | ||
) |
constructor
Definition at line 114 of file MSContainer.cpp.
References SUMOVehicleParameter::interpretEdgePos(), myDepartPos, myRoute, and SUMO_ATTR_DEPARTPOS.
MSContainer::MSContainerStage_Tranship::~MSContainerStage_Tranship | ( | ) |
destructor
Definition at line 125 of file MSContainer.cpp.
|
private |
Invalidated copy constructor.
|
virtual |
Called for writing the events output.
[in] | os | The stream to write the information into |
IOError | not yet implemented |
Implements MSTransportable::Stage.
Definition at line 197 of file MSContainer.cpp.
References MSTransportable::getID(), myRoute, OutputDevice::openTag(), time2string(), and OutputDevice::writeAttr().
|
virtual |
Called for writing the events output (end of an action)
[in] | os | The stream to write the information into |
IOError | not yet implemented |
Implements MSTransportable::Stage.
Definition at line 204 of file MSContainer.cpp.
References MSTransportable::getID(), myRoute, OutputDevice::openTag(), time2string(), and OutputDevice::writeAttr().
Returns the angle of the container.
Implements MSTransportable::Stage.
Definition at line 167 of file MSContainer.cpp.
References CState::getAngle(), and myContainerState.
|
inline |
Definition at line 191 of file MSContainer.h.
References MSTransportable::Stage::myArrivalPos.
Referenced by CState::computeTranshipTime().
|
inline |
Definition at line 199 of file MSContainer.h.
|
inline |
Definition at line 187 of file MSContainer.h.
Referenced by CState::computeTranshipTime().
|
inherited |
returns the destination edge
Definition at line 63 of file MSTransportable.cpp.
References MSTransportable::Stage::myDestination.
Referenced by MSPModel_Striping::moveInDirectionOnLane(), MSContainer::MSContainerStage_Driving::routeOutput(), MSTransportable::Stage_Waiting::routeOutput(), and MSPerson::MSPersonStage_Driving::routeOutput().
|
inlineinherited |
returns the destination stop (if any)
Definition at line 83 of file MSTransportable.h.
References MSTransportable::Stage::myDestinationStop.
Referenced by MSPModel_Striping::moveInDirectionOnLane(), MSContainer::MSContainerStage_Driving::proceed(), and MSPerson::MSPersonStage_Driving::proceed().
|
virtual |
Returns the current edge.
Implements MSTransportable::Stage.
Definition at line 138 of file MSContainer.cpp.
References myCurrentInternalEdge, and myRouteStep.
Referenced by CState::getAngle(), and moveToNextEdge().
get angle of the edge at a certain position
Definition at line 96 of file MSTransportable.cpp.
References MSEdge::getLanes().
Referenced by MSPModel_NonInteracting::PState::getAngle(), CState::getAngle(), MSTransportable::Stage_Waiting::getAngle(), MSTransportable::Stage_Driving::getAngle(), and MSTransportable::Stage::getVehicle().
Returns the offset from the start of the current edge measured in its natural direction.
Implements MSTransportable::Stage.
Definition at line 157 of file MSContainer.cpp.
References CState::getEdgePos(), and myContainerState.
|
inherited |
get position on edge e at length at with orthogonal offset
Definition at line 86 of file MSTransportable.cpp.
References MSTransportable::Stage::getLanePosition(), and MSEdge::getLanes().
Referenced by MSTransportable::Stage_Waiting::getPosition(), MSTransportable::Stage_Driving::getPosition(), and MSTransportable::Stage::getVehicle().
|
virtual |
Returns first edge of the containers route.
Implements MSTransportable::Stage.
Definition at line 147 of file MSContainer.cpp.
References myRoute.
Referenced by CState::computeTranshipTime().
|
inherited |
get position on lane at length at with orthogonal offset
Definition at line 91 of file MSTransportable.cpp.
References MSLane::getShape(), MSLane::interpolateLanePosToGeometryPos(), PositionVector::positionAtOffset(), and SUMOReal.
Referenced by CState::computeTranshipTime(), MSTransportable::Stage::getEdgePosition(), MSPModel_NonInteracting::PState::getPosition(), MSPModel_Striping::PState::getPosition(), and MSTransportable::Stage::getVehicle().
|
inline |
accessors to be used by MSCModel_NonInteracting
Definition at line 183 of file MSContainer.h.
Referenced by CState::computeTranshipTime(), CState::getPosition(), and CState::getSpeed().
|
inline |
Definition at line 195 of file MSContainer.h.
Returns the position of the container.
Implements MSTransportable::Stage.
Definition at line 162 of file MSContainer.cpp.
References CState::getPosition(), myContainerState, and SUMOReal.
|
virtual |
Returns the speed of the container.
Implements MSTransportable::Stage.
Definition at line 177 of file MSContainer.cpp.
References CState::getSpeed(), and myContainerState.
|
inlinevirtual |
Returns the current stage description as a string.
Implements MSTransportable::Stage.
Definition at line 150 of file MSContainer.h.
References MSTransportable::Stage_Driving::beginEventOutput(), MSTransportable::Stage_Driving::endEventOutput(), MSContainer::MSContainerStage_Driving::routeOutput(), and MSContainer::MSContainerStage_Driving::tripInfoOutput().
|
inlineinherited |
const MSEdge * MSContainer::MSContainerStage_Tranship::getToEdge | ( | ) | const |
Returns last edge of the containers route.
Definition at line 152 of file MSContainer.cpp.
References myRoute, and SUMOReal.
Referenced by CState::computeTranshipTime().
|
inlinevirtualinherited |
Whether the transportable waits for a vehicle.
Reimplemented in MSTransportable::Stage_Driving.
Definition at line 128 of file MSTransportable.h.
References MSTransportable::Stage::beginEventOutput(), MSTransportable::Stage::endEventOutput(), MSTransportable::Stage::getEdgeAngle(), MSTransportable::Stage::getEdgePosition(), MSTransportable::Stage::getLanePosition(), MSTransportable::Stage::getSpeed(), MSTransportable::Stage::getWaitingTime(), MSTransportable::Stage::routeOutput(), SUMOReal, and MSTransportable::Stage::tripInfoOutput().
Returns the time the container spent waiting.
Implements MSTransportable::Stage.
Definition at line 172 of file MSContainer.cpp.
References SUMOReal.
|
inlinevirtualinherited |
Whether the transportable waits for a vehicle.
Reimplemented in MSTransportable::Stage_Driving.
Definition at line 123 of file MSTransportable.h.
|
virtualinherited |
Whether the transportable waits for a vehicle of the line specified.
Reimplemented in MSTransportable::Stage_Driving.
Definition at line 81 of file MSTransportable.cpp.
Referenced by MSTransportable::Stage::getStageType().
bool MSContainer::MSContainerStage_Tranship::moveToNextEdge | ( | MSTransportable * | container, |
SUMOTime | currentTime, | ||
MSEdge * | nextInternal = 0 |
||
) |
move forward and return whether the container arrived
Definition at line 210 of file MSContainer.cpp.
References MSStoppingPlace::addTransportable(), MSTransportableControl::erase(), MSNet::getContainerControl(), getEdge(), MSNet::getInstance(), myCurrentInternalEdge, MSTransportable::Stage::myDestinationStop, myRoute, myRouteStep, and MSTransportable::proceed().
|
private |
Invalidated assignment operator.
|
virtual |
proceeds to the next step
Implements MSTransportable::Stage.
Definition at line 129 of file MSContainer.cpp.
References MSCModel_NonInteracting::add(), MSTransportable::Stage::getEdge(), MSTransportable::Stage::getEdgePos(), MSCModel_NonInteracting::getModel(), myContainerState, myDepartPos, myRoute, myRouteStep, and MSEdge::removeContainer().
|
virtual |
Called on writing vehroute output.
[in] | os | The stream to write the information into |
IOError | not yet implemented |
Implements MSTransportable::Stage.
Definition at line 189 of file MSContainer.cpp.
References OutputDevice::closeTag(), myRoute, mySpeed, OutputDevice::openTag(), SUMO_ATTR_EDGES, SUMO_ATTR_SPEED, and OutputDevice::writeAttr().
|
inherited |
logs end of the step
Definition at line 76 of file MSTransportable.cpp.
References MSTransportable::Stage::myArrived.
Referenced by MSTransportable::Stage::getStageType(), MSContainer::proceed(), and MSPerson::proceed().
|
inherited |
logs end of the step
Definition at line 69 of file MSTransportable.cpp.
References MSTransportable::Stage::myDeparted.
Referenced by MSTransportable::Stage::getStageType(), and MSTransportable::getVehicleType().
|
virtual |
Called on writing tripinfo output.
[in] | os | The stream to write the information into |
IOError | not yet implemented |
Implements MSTransportable::Stage.
Definition at line 183 of file MSContainer.cpp.
References OutputDevice::closeTag(), MSTransportable::Stage::myArrived, OutputDevice::openTag(), time2string(), and OutputDevice::writeAttr().
|
friend |
Definition at line 113 of file MSContainer.h.
|
protectedinherited |
the position at which we want to arrive
Definition at line 179 of file MSTransportable.h.
Referenced by MSPerson::MSPersonStage_Walking::computeAverageSpeed(), MSTransportable::Stage_Waiting::getAngle(), MSTransportable::Stage::getArrivalPos(), MSPerson::MSPersonStage_Walking::getArrivalPos(), getArrivalPos(), MSTransportable::Stage_Waiting::getEdgePos(), and MSTransportable::Stage_Waiting::getPosition().
|
protectedinherited |
the time at which this stage ended
Definition at line 185 of file MSTransportable.h.
Referenced by MSTransportable::Stage::setArrived(), MSContainer::MSContainerStage_Driving::tripInfoOutput(), MSPerson::MSPersonStage_Walking::tripInfoOutput(), tripInfoOutput(), MSTransportable::Stage_Waiting::tripInfoOutput(), and MSPerson::MSPersonStage_Driving::tripInfoOutput().
|
private |
state that is to be manipulated by MSCModel
Definition at line 217 of file MSContainer.h.
Referenced by getAngle(), getEdgePos(), getPosition(), getSpeed(), and proceed().
|
private |
The current internal edge this container is on or 0.
Definition at line 220 of file MSContainer.h.
Referenced by getEdge(), and moveToNextEdge().
|
protectedinherited |
the time at which this stage started
Definition at line 182 of file MSTransportable.h.
Referenced by MSTransportable::Stage::setDeparted(), MSContainer::MSContainerStage_Driving::tripInfoOutput(), and MSPerson::MSPersonStage_Driving::tripInfoOutput().
|
private |
the depart position
Definition at line 211 of file MSContainer.h.
Referenced by MSContainerStage_Tranship(), and proceed().
|
protectedinherited |
the next edge to reach by getting transported
Definition at line 173 of file MSTransportable.h.
Referenced by MSTransportable::Stage_Waiting::getAngle(), MSTransportable::Stage::getDestination(), MSTransportable::Stage_Waiting::getEdge(), MSTransportable::Stage_Waiting::getFromEdge(), and MSTransportable::Stage_Waiting::getPosition().
|
protectedinherited |
the stop to reach by getting transported (if any)
Definition at line 176 of file MSTransportable.h.
Referenced by MSTransportable::Stage::getDestinationStop(), MSPerson::MSPersonStage_Walking::moveToNextEdge(), and moveToNextEdge().
|
private |
The route of the container.
Definition at line 205 of file MSContainer.h.
Referenced by beginEventOutput(), endEventOutput(), getFromEdge(), getToEdge(), moveToNextEdge(), MSContainerStage_Tranship(), proceed(), and routeOutput().
|
private |
current step
Definition at line 208 of file MSContainer.h.
Referenced by getEdge(), moveToNextEdge(), and proceed().
|
private |
the speed of the container
Definition at line 214 of file MSContainer.h.
Referenced by routeOutput().
|
protectedinherited |
The type of this stage.
Definition at line 188 of file MSTransportable.h.
Referenced by MSTransportable::Stage::getStageType(), MSTransportable::Stage_Waiting::routeOutput(), and MSTransportable::Stage_Waiting::tripInfoOutput().