SUMO - Simulation of Urban MObility
MSTransportable Class Referenceabstract

#include <MSTransportable.h>

Inheritance diagram for MSTransportable:
Inheritance graph
Collaboration diagram for MSTransportable:
Collaboration graph

Data Structures

class  Stage
 
class  Stage_Driving
 
class  Stage_Waiting
 

Public Types

typedef std::vector< MSTransportable::Stage * > MSTransportablePlan
 the structure holding the plan of a transportable More...
 
enum  StageType {
  WAITING_FOR_DEPART = 0, WAITING = 1, MOVING_WITHOUT_VEHICLE = 2, DRIVING = 3,
  ACCESS = 4
}
 

Public Member Functions

void appendStage (Stage *stage, int next=-1)
 Appends the given stage to the current plan. More...
 
virtual double getAngle () const
 return the current angle of the transportable More...
 
const MSEdge * getArrivalEdge () const
 returns the final arrival edge More...
 
double getArrivalPos () const
 returns the final arrival pos More...
 
PositionVector getBoundingBox () const
 return the bounding box of the person More...
 
MSTransportable::Stage * getCurrentStage () const
 Return the current stage. More...
 
std::string getCurrentStageDescription () const
 Returns the current stage description as a string. More...
 
StageType getCurrentStageType () const
 the current stage type of the transportable More...
 
SUMOTime getDesiredDepart () const
 Returns the desired departure time. More...
 
const MSEdge * getDestination () const
 Returns the current destination. More...
 
const MSEdge * getEdge () const
 Returns the current edge. More...
 
virtual double getEdgePos () const
 Return the position on the edge. More...
 
ConstMSEdgeVector getEdges (int next) const
 Return the edges of the nth next stage. More...
 
const MSEdge * getFromEdge () const
 Returns the departure edge. More...
 
const std::string & getID () const
 returns the id of the transportable More...
 
const MSEdge * getNextDestination () const
 Returns the destination after the current destination. More...
 
MSTransportable::Stage * getNextStage (int next) const
 Return the current stage. More...
 
int getNumRemainingStages () const
 Return the number of remaining stages (including the current) More...
 
int getNumStages () const
 Return the total number stages in this persons plan. More...
 
const SUMOVehicleParameter & getParameter () const
 
virtual Position getPosition () const
 Return the Network coordinate of the transportable. More...
 
MSVehicleType & getSingularType ()
 Replaces the current vehicle type with a new one used by this vehicle only. More...
 
virtual double getSpeed () const
 the current speed of the transportable More...
 
virtual double getSpeedFactor () const
 the current speed factor of the transportable (where applicable) More...
 
std::string getStageSummary (int stageIndex) const
 return textual summary for the given stage More...
 
StageType getStageType (int next) const
 the stage type for the nth next stage More...
 
SUMOVehicle * getVehicle () const
 The vehicle associated with this transportable. More...
 
const MSVehicleType & getVehicleType () const
 
virtual double getWaitingSeconds () const
 the time this transportable spent waiting in seconds More...
 
bool hasArrived () const
 return whether the person has reached the end of its plan More...
 
bool isWaiting4Vehicle () const
 Whether the transportable waits for a vehicle. More...
 
bool isWaitingFor (const std::string &line) const
 Whether the transportable waits for a vehicle of the line specified. More...
 
 MSTransportable (const SUMOVehicleParameter *pars, MSVehicleType *vtype, MSTransportablePlan *plan)
 constructor More...
 
virtual bool proceed (MSNet *net, SUMOTime time)=0
 
void removeStage (int next)
 removes the nth next stage More...
 
void replaceVehicleType (MSVehicleType *type)
 Replaces the current vehicle type by the one given. More...
 
void rerouteParkingArea (MSStoppingPlace *orig, MSStoppingPlace *replacement)
 adapt plan when the vehicle reroutes and now stops at replacement instead of orig More...
 
virtual void routeOutput (OutputDevice &os) const =0
 Called on writing vehroute output. More...
 
void setDeparted (SUMOTime now)
 logs depart time of the current stage More...
 
void setSpeed (double speed)
 sets the walking speed (ignored in other stages) More...
 
virtual void tripInfoOutput (OutputDevice &os, MSTransportable *transportable) const =0
 Called on writing tripinfo output. More...
 
virtual ~MSTransportable ()
 destructor More...
 

Protected Attributes

const SUMOVehicleParameter * myParameter
 the plan of the transportable More...
 
MSTransportablePlan * myPlan
 the plan of the transportable More...
 
MSTransportablePlan::iterator myStep
 the iterator over the route More...
 
MSVehicleType * myVType
 This transportable's type. (mainly used for drawing related information Note sure if it is really necessary. More...
 
bool myWriteEvents
 Whether events shall be written. More...
 

Static Protected Attributes

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

Private Member Functions

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

Detailed Description

The class holds a simulated moveable object

Definition at line 56 of file MSTransportable.h.

Member Typedef Documentation

◆ MSTransportablePlan

the structure holding the plan of a transportable

Definition at line 386 of file MSTransportable.h.

Member Enumeration Documentation

◆ StageType

Enumerator
WAITING_FOR_DEPART 
WAITING 
MOVING_WITHOUT_VEHICLE 
DRIVING 
ACCESS 

Definition at line 58 of file MSTransportable.h.

Constructor & Destructor Documentation

◆ MSTransportable() [1/2]

MSTransportable::MSTransportable ( const SUMOVehicleParameter *  pars,
MSVehicleType *  vtype,
MSTransportablePlan *  plan 
)

constructor

Definition at line 429 of file MSTransportable.cpp.

References myPlan, and myStep.

◆ ~MSTransportable()

MSTransportable::~MSTransportable ( )
virtual

◆ MSTransportable() [2/2]

MSTransportable::MSTransportable ( const MSTransportable &  )
private

Invalidated copy constructor.

Member Function Documentation

◆ appendStage()

void MSTransportable::appendStage ( Stage *  stage,
int  next = -1 
)

◆ getAngle()

◆ getArrivalEdge()

const MSEdge* MSTransportable::getArrivalEdge ( ) const
inline

returns the final arrival edge

Definition at line 544 of file MSTransportable.h.

References getBoundingBox(), getSingularType(), hasArrived(), myPlan, replaceVehicleType(), and rerouteParkingArea().

Referenced by libsumo::Person::appendWaitingStage().

◆ getArrivalPos()

double MSTransportable::getArrivalPos ( ) const
inline

returns the final arrival pos

Definition at line 539 of file MSTransportable.h.

References myPlan.

Referenced by libsumo::Person::appendWaitingStage(), libsumo::Person::appendWalkingStage(), GUIPerson::getParameterWindow(), and MSPerson::reroute().

◆ getBoundingBox()

PositionVector MSTransportable::getBoundingBox ( ) const

◆ getCurrentStage()

◆ getCurrentStageDescription()

std::string MSTransportable::getCurrentStageDescription ( ) const
inline

◆ getCurrentStageType()

◆ getDesiredDepart()

SUMOTime MSTransportable::getDesiredDepart ( ) const

Returns the desired departure time.

Definition at line 454 of file MSTransportable.cpp.

References SUMOVehicleParameter::depart, and myParameter.

Referenced by getVehicleType(), MSContainer::routeOutput(), MSContainer::tripInfoOutput(), and MSPerson::tripInfoOutput().

◆ getDestination()

const MSEdge* MSTransportable::getDestination ( ) const
inline

◆ getEdge()

◆ getEdgePos()

◆ getEdges()

ConstMSEdgeVector MSTransportable::getEdges ( int  next) const
inline

◆ getFromEdge()

◆ getID()

const std::string & MSTransportable::getID ( ) const

returns the id of the transportable

Definition at line 449 of file MSTransportable.cpp.

References SUMOVehicleParameter::id, and myParameter.

Referenced by MSTransportableControl::abortWaitingForVehicle(), MSPModel_Remote::add(), MSPModel_Striping::add(), MSVehicle::addContainer(), MSVehicle::addPerson(), appendStage(), libsumo::Person::appendWalkingStage(), MSPerson::MSPersonStage_Walking::beginEventOutput(), MSContainer::MSContainerStage_Tranship::beginEventOutput(), MSTransportable::Stage_Waiting::beginEventOutput(), MSTransportable::Stage_Driving::beginEventOutput(), MSPModel_Striping::PState::distanceTo(), MSPerson::MSPersonStage_Walking::endEventOutput(), MSContainer::MSContainerStage_Tranship::endEventOutput(), MSTransportable::Stage_Waiting::endEventOutput(), MSTransportable::Stage_Driving::endEventOutput(), MSTransportableControl::erase(), MSPModel_Striping::MovePedestrians::execute(), MSPModel_Striping::getNeighboringObstacles(), MSPModel_Striping::getNextLane(), MSPModel_Striping::getNextLaneObstacles(), GUIContainer::getParameterWindow(), GUIPerson::getParameterWindow(), getSingularType(), MSPModel_Striping::getVehicleObstacles(), MSPedestrianPushButton::isActiveForEdge(), MSPModel_Striping::moveInDirection(), MSPModel_Striping::moveInDirectionOnLane(), MSPModel_Striping::PState::moveToNextLane(), libsumo::Person::moveToXY(), MSDevice_Transportable::notifyLeave(), MSPModel_Striping::by_xpos_sorter::operator()(), MSEdge::transportable_by_position_sorter::operator()(), MSContainer::MSContainerStage_Driving::proceed(), MSPerson::MSPersonStage_Driving::proceed(), MSPModel_Striping::PState::PState(), MSPerson::reroute(), rerouteParkingArea(), MSContainer::MSContainerStage_Driving::routeOutput(), MSContainer::routeOutput(), MSTransportable::Stage_Waiting::routeOutput(), MSPerson::MSPersonStage_Driving::routeOutput(), libsumo::Helper::setRemoteControlled(), MSContainer::tripInfoOutput(), MSPerson::MSPersonStage_Access::tripInfoOutput(), MSPerson::tripInfoOutput(), MSPModel_Striping::PState::walk(), MSFCDExport::writeTransportable(), and MSXMLRawOut::writeTransportable().

◆ getNextDestination()

const MSEdge* MSTransportable::getNextDestination ( ) const
inline

Returns the destination after the current destination.

Definition at line 421 of file MSTransportable.h.

References myStep.

◆ getNextStage()

MSTransportable::Stage* MSTransportable::getNextStage ( int  next) const
inline

Return the current stage.

Definition at line 481 of file MSTransportable.h.

References myPlan, and myStep.

Referenced by MSPerson::reroute(), and libsumo::Person::rerouteTraveltime().

◆ getNumRemainingStages()

int MSTransportable::getNumRemainingStages ( ) const

◆ getNumStages()

int MSTransportable::getNumStages ( ) const

Return the total number stages in this persons plan.

Definition at line 495 of file MSTransportable.cpp.

References myPlan.

Referenced by libsumo::Person::getEdges(), getEdges(), GUIPerson::getParameterWindow(), libsumo::Person::getStage(), and GUIPerson::GUIPersonPopupMenu::onCmdShowPlan().

◆ getParameter()

◆ getPosition()

Position MSTransportable::getPosition ( ) const
virtual

◆ getSingularType()

MSVehicleType & MSTransportable::getSingularType ( )

Replaces the current vehicle type with a new one used by this vehicle only.

If the currently used vehicle type is already marked as being used by this vehicle only, no new type is created.

Returns
The new modifiable vehicle type
See also
MSTransportable::myVType

Definition at line 554 of file MSTransportable.cpp.

References MSVehicleType::buildSingularType(), MSVehicleType::getID(), getID(), MSVehicleType::isVehicleSpecific(), myVType, and replaceVehicleType().

Referenced by getArrivalEdge(), TraCIServerAPI_Person::processSet(), and libsumo::Person::setParameter().

◆ getSpeed()

double MSTransportable::getSpeed ( ) const
virtual

the current speed of the transportable

Reimplemented in GUIPerson, and GUIContainer.

Definition at line 484 of file MSTransportable.cpp.

Referenced by libsumo::Person::getSpeed(), GUIContainer::getSpeed(), GUIPerson::getSpeed(), and MSFCDExport::writeTransportable().

◆ getSpeedFactor()

virtual double MSTransportable::getSpeedFactor ( ) const
inlinevirtual

the current speed factor of the transportable (where applicable)

Reimplemented in MSPerson.

Definition at line 451 of file MSTransportable.h.

Referenced by GUIContainer::getParameterWindow().

◆ getStageSummary()

std::string MSTransportable::getStageSummary ( int  stageIndex) const

return textual summary for the given stage

Definition at line 583 of file MSTransportable.cpp.

References myPlan.

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

◆ getStageType()

StageType MSTransportable::getStageType ( int  next) const
inline

◆ getVehicle()

SUMOVehicle* MSTransportable::getVehicle ( ) const
inline

The vehicle associated with this transportable.

Definition at line 525 of file MSTransportable.h.

References appendStage(), removeStage(), and MSTransportable::Stage::setSpeed().

Referenced by libsumo::Person::getVehicle().

◆ getVehicleType()

◆ getWaitingSeconds()

double MSTransportable::getWaitingSeconds ( ) const
virtual

◆ hasArrived()

bool MSTransportable::hasArrived ( ) const

return whether the person has reached the end of its plan

Definition at line 590 of file MSTransportable.cpp.

References myPlan, and myStep.

Referenced by getArrivalEdge(), and MSPerson::routeOutput().

◆ isWaiting4Vehicle()

bool MSTransportable::isWaiting4Vehicle ( ) const
inline

Whether the transportable waits for a vehicle.

Definition at line 520 of file MSTransportable.h.

Referenced by GUIContainer::drawGL(), GUIContainer::getColorValue(), GUIPerson::getColorValue(), and GUIPerson::getGUIPosition().

◆ isWaitingFor()

bool MSTransportable::isWaitingFor ( const std::string &  line) const
inline

Whether the transportable waits for a vehicle of the line specified.

Definition at line 515 of file MSTransportable.h.

◆ operator=()

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

Invalidated assignment operator.

◆ proceed()

◆ removeStage()

void MSTransportable::removeStage ( int  next)

removes the nth next stage

Definition at line 516 of file MSTransportable.cpp.

References appendStage(), getEdge(), getEdgePos(), MSNet::getInstance(), myPlan, myStep, and proceed().

Referenced by getVehicle(), libsumo::Person::removeStage(), and MSPerson::reroute().

◆ replaceVehicleType()

void MSTransportable::replaceVehicleType ( MSVehicleType *  type)

Replaces the current vehicle type by the one given.

If the currently used vehicle type is marked as being used by this vehicle only, it is deleted, first. The new, given type is then assigned to "myVType".

Parameters
[in]typeThe new vehicle type
See also
MSTransportable::myVType

Definition at line 545 of file MSTransportable.cpp.

References MSNet::getInstance(), MSNet::getVehicleControl(), MSVehicleType::isVehicleSpecific(), myVType, and MSVehicleControl::removeVType().

Referenced by getArrivalEdge(), getSingularType(), and libsumo::Person::setType().

◆ rerouteParkingArea()

◆ routeOutput()

virtual void MSTransportable::routeOutput ( OutputDevice &  os) const
pure virtual

Called on writing vehroute output.

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

Implemented in MSPerson, and MSContainer.

Referenced by MSTransportableControl::erase().

◆ setDeparted()

void MSTransportable::setDeparted ( SUMOTime  now)

logs depart time of the current stage

Definition at line 459 of file MSTransportable.cpp.

Referenced by MSTransportableControl::abortWaitingForVehicle().

◆ setSpeed()

void MSTransportable::setSpeed ( double  speed)

sets the walking speed (ignored in other stages)

Definition at line 537 of file MSTransportable.cpp.

References myPlan.

Referenced by libsumo::Person::setSpeed().

◆ tripInfoOutput()

virtual void MSTransportable::tripInfoOutput ( OutputDevice &  os,
MSTransportable *  transportable 
) const
pure virtual

Called on writing tripinfo output.

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

Implemented in MSPerson, and MSContainer.

Referenced by MSTransportableControl::erase().

Field Documentation

◆ myParameter

const SUMOVehicleParameter* MSTransportable::myParameter
protected

the plan of the transportable

Definition at line 583 of file MSTransportable.h.

Referenced by getDesiredDepart(), getID(), getParameter(), MSPerson::routeOutput(), and ~MSTransportable().

◆ myPlan

◆ myStep

◆ myVType

MSVehicleType* MSTransportable::myVType
protected

This transportable's type. (mainly used for drawing related information Note sure if it is really necessary.

Definition at line 587 of file MSTransportable.h.

Referenced by getSingularType(), GUIContainer::getTypeParameterWindow(), GUIPerson::getTypeParameterWindow(), getVehicleType(), replaceVehicleType(), and ~MSTransportable().

◆ myWriteEvents

bool MSTransportable::myWriteEvents
protected

Whether events shall be written.

Definition at line 590 of file MSTransportable.h.

◆ ROADSIDE_OFFSET

const double MSTransportable::ROADSIDE_OFFSET
staticprotected

the offset for computing positions when standing at an edge

Definition at line 580 of file MSTransportable.h.

Referenced by MSTransportable::Stage_Waiting::getPosition(), and MSTransportable::Stage_Driving::getPosition().


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