SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
MSBaseVehicle Class Referenceabstract

The base class for microscopic and mesoscopic vehicles. More...

#include <MSBaseVehicle.h>

Inheritance diagram for MSBaseVehicle:
Inheritance graph
Collaboration diagram for MSBaseVehicle:
Collaboration graph

Public Types

typedef
Named::NamedLikeComparatorIdLess
< SUMOVehicle
ComparatorIdLess
 

Public Member Functions

virtual void activateReminders (const MSMoveReminder::Notification reason)
 "Activates" all current move reminder More...
 
virtual void addContainer (MSTransportable *container)
 Adds a container to this vehicle. More...
 
virtual void addPerson (MSTransportable *person)
 Adds a person to this vehicle. More...
 
void addReminder (MSMoveReminder *rem)
 Adds a MoveReminder dynamically. More...
 
virtual bool addStop (const SUMOVehicleParameter::Stop &stopPar, std::string &errorMsg, SUMOTime untilOffset=0)=0
 Adds a stop. More...
 
void addStops (const bool ignoreStopErrors)
 Adds stops to the built vehicle. More...
 
virtual SUMOReal getAcceleration () const
 Returns the vehicle's acceleration. More...
 
virtual SUMOReal getAngle () const =0
 Get the vehicle's angle. More...
 
virtual SUMOReal getArrivalPos () const
 Returns this vehicle's desired arrivalPos for its current route (may change on reroute) More...
 
virtual SUMOReal getBackPositionOnLane (const MSLane *lane) const =0
 Get the vehicle's back position along the given lane. More...
 
SUMOReal getChosenSpeedFactor () const
 Returns the precomputed factor by which the driver wants to be faster than the speed limit. More...
 
const MSRouteIteratorgetCurrentRouteEdge () const
 Returns an iterator pointing to the current edge in this vehicles route. More...
 
SUMOTime getDepartDelay () const
 Returns the depart delay. More...
 
SUMOReal getDepartPos () const
 Returns this vehicle's real departure position. More...
 
SUMOTime getDeparture () const
 Returns this vehicle's real departure time. More...
 
MSDevicegetDevice (const std::type_info &type) const
 Returns a device of the given type if it exists or 0. More...
 
const std::vector< MSDevice * > & getDevices () const
 Returns this vehicle's devices. More...
 
const MSEdgegetEdge () const
 Returns the edge the vehicle is currently at. More...
 
const std::string & getID () const
 Returns the name of the vehicle. More...
 
SUMOReal getImpatience () const
 Returns this vehicles impatience. More...
 
virtual MSLanegetLane () const =0
 Returns the lane the vehicle is on. More...
 
virtual SUMOReal getLateralPositionOnLane () const
 Get the vehicle's lateral position on the lane. More...
 
SUMOReal getMaxSpeed () const
 Returns the maximum speed. More...
 
int getNumberReroutes () const
 Returns the number of new routes this vehicle got. More...
 
const SUMOVehicleParametergetParameter () const
 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...
 
SUMOReal getPreviousSpeed () const
 Returns the vehicle's previous speed. More...
 
virtual const MSEdgegetRerouteOrigin () const
 Returns the starting point for reroutes (usually the current edge) More...
 
const MSRoutegetRoute () const
 Returns the current route. More...
 
virtual SUMOReal getSlope () const
 Returns the slope of the road at vehicle's position. More...
 
virtual SUMOReal getSpeed () const =0
 Returns the vehicle's current speed. More...
 
SUMOVehicleClass getVClass () const
 Returns the vehicle's access class. More...
 
const MSVehicleTypegetVehicleType () const
 Returns the vehicle's type definition. More...
 
virtual SUMOTime getWaitingTime () const =0
 
virtual bool hasArrived () const
 Returns whether this vehicle has already arived (by default this is true if the vehicle has reached its final edge) More...
 
bool hasDeparted () const
 Returns whether this vehicle has already departed. More...
 
bool hasValidRoute (std::string &msg, const MSRoute *route=0) const
 Validates the current or given route. More...
 
virtual bool isFrontOnLane (const MSLane *) const
 Returns the information whether the front of the vehhicle is on the given lane. More...
 
virtual bool isOnRoad () const
 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 isRemoteControlled () const
 Returns the information whether the vehicle is fully controlled via TraCI. 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...
 
 MSBaseVehicle (SUMOVehicleParameter *pars, const MSRoute *route, const MSVehicleType *type, const SUMOReal speedFactor)
 Constructor. More...
 
void onDepart ()
 Called when the vehicle is inserted into the network. More...
 
void removeReminder (MSMoveReminder *rem)
 Removes a MoveReminder dynamically. More...
 
virtual bool replaceRoute (const MSRoute *route, bool onInit=false, int offset=0)=0
 Replaces the current route by the given one. More...
 
bool replaceRouteEdges (ConstMSEdgeVector &edges, bool onInit=false, bool check=false)
 Replaces the current route by the given edges. More...
 
void reroute (SUMOTime t, SUMOAbstractRouter< MSEdge, SUMOVehicle > &router, const bool onInit=false, const bool withTaz=false)
 Performs a rerouting using the given router. More...
 
virtual void setArrivalPos (SUMOReal arrivalPos)
 Sets this vehicle's desired arrivalPos for its current route. More...
 
void setChosenSpeedFactor (const SUMOReal factor)
 Returns the precomputed factor by which the driver wants to be faster than the speed limit. More...
 
const MSEdgesuccEdge (int nSuccs) const
 Returns the nSuccs'th successor of edge the vehicle is currently at. More...
 
virtual ~MSBaseVehicle ()
 Destructor. More...
 
state io
virtual void saveState (OutputDevice &out)
 Saves the (common) state of a vehicle. More...
 
state io
virtual void loadState (const SUMOSAXAttributes &attrs, const SUMOTime offset)=0
 Loads the state of this vehicle from the given description. More...
 

Protected Member Functions

void calculateArrivalParams ()
 (Re-)Calculates the arrival position and lane from the vehicle parameters More...
 
virtual const ConstMSEdgeVector getStopEdges () const =0
 Returns the list of still pending stop edges. More...
 

Protected Attributes

int myArrivalLane
 The destination lane where the vehicle stops. More...
 
SUMOReal myArrivalPos
 The position on the destination lane where the vehicle stops. More...
 
SUMOReal myChosenSpeedFactor
 A precomputed factor by which the driver wants to be faster than the speed limit. More...
 
MSRouteIterator myCurrEdge
 Iterator to current route-edge. More...
 
SUMOReal myDepartPos
 The real depart position. More...
 
SUMOTime myDeparture
 The real departure time. More...
 
std::vector< MSDevice * > myDevices
 The devices this vehicle has. More...
 
int myNumberReroutes
 The number of reroutings. More...
 
const SUMOVehicleParametermyParameter
 This Vehicle's parameter. More...
 
const MSRoutemyRoute
 This Vehicle's route. More...
 
const MSVehicleTypemyType
 This Vehicle's type. More...
 

Static Protected Attributes

static const SUMOTime NOT_YET_DEPARTED = SUMOTime_MAX
 

Private Member Functions

MSBaseVehicleoperator= (const MSBaseVehicle &s)
 invalidated assignment operator More...
 

Friends

class GUIBaseVehicle
 

Move reminder structures

typedef std::vector< std::pair
< MSMoveReminder *, SUMOReal > > 
MoveReminderCont
 Definition of a move reminder container. More...
 
MoveReminderCont myMoveReminders
 Currently relevant move reminders. More...
 

Detailed Description

The base class for microscopic and mesoscopic vehicles.

Definition at line 56 of file MSBaseVehicle.h.

Member Typedef Documentation

typedef std::vector< std::pair<MSMoveReminder*, SUMOReal> > MSBaseVehicle::MoveReminderCont
protected

Definition of a move reminder container.

Definition at line 414 of file MSBaseVehicle.h.

Constructor & Destructor Documentation

MSBaseVehicle::MSBaseVehicle ( SUMOVehicleParameter pars,
const MSRoute route,
const MSVehicleType type,
const SUMOReal  speedFactor 
)

Constructor.

Parameters
[in]parsThe vehicle description
[in]routeThe vehicle's route
[in]typeThe vehicle's type
[in]speedFactorThe factor for driven lane's speed limits
Exceptions
ProcessErrorIf a value is wrong

Definition at line 69 of file MSBaseVehicle.cpp.

References MSRoute::addReference(), MSRoute::begin(), MSDevice::buildVehicleDevices(), calculateArrivalParams(), MSRoute::getLastEdge(), MSEdge::isTaz(), myDevices, myMoveReminders, myRoute, SUMOVehicleParameter::setParameter, VEHPARS_FORCE_REROUTE, and SUMOVehicleParameter::wasSet().

MSBaseVehicle::~MSBaseVehicle ( )
virtual

Member Function Documentation

void MSBaseVehicle::activateReminders ( const MSMoveReminder::Notification  reason)
virtual

"Activates" all current move reminder

For all move reminder stored in "myMoveReminders", their method "MSMoveReminder::notifyEnter" is called.

Parameters
[in]reasonThe reason for changing the reminders' states
See also
MSMoveReminder
MSMoveReminder::notifyEnter
MSMoveReminder::Notification

Reimplemented in MSVehicle.

Definition at line 347 of file MSBaseVehicle.cpp.

References myMoveReminders.

Referenced by MESegment::receive(), and MELoop::teleportVehicle().

void MSBaseVehicle::addContainer ( MSTransportable container)
virtual

Adds a container to this vehicle.

The default implementation does nothing since containers are not supported by default

Parameters
[in]containerThe container to add

Implements SUMOVehicle.

Reimplemented in MSVehicle.

Definition at line 288 of file MSBaseVehicle.cpp.

void MSBaseVehicle::addPerson ( MSTransportable person)
virtual

Adds a person to this vehicle.

The default implementation does nothing since persons are not supported by default

Parameters
[in]personThe person to add

Implements SUMOVehicle.

Reimplemented in MSVehicle.

Definition at line 284 of file MSBaseVehicle.cpp.

void MSBaseVehicle::addReminder ( MSMoveReminder rem)

Adds a MoveReminder dynamically.

Parameters
[in]remthe reminder to add
See also
MSMoveReminder

Definition at line 320 of file MSBaseVehicle.cpp.

References myMoveReminders.

Referenced by MSVehicle::adaptLaneEntering2MoveReminder(), MESegment::addReminders(), MSVehicle::enterLaneAtInsertion(), and MSVehicle::enterLaneAtLaneChange().

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

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, and MEVehicle.

Referenced by addStops().

void MSBaseVehicle::addStops ( const bool  ignoreStopErrors)

Adds stops to the built vehicle.

This code needs to be separated from the MSBaseVehicle constructor since it is not allowed to call virtual functions from a constructor

Parameters
[in]ignoreStopErrorswhether invalid stops trigger a warning only

Definition at line 442 of file MSBaseVehicle.cpp.

References SUMOVehicle::addStop(), MSRoute::getStops(), myParameter, myRoute, SUMOVehicleParameter::stops, and WRITE_WARNING.

Referenced by MEVehicleControl::buildVehicle(), GUIMEVehicleControl::buildVehicle(), GUIVehicleControl::buildVehicle(), and MSVehicleControl::buildVehicle().

SUMOReal MSBaseVehicle::getAcceleration ( ) const
virtual

Returns the vehicle's acceleration.

This default implementation returns always 0.

Returns
The acceleration

Implements SUMOVehicle.

Reimplemented in MSVehicle.

Definition at line 253 of file MSBaseVehicle.cpp.

virtual SUMOReal SUMOVehicle::getAngle ( ) const
pure virtualinherited

Get the vehicle's angle.

Returns
The angle of the vehicle (in degree)

Implemented in MSVehicle, GUIMEVehicle, GUIVehicle, and MEVehicle.

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

virtual SUMOReal MSBaseVehicle::getArrivalPos ( ) const
inlinevirtual

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

Returns
This vehicle's real arrivalPos

Implements SUMOVehicle.

Definition at line 258 of file MSBaseVehicle.h.

References myArrivalPos.

Referenced by MSLCM_SL2015::_wantsChangeSublane().

virtual SUMOReal SUMOVehicle::getBackPositionOnLane ( const MSLane lane) const
pure virtualinherited

Get the vehicle's back position along the given lane.

Returns
The position of the vehicle (in m from the given lane's begin)

Implemented in MSVehicle, and MEVehicle.

Referenced by MSInductLoop::notifyEnter(), and MSE2Collector::notifyEnter().

SUMOReal MSBaseVehicle::getChosenSpeedFactor ( ) const
inlinevirtual

Returns the precomputed factor by which the driver wants to be faster than the speed limit.

Returns
Speed limit factor

Implements SUMOVehicle.

Definition at line 348 of file MSBaseVehicle.h.

References myChosenSpeedFactor.

Referenced by GUIMEVehicle::getParameterWindow(), GUIVehicle::getParameterWindow(), and TraCIServerAPI_Vehicle::processGet().

const MSRouteIterator& MSBaseVehicle::getCurrentRouteEdge ( ) const
inlinevirtual

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

Returns
The current route pointer

Implements SUMOVehicle.

Definition at line 182 of file MSBaseVehicle.h.

References myCurrEdge.

Referenced by TraCIServerAPI_Vehicle::vtdMap_matchingRoutePosition().

SUMOTime MSBaseVehicle::getDepartDelay ( ) const
inlinevirtual
SUMOReal MSBaseVehicle::getDepartPos ( ) const
inlinevirtual

Returns this vehicle's real departure position.

Returns
This vehicle's real departure position

Implements SUMOVehicle.

Definition at line 250 of file MSBaseVehicle.h.

References myDepartPos.

Referenced by TraCIServerAPI_Vehicle::processGet().

SUMOTime MSBaseVehicle::getDeparture ( ) const
inlinevirtual

Returns this vehicle's real departure time.

Returns
This vehicle's real departure time

Implements SUMOVehicle.

Definition at line 237 of file MSBaseVehicle.h.

References myDeparture.

Referenced by getDepartDelay().

MSDevice * MSBaseVehicle::getDevice ( const std::type_info &  type) const
virtual

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

Implements SUMOVehicle.

Definition at line 420 of file MSBaseVehicle.cpp.

References myDevices.

Referenced by GUIBaseVehicle::drawOnPos(), and MSBatteryExport::write().

const std::vector<MSDevice*>& MSBaseVehicle::getDevices ( ) const
inlinevirtual

Returns this vehicle's devices.

Returns
This vehicle's devices

Implements SUMOVehicle.

Definition at line 291 of file MSBaseVehicle.h.

References myDevices.

const std::string & MSBaseVehicle::getID ( ) const
virtual

Returns the name of the vehicle.

Implements SUMOVehicle.

Definition at line 114 of file MSBaseVehicle.cpp.

References SUMOVehicleParameter::id, and myParameter.

Referenced by MSLCM_SL2015::_patchSpeed(), MSLCM_LC2013::_patchSpeed(), MSLCM_LC2013::_wantsChange(), MSLCM_SL2015::_wantsChangeSublane(), MSVehicle::adaptToLeader(), MSVehicle::adaptToLeaders(), MSVehicleTransfer::add(), MSVehicle::addTraciBusOrContainerStop(), calculateArrivalParams(), MSLaneChangerSublane::change(), MSLaneChanger::change(), MSLCM_SL2015::changed(), MSLaneChanger::changeOpposite(), MELoop::changeSegment(), MSLaneChanger::checkChange(), MSLaneChangerSublane::checkChangeSublane(), MSLane::checkFailure(), MSVehicleTransfer::checkInsertions(), MSVehicle::checkRewindLinkLanes(), MSLCM_SL2015::checkStrategicChange(), MSAbstractLaneChangeModel::cleanupShadowLane(), MSVehicle::computeAngle(), MSLaneChanger::continueChange(), MSLCM_SL2015::decideDirection(), MSCalibrator::execute(), MSVehicle::executeMove(), MSLane::executeMovements(), MSVehicle::getBackPosition(), MSVehicle::getBackPositionOnLane(), MSVehicle::getCenterOnEdge(), MSLane::getFirstVehicleInformation(), MSLane::getFollower(), MSLane::getFollowersOnConsecutive(), MSLane::getLastVehicleInformation(), MSVehicle::getLatOffset(), MSLane::getLeader(), MSLane::getLeaderOnConsecutive(), MSLaneChangerSublane::getLeaders(), MSLane::getLeadersOnConsecutive(), MSLane::getOppositeFollower(), MSLane::getOppositeLeader(), GUIMEVehicle::getParameterWindow(), GUIVehicle::getParameterWindow(), MSLane::getPartialBehind(), MSLaneChanger::getRealFollower(), MSLaneChanger::getRealLeader(), MSAbstractLaneChangeModel::getShadowLane(), MSLane::handleCollisionBetween(), MSLCM_SL2015::inform(), MSLCM_LC2013::inform(), MSLCM_LC2013::informFollower(), MSLCM_SL2015::informFollower(), MSLCM_LC2013::informLeader(), MSLCM_SL2015::informLeader(), MESegment::initialise(), MSPedestrianPushButton::isActiveForEdge(), MSLane::isInsertionSuccess(), MSVehicle::leaveLane(), MSCFModel_Daniel1::moveHelper(), MSCFModel_KraussOrig1::moveHelper(), MSCFModel_SmartSK::moveHelper(), MSLCM_LC2013::MSLCM_LC2013(), MSCalibrator::VehicleRemover::notifyEnter(), MSLCM_DK2008::patchSpeed(), MSLCM_SL2015::patchSpeed(), MSLCM_LC2013::patchSpeed(), MSVehicle::planMove(), MSVehicle::planMoveInternal(), MSAbstractLaneChangeModel::primaryLaneChanged(), MSVehicle::processNextStop(), TraCIServerAPI_Vehicle::processSet(), replaceRouteEdges(), reroute(), MSLane::resetPartialOccupation(), MSLCM_SL2015::saveBlockerLength(), MSLCM_LC2013::saveBlockerLength(), MSCalibrator::scheduleRemoval(), MSLane::setPartialOccupation(), TraCIServer::setVTDControlled(), MSLCM_LC2013::slowDownForBlocked(), MSLCM_SL2015::slowDownForBlocked(), MELoop::teleportVehicle(), METriggeredCalibrator::tryEmit(), MSVehicle::updateBestLanes(), MSLCM_SL2015::updateGaps(), MSAbstractLaneChangeModel::updateShadowLane(), MSLCM_LC2013::wantsChange(), MSLCM_SL2015::wantsChangeSublane(), MSLCM_DK2008::wantsChangeToLeft(), MSLCM_DK2008::wantsChangeToRight(), MSBatteryExport::write(), and MSXMLRawOut::writeVehicle().

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

Returns the lane the vehicle is on.

Returns
The vehicle's current lane

Implemented in MSVehicle, and MEVehicle.

Referenced by GUIBaseVehicle::drawOnPos(), MSDevice_Battery::getPropEnergy(), MSDevice_Battery::notifyEnter(), MSTriggeredRerouter::notifyEnter(), and MSDevice_Battery::notifyMove().

virtual SUMOReal MSBaseVehicle::getLateralPositionOnLane ( ) const
inlinevirtual

Get the vehicle's lateral position on the lane.

Returns
The lateral position of the vehicle (in m relative to the centerline of the lane)

Implements SUMOVehicle.

Reimplemented in MSVehicle.

Definition at line 165 of file MSBaseVehicle.h.

SUMOReal MSBaseVehicle::getMaxSpeed ( ) const
virtual
int MSBaseVehicle::getNumberReroutes ( ) const
inlinevirtual

Returns the number of new routes this vehicle got.

Returns
the number of new routes this vehicle got

Implements SUMOVehicle.

Definition at line 280 of file MSBaseVehicle.h.

References myNumberReroutes.

Referenced by GUIBaseVehicle::drawGLAdditional(), GUIMEVehicle::getColorValue(), GUIVehicle::getColorValue(), and replaceRouteEdges().

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

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, MEVehicle, GUIMEVehicle, and GUIVehicle.

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

SUMOReal MSBaseVehicle::getPreviousSpeed ( ) const
virtual

Returns the vehicle's previous speed.

Returns
The vehicle's speed

Implements SUMOVehicle.

Reimplemented in MSVehicle.

Definition at line 65 of file MSBaseVehicle.cpp.

virtual const MSEdge* MSBaseVehicle::getRerouteOrigin ( ) const
inlinevirtual

Returns the starting point for reroutes (usually the current edge)

This differs from *myCurrEdge only if the vehicle is on an internal edge

Returns
The rerouting start point

Reimplemented in MSVehicle.

Definition at line 174 of file MSBaseVehicle.h.

References myCurrEdge.

Referenced by replaceRouteEdges(), and reroute().

SUMOReal MSBaseVehicle::getSlope ( ) const
virtual

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

This default implementation returns always 0.

Returns
The slope

Implements SUMOVehicle.

Reimplemented in MSVehicle, and MEVehicle.

Definition at line 259 of file MSBaseVehicle.cpp.

virtual const ConstMSEdgeVector MSBaseVehicle::getStopEdges ( ) const
protectedpure virtual

Returns the list of still pending stop edges.

Implemented in MSVehicle, and MEVehicle.

Referenced by reroute().

SUMOVehicleClass MSBaseVehicle::getVClass ( ) const
inlinevirtual

Returns the vehicle's access class.

Returns
The vehicle's access class

Implements SUMOVehicle.

Definition at line 113 of file MSBaseVehicle.h.

References MSVehicleType::getParameter(), myType, and SUMOVTypeParameter::vehicleClass.

Referenced by MSPedestrianPushButton::isActiveForEdge(), and reroute().

const MSVehicleType& MSBaseVehicle::getVehicleType ( ) const
inlinevirtual

Returns the vehicle's type definition.

Returns
The vehicle's type definition

Implements SUMOVehicle.

Definition at line 105 of file MSBaseVehicle.h.

References myType.

Referenced by MSLCM_SL2015::_patchSpeed(), MSLCM_LC2013::_patchSpeed(), MSLCM_LC2013::_wantsChange(), MSLCM_SL2015::_wantsChangeSublane(), MSVehicle::adaptToLeaders(), MSVehicle::addStop(), MSLane::basePos(), MSTransportableControl::boardAnyWaiting(), MSLaneChanger::changeOpposite(), MSLCM_SL2015::checkBlocking(), MSLCM_SL2015::checkBlockingVehicles(), MSLaneChanger::checkChange(), MSLane::checkFailure(), GUIApplicationWindow::checkGamingEvents(), MSVehicleTransfer::checkInsertions(), MSVehicle::checkRewindLinkLanes(), MSLaneChanger::computeOvertakingTime(), MSLaneChanger::continueChange(), MSLane::detectCollisionBetween(), GUIVehicle::drawAction_drawLinkItems(), GUIVehicle::drawAction_drawRailCarriages(), GUIVehicle::drawAction_drawVehicleBlinker(), GUIVehicle::drawAction_drawVehicleBrakeLight(), GUIEdge::drawMesoVehicles(), MSLane::enteredByLaneChange(), MSVehicle::enterLaneAtInsertion(), MSVehicle::enterLaneAtLaneChange(), MEVehicle::estimateLeaveSpeed(), MSVehicle::estimateLeaveSpeed(), MSVehicle::executeMove(), MSLane::executeMovements(), MSLane::freeInsertion(), MEVehicle::getBackPositionOnLane(), MSLane::getBruttoOccupancy(), GUIBaseVehicle::getCenteringBoundary(), MSLane::getCriticalLeader(), MSEdge::getDepartLane(), MSLane::getFollower(), MSLane::getFollowersOnConsecutive(), getImpatience(), MSVehicle::getLateralOverlap(), MSLane::getLeader(), MSVehicle::getLeader(), MSLane::getLeaderOnConsecutive(), MSLaneChangerSublane::getLeaders(), MSLane::getLeadersOnConsecutive(), MSLane::getNettoOccupancy(), MSLane::getOppositeFollower(), MSLane::getOppositeLeader(), MSLaneChanger::getRealFollower(), MSLaneChanger::getRealLeader(), MSVehicle::getRightSideOnEdge(), MSVehicle::getRightSideOnLane(), MSLeaderInfo::getSubLanes(), MSVehicle::getTimeGap(), MSLink::getZipperSpeed(), MESegment::hasSpaceFor(), MSLane::incorporateVehicle(), MSLCM_SL2015::informFollower(), MSLCM_SL2015::informLeader(), MSLane::insertVehicle(), MSLane::integrateNewVehicle(), MSLane::isInsertionSuccess(), MESegment::isOpen(), MSLCM_SL2015::keepLatGap(), MSLane::lastInsertion(), MSLane::leftByLaneChange(), MSTransportableControl::loadAnyWaiting(), MESegment::loadState(), MSVehicle::overlap(), MSLCM_LC2013::overtakeDistance(), MSLCM_DK2008::patchSpeed(), MSVehicle::planMoveInternal(), MSVehicle::Influencer::postProcessVTD(), TraCIServerAPI_Vehicle::processGet(), MSVehicle::processNextStop(), TraCIServerAPI_Vehicle::processSet(), MESegment::receive(), MSLaneChanger::registerUnchanged(), MESegment::removeCar(), MSLane::removeVehicle(), MSLane::safeInsertionSpeed(), MSLCM_SL2015::saveBlockerLength(), MSLCM_LC2013::saveBlockerLength(), GUIVehicle::selectBlockingFoes(), MESegment::send(), GUIBaseVehicle::setFunctionalColor(), MSVehicle::setTentativeLaneAndPosition(), MSLCM_LC2013::slowDownForBlocked(), MSLCM_SL2015::slowDownForBlocked(), MSLaneChanger::startChange(), MSLaneChangerSublane::startChangeSublane(), MSVehicle::unsafeLinkAhead(), MSLCM_SL2015::updateExpectedSublaneSpeeds(), MSVehicle::updateFurtherLanes(), MSLCM_SL2015::updateGaps(), MSLCM_DK2008::wantsChangeToLeft(), MSLCM_DK2008::wantsChangeToRight(), MSBatteryExport::write(), and MSQueueExport::writeLane().

virtual SUMOTime SUMOVehicle::getWaitingTime ( ) const
pure virtualinherited
bool MSBaseVehicle::hasArrived ( ) const
virtual

Returns whether this vehicle has already arived (by default this is true if the vehicle has reached its final edge)

Implements SUMOVehicle.

Reimplemented in MSVehicle, and MEVehicle.

Definition at line 279 of file MSBaseVehicle.cpp.

References succEdge().

bool MSBaseVehicle::hasDeparted ( ) const
virtual
bool MSBaseVehicle::hasValidRoute ( std::string &  msg,
const MSRoute route = 0 
) const
virtual

Validates the current or given route.

Parameters
[out]msgDescription why the route is not valid (if it is the case)
[in]routeThe route to check (or 0 if the current route shall be checked)
Returns
Whether the vehicle's current route is valid

Implements SUMOVehicle.

Definition at line 292 of file MSBaseVehicle.cpp.

References MSRoute::begin(), MSRoute::end(), MSVehicleType::getVehicleClass(), myCurrEdge, myRoute, and myType.

Referenced by MESegment::initialise(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Vehicle::processSet(), and replaceRouteEdges().

virtual bool MSBaseVehicle::isFrontOnLane ( const MSLane ) const
inlinevirtual

Returns the information whether the front of the vehhicle is on the given lane.

Returns
Whether the vehicle's front is on that lane

Implements SUMOVehicle.

Reimplemented in MSVehicle.

Definition at line 157 of file MSBaseVehicle.h.

virtual bool MSBaseVehicle::isOnRoad ( ) const
inlinevirtual

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

Returns
Whether the vehicle is simulated

Implements SUMOVehicle.

Reimplemented in MSVehicle, and MEVehicle.

Definition at line 142 of file MSBaseVehicle.h.

Referenced by GUIBaseVehicle::drawGLAdditional(), and MSXMLRawOut::writeVehicle().

virtual bool SUMOVehicle::isParking ( ) const
pure virtualinherited

Returns the information whether the vehicle is parked.

Returns
Whether the vehicle is parked

Implemented in MSVehicle, and MEVehicle.

Referenced by MSFCDExport::write().

virtual bool MSBaseVehicle::isRemoteControlled ( ) const
inlinevirtual

Returns the information whether the vehicle is fully controlled via TraCI.

Returns
Whether the vehicle is remote-controlled

Implements SUMOVehicle.

Reimplemented in MSVehicle.

Definition at line 150 of file MSBaseVehicle.h.

virtual bool SUMOVehicle::isStopped ( ) const
pure virtualinherited

Returns whether the vehicle is at a stop.

Returns
Whether the has stopped

Implemented in MSVehicle, and MEVehicle.

Referenced by MSDevice_Transportable::notifyMove(), and MSDevice_Tripinfo::notifyMove().

virtual bool SUMOVehicle::isStoppedTriggered ( ) const
pure virtualinherited

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

Implemented in MSVehicle, and MEVehicle.

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

Loads the state of this vehicle from the given description.

Implemented in MSVehicle, and MEVehicle.

void MSBaseVehicle::onDepart ( )
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.

Implements SUMOVehicle.

Definition at line 265 of file MSBaseVehicle.cpp.

References MSNet::getCurrentTimeStep(), MSNet::getInstance(), SUMOVehicle::getPositionOnLane(), MSNet::getVehicleControl(), myDepartPos, myDeparture, and MSVehicleControl::vehicleDeparted().

Referenced by MSVehicle::enterLaneAtInsertion(), and MESegment::receive().

MSBaseVehicle& MSBaseVehicle::operator= ( const MSBaseVehicle s)
private

invalidated assignment operator

void MSBaseVehicle::removeReminder ( MSMoveReminder rem)

Removes a MoveReminder dynamically.

Parameters
[in]remthe reminder to remove
See also
MSMoveReminder

Definition at line 331 of file MSBaseVehicle.cpp.

References myMoveReminders.

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

Replaces the current route by the given one.

Implemented in MEVehicle, and MSVehicle.

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

bool MSBaseVehicle::replaceRouteEdges ( ConstMSEdgeVector edges,
bool  onInit = false,
bool  check = false 
)
virtual

Replaces the current route by the given edges.

It is possible that the new route is not accepted, if a) it does not contain the vehicle's current edge, or b) something fails on insertion into the routes container (see in-line comments).

Parameters
[in]edgesThe new list of edges to pass
[in]onInitWhether the vehicle starts with this route
[in]checkWhether the route should be checked for validity
Returns
Whether the new route was accepted

Implements SUMOVehicle.

Definition at line 199 of file MSBaseVehicle.cpp.

References MSRoute::addReference(), MSRoute::begin(), RGBColor::DEFAULT_COLOR, MSRoute::dictionary(), MSGlobals::gCheckRoutes, MSRoute::getColor(), MSRoute::getEdges(), Named::getID(), getID(), getNumberReroutes(), getRerouteOrigin(), MSRoute::getStops(), hasValidRoute(), myCurrEdge, myRoute, MSRoute::release(), SUMOVehicle::replaceRoute(), MSRoute::size(), toString(), and WRITE_WARNING.

Referenced by MSVehicle::Influencer::postProcessVTD(), TraCIServerAPI_Vehicle::processSet(), and reroute().

void MSBaseVehicle::reroute ( SUMOTime  t,
SUMOAbstractRouter< MSEdge, SUMOVehicle > &  router,
const bool  onInit = false,
const bool  withTaz = false 
)
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

Implements SUMOVehicle.

Definition at line 148 of file MSBaseVehicle.cpp.

References MSEdge::allowedLanes(), calculateArrivalParams(), SUMOAbstractRouter< E, V >::compute(), MSEdge::dictionary(), MSEdge::EDGEFUNCTION_DISTRICT, SUMOVehicleParameter::fromTaz, Named::getID(), getID(), MSRoute::getLastEdge(), getRerouteOrigin(), getStopEdges(), getVClass(), myParameter, myRoute, replaceRouteEdges(), SUMOVehicleParameter::toTaz, and SUMOVehicleParameter::via.

Referenced by TraCIServerAPI_Vehicle::processSet().

virtual void MSBaseVehicle::setArrivalPos ( SUMOReal  arrivalPos)
inlinevirtual

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

Implements SUMOVehicle.

Definition at line 264 of file MSBaseVehicle.h.

References myArrivalPos.

void MSBaseVehicle::setChosenSpeedFactor ( const SUMOReal  factor)
inlinevirtual

Returns the precomputed factor by which the driver wants to be faster than the speed limit.

Returns
Speed limit factor

Implements SUMOVehicle.

Definition at line 355 of file MSBaseVehicle.h.

References myChosenSpeedFactor.

Referenced by TraCIServerAPI_Vehicle::processSet().

const MSEdge * MSBaseVehicle::succEdge ( int  nSuccs) const
virtual

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

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

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

Implements SUMOVehicle.

Definition at line 132 of file MSBaseVehicle.cpp.

References MSRoute::begin(), myCurrEdge, and myRoute.

Referenced by MSVehicleTransfer::add(), MSLane::appropriate(), MSVehicleTransfer::checkInsertions(), MESegment::getLink(), hasArrived(), MSPedestrianPushButton::isActiveForEdge(), MELoop::nextSegment(), TraCIServerAPI_Vehicle::processSet(), and MESegment::receive().

Friends And Related Function Documentation

friend class GUIBaseVehicle
friend

Definition at line 67 of file MSBaseVehicle.h.

Field Documentation

int MSBaseVehicle::myArrivalLane
protected

The destination lane where the vehicle stops.

Definition at line 433 of file MSBaseVehicle.h.

Referenced by calculateArrivalParams(), and MSVehicle::updateBestLanes().

SUMOReal MSBaseVehicle::myArrivalPos
protected
SUMOReal MSBaseVehicle::myChosenSpeedFactor
protected

A precomputed factor by which the driver wants to be faster than the speed limit.

Definition at line 403 of file MSBaseVehicle.h.

Referenced by getChosenSpeedFactor(), and setChosenSpeedFactor().

SUMOReal MSBaseVehicle::myDepartPos
protected

The real depart position.

Definition at line 427 of file MSBaseVehicle.h.

Referenced by getDepartPos(), and onDepart().

SUMOTime MSBaseVehicle::myDeparture
protected
int MSBaseVehicle::myNumberReroutes
protected

The number of reroutings.

Definition at line 436 of file MSBaseVehicle.h.

Referenced by getNumberReroutes(), MSVehicle::replaceRoute(), and MEVehicle::replaceRoute().

const SUMOTime MSBaseVehicle::NOT_YET_DEPARTED = SUMOTime_MAX
staticprotected

Definition at line 441 of file MSBaseVehicle.h.

Referenced by MSVehicle::enterLaneAtInsertion(), and hasDeparted().


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