SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SUMOVehicle Class Reference

Representation of a vehicle. More...

#include <SUMOVehicle.h>

Inheritance diagram for SUMOVehicle:
MSBaseVehicle MSVehicle GUIVehicle

Public Member Functions

virtual void addPerson (MSPerson *person)=0
 Adds a person to this vehicle.
virtual bool addStop (const SUMOVehicleParameter::Stop &stopPar, SUMOTime untilOffset=0)=0
 Adds a stop.
virtual SUMOReal getAcceleration () const =0
 Returns the vehicle's acceleration.
virtual SUMOReal getArrivalPos () const =0
 Returns this vehicle's desired arrivalPos for its current route (may change on reroute)
virtual SUMOReal getChosenSpeedFactor () const =0
virtual SUMOTime getDeparture () const =0
 Returns this vehicle's real departure time.
virtual MSDevicegetDevice (const std::type_info &type) const =0
 Returns a device of the given type if it exists or 0.
virtual const std::vector
< MSDevice * > & 
getDevices () const =0
 Returns this vehicle's devices.
virtual const MSEdgegetEdge () const =0
 Returns the edge the vehicle is currently at.
virtual const std::string & getID () const =0
 Get the vehicle's ID.
virtual SUMOReal getImpatience () const =0
 Returns this vehicles impatience.
virtual SUMOReal getMaxSpeed () const =0
 Returns the vehicle's maximum speed.
virtual unsigned int getNumberReroutes () const =0
 Returns the number of new routes this vehicle got.
virtual const
SUMOVehicleParameter
getParameter () const =0
 Returns the vehicle's parameter (including departure definition)
virtual SUMOReal getPositionOnLane () const =0
 Get the vehicle's position along the lane.
virtual const MSRoutegetRoute () const =0
 Returns the current route.
virtual SUMOReal getSlope () const =0
 Returns the slope of the road at vehicle's position.
virtual SUMOReal getSpeed () const =0
 Returns the vehicle's current speed.
virtual const MSVehicleTypegetVehicleType () const =0
 Returns the vehicle's type.
virtual SUMOTime getWaitingTime () const =0
virtual bool hasArrived () const =0
 Returns whether this vehicle has arrived.
virtual bool hasDeparted () const =0
 Returns whether this vehicle has departed.
virtual bool isOnRoad () const =0
 Returns the information whether the vehicle is on a road (is simulated)
virtual bool isStopped () const =0
 Returns whether the vehicle is at a stop.
virtual void onDepart ()=0
 Called when the vehicle is inserted into the network.
virtual bool replaceRoute (const MSRoute *route, bool onInit=false, int offset=0)=0
 Replaces the current route by the given one.
virtual bool replaceRouteEdges (MSEdgeVector &edges, bool onInit=false)=0
 Replaces the current route by the given edges.
virtual void reroute (SUMOTime t, SUMOAbstractRouter< MSEdge, SUMOVehicle > &router, bool withTaz=false)=0
 Performs a rerouting using the given router.
virtual const MSEdgesuccEdge (unsigned int nSuccs) const =0
 Returns the nSuccs'th successor of edge the vehicle is currently at.
virtual ~SUMOVehicle ()
 Destructor.
state io
virtual void saveState (OutputDevice &out)=0
 Saves the states of a vehicle.
virtual void loadState (const SUMOSAXAttributes &attrs, const SUMOTime offset)=0
 Loads the state of this vehicle from the given description.

Detailed Description

Representation of a vehicle.

Definition at line 64 of file SUMOVehicle.h.

Constructor & Destructor Documentation

virtual SUMOVehicle::~SUMOVehicle ( )
inlinevirtual

Destructor.

Definition at line 67 of file SUMOVehicle.h.

Member Function Documentation

virtual void SUMOVehicle::addPerson ( MSPerson 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.

virtual bool SUMOVehicle::addStop ( const SUMOVehicleParameter::Stop stopPar,
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.

virtual SUMOReal SUMOVehicle::getAcceleration ( ) const
pure virtual
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_Tripinfo::notifyLeave().

virtual SUMOReal SUMOVehicle::getChosenSpeedFactor ( ) const
pure virtual

Implemented in MSBaseVehicle.

Referenced by MSLane::getVehicleMaxSpeed().

virtual SUMOTime SUMOVehicle::getDeparture ( ) const
pure virtual

Returns this vehicle's real departure time.

Returns
This vehicle's real departure time

Implemented in MSBaseVehicle.

Referenced by MSDevice_Tripinfo::generateOutput(), MSDevice_Vehroutes::generateOutput(), MSVehicleControl::scheduleVehicleRemoval(), MSVehicleControl::vehicleDeparted(), and MSAmitranTrajectories::writeVehicle().

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 MSDevice_Example::notifyMove().

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(), and MSVehicleControl::scheduleVehicleRemoval().

virtual const MSEdge* SUMOVehicle::getEdge ( ) const
pure virtual
virtual SUMOReal SUMOVehicle::getImpatience ( ) const
pure virtual

Returns this vehicles impatience.

Implemented in MSBaseVehicle.

virtual SUMOReal SUMOVehicle::getMaxSpeed ( ) const
pure virtual

Returns the vehicle's maximum speed.

Returns
The vehicle's maximum speed

Implemented in MSBaseVehicle.

Referenced by MSEdge::getMinimumTravelTime().

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(), and MSDevice_Vehroutes::writeXMLRoute().

virtual SUMOReal SUMOVehicle::getPositionOnLane ( ) const
pure virtual
virtual SUMOReal SUMOVehicle::getSlope ( ) const
pure virtual

Returns the slope of the road at vehicle's position.

Returns
The slope

Implemented in MSVehicle, and MSBaseVehicle.

Referenced by MSDevice_Emissions::notifyMove(), and MSMeanData_Emissions::MSLaneMeanDataValues::notifyMoveInternal().

virtual SUMOTime SUMOVehicle::getWaitingTime ( ) const
pure virtual

Implemented in MSVehicle.

Referenced by MSBaseVehicle::getImpatience().

virtual bool SUMOVehicle::hasArrived ( ) const
pure virtual

Returns whether this vehicle has arrived.

Implemented in MSBaseVehicle, and MSVehicle.

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

virtual bool SUMOVehicle::hasDeparted ( ) const
pure virtual

Returns whether this vehicle has departed.

Implemented in MSBaseVehicle.

Referenced by MSDevice_Vehroutes::addRoute().

virtual bool SUMOVehicle::isOnRoad ( ) const
pure virtual

Returns the information whether the vehicle is on a road (is simulated)

Returns
Whether the vehicle is simulated

Implemented in MSVehicle, and MSBaseVehicle.

Referenced by GUIVehicleControl::insertVehicleIDs(), MSE2Collector::notifyEnter(), and MSAmitranTrajectories::writeVehicle().

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_Person::notifyMove().

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

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

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(), and MSBaseVehicle::replaceRouteEdges().

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

Replaces the current route by the given edges.

Implemented in MSBaseVehicle.

virtual void SUMOVehicle::reroute ( SUMOTime  t,
SUMOAbstractRouter< MSEdge, SUMOVehicle > &  router,
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::preInsertionReroute(), and MSDevice_Routing::wrappedRerouteCommandExecute().

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

Saves the states of a vehicle.

Implemented in MSVehicle, and MSBaseVehicle.

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


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