SUMO - Simulation of Urban MObility
SUMOVehicle Class Referenceabstract

Representation of a vehicle. More...

#include <SUMOVehicle.h>

Inheritance diagram for SUMOVehicle:
Inheritance graph
Collaboration diagram for SUMOVehicle:
Collaboration graph

Public Member Functions

virtual void addContainer (MSTransportable *container)=0
 Adds a container to this vehicle. More...
 
virtual void addPerson (MSTransportable *person)=0
 Adds a person to this vehicle. More...
 
virtual bool addStop (const SUMOVehicleParameter::Stop &stopPar, std::string &errorMsg, SUMOTime untilOffset=0)=0
 Adds a stop. More...
 
virtual SUMOReal getAcceleration () const =0
 Returns the vehicle's acceleration. More...
 
virtual SUMOReal getAngle () const =0
 Get the vehicle's angle. More...
 
virtual SUMOReal getArrivalPos () const =0
 Returns this vehicle's desired arrivalPos for its current route (may change on reroute) More...
 
virtual SUMOReal getChosenSpeedFactor () const =0
 
virtual const ConstMSEdgeVector::const_iterator & getCurrentRouteEdge () const =0
 Returns an iterator pointing to the current edge in this vehicles route. More...
 
virtual SUMOTime getDepartDelay () const =0
 
virtual SUMOTime getDeparture () const =0
 Returns this vehicle's real departure time. More...
 
virtual MSDevicegetDevice (const std::type_info &type) const =0
 Returns a device of the given type if it exists or 0. More...
 
virtual const std::vector< MSDevice * > & getDevices () const =0
 Returns this vehicle's devices. More...
 
virtual const MSEdgegetEdge () const =0
 Returns the edge the vehicle is currently at. More...
 
virtual const std::string & getID () const =0
 Get the vehicle's ID. More...
 
virtual SUMOReal getImpatience () const =0
 Returns this vehicles impatience. More...
 
virtual MSLanegetLane () const =0
 Returns the lane the vehicle is on. More...
 
virtual SUMOReal getMaxSpeed () const =0
 Returns the vehicle's maximum speed. More...
 
virtual unsigned int getNumberReroutes () const =0
 Returns the number of new routes this vehicle got. More...
 
virtual const SUMOVehicleParametergetParameter () const =0
 Returns the vehicle's parameter (including departure definition) More...
 
virtual Position getPosition (const SUMOReal offset=0) const =0
 Return current position (x/y, cartesian) More...
 
virtual SUMOReal getPositionOnLane () const =0
 Get the vehicle's position along the lane. More...
 
virtual const MSRoutegetRoute () const =0
 Returns the current route. More...
 
virtual SUMOReal getSlope () const =0
 Returns the slope of the road at vehicle's position. More...
 
virtual SUMOReal getSpeed () const =0
 Returns the vehicle's current speed. More...
 
virtual SUMOVehicleClass getVClass () const =0
 Returns the vehicle's access class. More...
 
virtual const MSVehicleTypegetVehicleType () const =0
 Returns the vehicle's type. More...
 
virtual SUMOTime getWaitingTime () const =0
 
virtual bool hasArrived () const =0
 Returns whether this vehicle has arrived. More...
 
virtual bool hasDeparted () const =0
 Returns whether this vehicle has departed. More...
 
virtual bool hasValidRoute (std::string &msg) const =0
 Validates the current route. More...
 
virtual bool isOnRoad () const =0
 Returns the information whether the vehicle is on a road (is simulated) More...
 
virtual bool isParking () const =0
 Returns the information whether the vehicle is parked. More...
 
virtual bool isStopped () const =0
 Returns whether the vehicle is at a stop. More...
 
virtual bool isStoppedTriggered () const =0
 Returns whether the vehicle is at a stop and waiting for a person or container to continue. More...
 
virtual void onDepart ()=0
 Called when the vehicle is inserted into the network. More...
 
virtual bool replaceRoute (const MSRoute *route, bool onInit=false, int offset=0)=0
 Replaces the current route by the given one. More...
 
virtual bool replaceRouteEdges (ConstMSEdgeVector &edges, bool onInit=false)=0
 Replaces the current route by the given edges. More...
 
virtual void reroute (SUMOTime t, SUMOAbstractRouter< MSEdge, SUMOVehicle > &router, const bool onInit=false, const bool withTaz=false)=0
 Performs a rerouting using the given router. More...
 
virtual void setArrivalPos (SUMOReal arrivalPos)=0
 Sets this vehicle's desired arrivalPos for its current route. More...
 
virtual void setChosenSpeedFactor (const SUMOReal factor)=0
 
virtual const MSEdgesuccEdge (unsigned int nSuccs) const =0
 Returns the nSuccs'th successor of edge the vehicle is currently at. More...
 
virtual ~SUMOVehicle ()
 Destructor. More...
 
state io
virtual void saveState (OutputDevice &out)=0
 Saves the states of a vehicle. More...
 
virtual void loadState (const SUMOSAXAttributes &attrs, const SUMOTime offset)=0
 Loads the state of this vehicle from the given description. More...
 

Detailed Description

Representation of a vehicle.

Definition at line 65 of file SUMOVehicle.h.

Constructor & Destructor Documentation

Member Function Documentation

virtual void SUMOVehicle::addContainer ( MSTransportable container)
pure virtual

Adds a container to this vehicle.

May do nothing since containers are not supported by default

Parameters
[in]containerThe container to add

Implemented in MSVehicle, and MSBaseVehicle.

Referenced by MSContainer::MSContainerStage_Driving::proceed(), and ~SUMOVehicle().

virtual void SUMOVehicle::addPerson ( MSTransportable person)
pure virtual

Adds a person to this vehicle.

May do nothing since persons are not supported by default

Parameters
[in]personThe person to add

Implemented in MSVehicle, and MSBaseVehicle.

Referenced by MSPerson::MSPersonStage_Driving::proceed(), and ~SUMOVehicle().

virtual bool SUMOVehicle::addStop ( const SUMOVehicleParameter::Stop stopPar,
std::string &  errorMsg,
SUMOTime  untilOffset = 0 
)
pure virtual

Adds a stop.

The stop is put into the sorted list.

Parameters
[in]stopThe stop to add
Returns
Whether the stop could be added

Implemented in MSVehicle.

Referenced by MSBaseVehicle::addStops(), and ~SUMOVehicle().

virtual SUMOReal SUMOVehicle::getAngle ( ) const
pure virtual

Get the vehicle's angle.

Returns
The angle of the vehicle (in degree)

Implemented in MSVehicle, and GUIVehicle.

Referenced by MSDevice_Battery::getPropEnergy(), MSDevice_Battery::notifyMove(), MSEmissionExport::write(), MSFCDExport::write(), MSFullExport::writeVehicles(), and ~SUMOVehicle().

virtual SUMOReal SUMOVehicle::getArrivalPos ( ) const
pure virtual

Returns this vehicle's desired arrivalPos for its current route (may change on reroute)

Returns
This vehicle's real arrivalPos

Implemented in MSBaseVehicle.

Referenced by MSDevice_Vehroutes::generateOutput(), MSDevice_Tripinfo::notifyLeave(), and ~SUMOVehicle().

virtual SUMOReal SUMOVehicle::getChosenSpeedFactor ( ) const
pure virtual
virtual const ConstMSEdgeVector::const_iterator& SUMOVehicle::getCurrentRouteEdge ( ) const
pure virtual

Returns an iterator pointing to the current edge in this vehicles route.

Returns
The current route pointer

Implemented in MSBaseVehicle.

Referenced by MSDevice_Tripinfo::computeLengthAndDuration(), MSDevice_Vehroutes::generateOutput(), and ~SUMOVehicle().

virtual SUMOTime SUMOVehicle::getDepartDelay ( ) const
pure virtual
virtual SUMOTime SUMOVehicle::getDeparture ( ) const
pure virtual
virtual MSDevice* SUMOVehicle::getDevice ( const std::type_info &  type) const
pure virtual

Returns a device of the given type if it exists or 0.

Implemented in MSBaseVehicle.

Referenced by MSInsertionControl::checkCandidates(), MSDevice_Example::notifyMove(), and ~SUMOVehicle().

virtual const std::vector<MSDevice*>& SUMOVehicle::getDevices ( ) const
pure virtual

Returns this vehicle's devices.

Returns
This vehicle's devices

Implemented in MSBaseVehicle.

Referenced by MSDevice_Tripinfo::generateOutput(), MSVehicleControl::scheduleVehicleRemoval(), and ~SUMOVehicle().

virtual const std::string& SUMOVehicle::getID ( ) const
pure virtual

Get the vehicle's ID.

Returns
The the ID of the vehicle

Implemented in MSBaseVehicle.

Referenced by MSDevice_Container::buildVehicleDevices(), MSDevice_Person::buildVehicleDevices(), MSDevice_Tripinfo::buildVehicleDevices(), MSDevice_Example::buildVehicleDevices(), MSDevice_BTsender::buildVehicleDevices(), MSDevice_BTreceiver::buildVehicleDevices(), MSDevice_Vehroutes::buildVehicleDevices(), MSDevice_Battery::buildVehicleDevices(), MSDevice_Emissions::buildVehicleDevices(), MSDevice_Routing::buildVehicleDevices(), MSInductLoop::collectVehiclesOnDet(), MSVehicleControl::deleteVehicle(), MSE3Collector::enter(), MSDevice::equippedByDefaultAssignmentOptions(), MSVTypeProbe::execute(), MSDevice_Vehroutes::generateOutput(), MSDevice_Tripinfo::generateOutput(), TraCIServerAPI_Vehicle::getSingularType(), MSEdge::insertVehicle(), MSE3Collector::leave(), MSInductLoop::leaveDetectorByMove(), MSDevice_BTsender::notifyEnter(), MSDevice_BTreceiver::notifyEnter(), MSTriggeredRerouter::notifyEnter(), MSE3Collector::MSE3EntryReminder::notifyLeave(), MSDevice_BTsender::notifyLeave(), MSDevice_BTreceiver::notifyLeave(), MSDevice_Example::notifyMove(), MSDevice_Battery::notifyMove(), MSDevice_BTsender::notifyMove(), MSDevice_BTreceiver::notifyMove(), MSMeanData::MeanDataValues::notifyMove(), MSLane::succLinkSec(), TraCIServer::vehicleStateChanged(), MSEmissionExport::write(), MSFCDExport::write(), MSInstantInductLoop::write(), MSAmitranTrajectories::writeVehicle(), MSFullExport::writeVehicles(), and ~SUMOVehicle().

virtual SUMOReal SUMOVehicle::getImpatience ( ) const
pure virtual

Returns this vehicles impatience.

Implemented in MSBaseVehicle.

Referenced by ~SUMOVehicle().

virtual MSLane* SUMOVehicle::getLane ( ) const
pure virtual

Returns the lane the vehicle is on.

Returns
The vehicle's current lane

Implemented in MSVehicle.

Referenced by GUIBaseVehicle::drawGL(), MSDevice_Battery::getPropEnergy(), MSDevice_Battery::notifyEnter(), MSDevice_Battery::notifyMove(), and ~SUMOVehicle().

virtual SUMOReal SUMOVehicle::getMaxSpeed ( ) const
pure virtual

Returns the vehicle's maximum speed.

Returns
The vehicle's maximum speed

Implemented in MSBaseVehicle.

Referenced by MSLane::getVehicleMaxSpeed(), MSDevice_Tripinfo::notifyMove(), and ~SUMOVehicle().

virtual unsigned int SUMOVehicle::getNumberReroutes ( ) const
pure virtual

Returns the number of new routes this vehicle got.

Returns
the number of new routes this vehicle got

Implemented in MSBaseVehicle.

Referenced by MSDevice_Tripinfo::generateOutput(), MSDevice_Vehroutes::writeXMLRoute(), and ~SUMOVehicle().

virtual Position SUMOVehicle::getPosition ( const SUMOReal  offset = 0) const
pure virtual

Return current position (x/y, cartesian)

If the vehicle is not in the net, Position::INVALID.

Parameters
[in]offsetoptional offset in longitudinal direction
Returns
The current position (in cartesian coordinates)
See also
myLane

Implemented in MSVehicle, and GUIVehicle.

Referenced by MSVTypeProbe::execute(), MSDevice_BTsender::notifyEnter(), MSDevice_BTreceiver::notifyEnter(), MSDevice_BTsender::notifyLeave(), MSDevice_BTreceiver::notifyLeave(), MSDevice_BTsender::notifyMove(), MSDevice_BTreceiver::notifyMove(), MSEmissionExport::write(), MSFCDExport::write(), MSFullExport::writeVehicles(), and ~SUMOVehicle().

virtual SUMOReal SUMOVehicle::getSlope ( ) const
pure virtual
virtual SUMOVehicleClass SUMOVehicle::getVClass ( ) const
pure virtual

Returns the vehicle's access class.

Returns
The vehicle's access class

Implemented in MSBaseVehicle.

Referenced by MSLane::getVehicleMaxSpeed(), MSDevice_Routing::reroute(), and ~SUMOVehicle().

virtual SUMOTime SUMOVehicle::getWaitingTime ( ) const
pure virtual

Implemented in MSVehicle.

Referenced by MSBaseVehicle::getImpatience(), and ~SUMOVehicle().

virtual bool SUMOVehicle::hasArrived ( ) const
pure virtual

Returns whether this vehicle has arrived.

Implemented in MSBaseVehicle, and MSVehicle.

Referenced by MSDevice_Vehroutes::generateOutput(), MSMeanData::MeanDataValues::notifyMove(), and ~SUMOVehicle().

virtual bool SUMOVehicle::hasDeparted ( ) const
pure virtual

Returns whether this vehicle has departed.

Implemented in MSBaseVehicle.

Referenced by MSDevice_Vehroutes::addRoute(), MSDevice_Tripinfo::generateOutputForUnfinished(), and ~SUMOVehicle().

virtual bool SUMOVehicle::hasValidRoute ( std::string &  msg) const
pure virtual

Validates the current route.

Parameters
[out]msgDescription why the route is not valid (if it is the case)
Returns
Whether the vehicle's current route is valid

Implemented in MSBaseVehicle.

Referenced by MSEdge::insertVehicle(), and ~SUMOVehicle().

virtual bool SUMOVehicle::isOnRoad ( ) const
pure virtual
virtual bool SUMOVehicle::isParking ( ) const
pure virtual

Returns the information whether the vehicle is parked.

Returns
Whether the vehicle is parked

Implemented in MSVehicle.

Referenced by ~SUMOVehicle().

virtual bool SUMOVehicle::isStopped ( ) const
pure virtual

Returns whether the vehicle is at a stop.

Returns
Whether the has stopped

Implemented in MSVehicle.

Referenced by MSDevice_Container::notifyMove(), MSDevice_Person::notifyMove(), and ~SUMOVehicle().

virtual bool SUMOVehicle::isStoppedTriggered ( ) const
pure virtual

Returns whether the vehicle is at a stop and waiting for a person or container to continue.

Implemented in MSVehicle.

Referenced by ~SUMOVehicle().

virtual void SUMOVehicle::loadState ( const SUMOSAXAttributes attrs,
const SUMOTime  offset 
)
pure virtual

Loads the state of this vehicle from the given description.

Implemented in MSVehicle.

Referenced by MSStateHandler::myStartElement(), and ~SUMOVehicle().

virtual void SUMOVehicle::onDepart ( )
pure virtual

Called when the vehicle is inserted into the network.

Sets optional information about departure time, informs the vehicle control about a further running vehicle.

Implemented in MSBaseVehicle.

Referenced by MSInsertionControl::tryInsert(), and ~SUMOVehicle().

virtual bool SUMOVehicle::replaceRoute ( const MSRoute route,
bool  onInit = false,
int  offset = 0 
)
pure virtual

Replaces the current route by the given one.

Implemented in MSVehicle.

Referenced by MSTriggeredRerouter::notifyEnter(), MSDevice_Routing::preInsertionReroute(), MSBaseVehicle::replaceRouteEdges(), and ~SUMOVehicle().

virtual bool SUMOVehicle::replaceRouteEdges ( ConstMSEdgeVector edges,
bool  onInit = false 
)
pure virtual

Replaces the current route by the given edges.

Implemented in MSBaseVehicle.

Referenced by ~SUMOVehicle().

virtual void SUMOVehicle::reroute ( SUMOTime  t,
SUMOAbstractRouter< MSEdge, SUMOVehicle > &  router,
const bool  onInit = false,
const bool  withTaz = false 
)
pure virtual

Performs a rerouting using the given router.

Tries to find a new route between the current edge and the destination edge, first. Tries to replace the current route by the new one using replaceRoute.

Parameters
[in]tThe time for which the route is computed
[in]routerThe router to use
See also
replaceRoute

Implemented in MSBaseVehicle.

Referenced by MSDevice_Routing::reroute(), and ~SUMOVehicle().

virtual void SUMOVehicle::saveState ( OutputDevice out)
pure virtual

Saves the states of a vehicle.

Implemented in MSVehicle, and MSBaseVehicle.

Referenced by ~SUMOVehicle().

virtual void SUMOVehicle::setArrivalPos ( SUMOReal  arrivalPos)
pure virtual

Sets this vehicle's desired arrivalPos for its current route.

Implemented in MSBaseVehicle.

Referenced by ~SUMOVehicle().

virtual void SUMOVehicle::setChosenSpeedFactor ( const SUMOReal  factor)
pure virtual

Implemented in MSBaseVehicle.

Referenced by MSEdge::insertVehicle(), and ~SUMOVehicle().

virtual const MSEdge* SUMOVehicle::succEdge ( unsigned int  nSuccs) const
pure virtual

Returns the nSuccs'th successor of edge the vehicle is currently at.

If the rest of the route (counted from the current edge) than nSuccs, 0 is returned.

Parameters
[in]nSuccsThe number of edge to look forward
Returns
The nSuccs'th following edge in the vehicle's route

Implemented in MSBaseVehicle.

Referenced by MSLane::succLinkSec(), and ~SUMOVehicle().


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