Eclipse SUMO - Simulation of Urban MObility
MSBaseVehicle Class Referenceabstract

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

#include <MSBaseVehicle.h>

Inheritance diagram for MSBaseVehicle:
Collaboration diagram for MSBaseVehicle:

Public Types

typedef long long int NumericalID
 

Public Member Functions

virtual void activateReminders (const MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
 "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, bool collision=false, ConstMSEdgeVector::const_iterator *searchStart=0)=0
 Adds a stop. More...
 
void addStops (const bool ignoreStopErrors)
 Adds stops to the built vehicle. More...
 
void createDevice (const std::string &deviceName)
 create device of the given type More...
 
virtual double getAcceleration () const
 Returns the vehicle's acceleration. More...
 
virtual SUMOTime getAccumulatedWaitingTime () const =0
 
virtual double getAngle () const =0
 Get the vehicle's angle. More...
 
virtual double getArrivalPos () const
 Returns this vehicle's desired arrivalPos for its current route (may change on reroute) More...
 
virtual double getBackPositionOnLane (const MSLane *lane) const =0
 Get the vehicle's back position along the given lane. More...
 
virtual double getBrakeGap () const =0
 get distance for coming to a stop (used for rerouting checks) More...
 
double getChosenSpeedFactor () const
 Returns the precomputed factor by which the driver wants to be faster than the speed limit. More...
 
const MSDevice_TransportablegetContainerDevice () const
 
int getContainerNumber () const
 Returns the number of containers. More...
 
const std::vector< MSTransportable * > & getContainers () const
 retrieve riding containers 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...
 
double getDepartPos () const
 Returns this vehicle's real departure position. More...
 
SUMOTime getDeparture () const
 Returns this vehicle's real departure time. More...
 
MSVehicleDevicegetDevice (const std::type_info &type) const
 Returns a device of the given type if it exists or 0. More...
 
std::string getDeviceParameter (const std::string &deviceName, const std::string &key) const
 try to retrieve the given parameter from any of the vehicles devices, raise InvalidArgument if no device parameter by that name exists More...
 
const std::vector< MSVehicleDevice * > & 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...
 
double getImpatience () const
 Returns this vehicles impatience. More...
 
virtual MSLanegetLane () const =0
 Returns the lane the vehicle is on. More...
 
virtual double getLateralPositionOnLane () const
 Get the vehicle's lateral position on the lane. More...
 
double getLength () const
 Returns the vehicle's length. More...
 
double getMaxSpeed () const
 Returns the maximum speed. More...
 
virtual MSParkingAreagetNextParkingArea ()=0
 
int getNumberReroutes () const
 Returns the number of new routes this vehicle got. More...
 
NumericalID getNumericalID () const
 return the numerical ID which is only for internal usage More...
 
const SUMOVehicleParametergetParameter () const
 Returns the vehicle's parameter (including departure definition) More...
 
const MSDevice_TransportablegetPersonDevice () const
 
std::vector< std::string > getPersonIDList () const
 Returns the list of persons. More...
 
int getPersonNumber () const
 Returns the number of persons. More...
 
const std::vector< MSTransportable * > & getPersons () const
 retrieve riding persons More...
 
virtual Position getPosition (const double offset=0) const =0
 Return current position (x/y, cartesian) More...
 
virtual double getPositionOnLane () const =0
 Get the vehicle's position along the lane. More...
 
double getPreviousSpeed () const
 Returns the vehicle's previous speed. More...
 
virtual const MSEdgegetRerouteOrigin () const
 Returns the starting point for reroutes (usually the current edge) More...
 
std::mt19937 * getRNG () const
 
const MSRoutegetRoute () const
 Returns the current route. More...
 
MSVehicleTypegetSingularType ()
 Replaces the current vehicle type with a new one used by this vehicle only. More...
 
virtual double getSlope () const
 Returns the slope of the road at vehicle's position. More...
 
virtual double getSpeed () const =0
 Returns the vehicle's current speed. More...
 
virtual std::vector< std::pair< int, double > > getStopIndices () const =0
 return list of route indices and stop positions for the remaining stops 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
 
double getWidth () const
 Returns the vehicle's width. More...
 
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 hasDevice (const std::string &deviceName) const
 check whether the vehicle is equiped with a device of the given type 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 isSelected () const
 whether this vehicle is selected in the GUI More...
 
virtual bool isStopped () const =0
 Returns whether the vehicle is at a stop. More...
 
virtual bool isStoppedInRange (const double pos, const double tolerance) const =0
 Returns whether the vehicle is stopped in the range of the given position. More...
 
virtual bool isStoppedTriggered () const =0
 Returns whether the vehicle is at a stop and waiting for a person or container to continue. More...
 
bool isVehicle () const
 Get the vehicle's ID. More...
 
 MSBaseVehicle (SUMOVehicleParameter *pars, const MSRoute *route, MSVehicleType *type, const double speedFactor)
 Constructor. More...
 
void onDepart ()
 Called when the vehicle is inserted into the network. More...
 
virtual SUMOTime remainingStopDuration () const =0
 Returns the remaining stop duration for a stopped vehicle or 0. More...
 
void removeReminder (MSMoveReminder *rem)
 Removes a MoveReminder dynamically. More...
 
void removeTransportable (MSTransportable *t)
 removes a person or container More...
 
void replaceParameter (const SUMOVehicleParameter *newParameter)
 replace the vehicle parameter (deleting the old one) More...
 
virtual bool replaceParkingArea (MSParkingArea *parkingArea, std::string &errorMsg)=0
 Replaces a stop. More...
 
virtual bool replaceRoute (const MSRoute *route, const std::string &info, bool onInit=false, int offset=0, bool addStops=true, bool removeStops=true)=0
 Replaces the current route by the given one. More...
 
bool replaceRouteEdges (ConstMSEdgeVector &edges, double cost, double savings, const std::string &info, bool onInit=false, bool check=false, bool removeStops=true)
 Replaces the current route by the given edges. More...
 
void replaceVehicleType (MSVehicleType *type)
 Replaces the current vehicle type by the one given. More...
 
void reroute (SUMOTime t, const std::string &info, SUMOAbstractRouter< MSEdge, SUMOVehicle > &router, const bool onInit=false, const bool withTaz=false, const bool silent=false)
 Performs a rerouting using the given router. More...
 
virtual void setArrivalPos (double arrivalPos)
 Sets this vehicle's desired arrivalPos for its current route. More...
 
void setChosenSpeedFactor (const double factor)
 Returns the precomputed factor by which the driver wants to be faster than the speed limit. More...
 
void setDeviceParameter (const std::string &deviceName, const std::string &key, const std::string &value)
 try to set the given parameter from any of the vehicles devices, raise InvalidArgument if no device parameter by that name exists More...
 
virtual bool stopsAt (MSStoppingPlace *stop) const =0
 Returns whether the vehicle stops at the given stopping place. More...
 
const MSEdgesuccEdge (int nSuccs) const
 Returns the nSuccs'th successor of edge the vehicle is currently at. More...
 
virtual bool wasRemoteControlled (SUMOTime lookBack=DELTA_T) const
 Returns the information whether the vehicle is fully controlled via TraCI. 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 (double &firstPos, double &lastPos) const =0
 Returns the list of still pending stop edges. More...
 

Protected Attributes

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

Static Protected Attributes

static std::vector< MSTransportable * > myEmptyTransportableVector
 
static const SUMOTime NOT_YET_DEPARTED = SUMOTime_MAX
 

Private Member Functions

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

Private Attributes

const NumericalID myNumericalID
 

Static Private Attributes

static NumericalID myCurrentNumericalIndex = 0
 

Friends

class GUIBaseVehicle
 

Move reminder structures

typedef std::vector< std::pair< MSMoveReminder *, double > > 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 52 of file MSBaseVehicle.h.

Member Typedef Documentation

◆ MoveReminderCont

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

Definition of a move reminder container.

Definition at line 516 of file MSBaseVehicle.h.

◆ NumericalID

typedef long long int SUMOVehicle::NumericalID
inherited

Definition at line 63 of file SUMOVehicle.h.

Constructor & Destructor Documentation

◆ MSBaseVehicle()

MSBaseVehicle::MSBaseVehicle ( SUMOVehicleParameter pars,
const MSRoute route,
MSVehicleType type,
const double  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 73 of file MSBaseVehicle.cpp.

References MSRoute::addReference(), MSRoute::begin(), MSDevice::buildVehicleDevices(), calculateArrivalParams(), MSGlobals::gCheckRoutes, MSRoute::getLastEdge(), hasValidRoute(), SUMOVehicleParameter::id, MSEdge::isTazConnector(), myDevices, myMoveReminders, myParameter, myRoute, SUMOVehicleParameter::parametersSet, VEHPARS_FORCE_REROUTE, and SUMOVehicleParameter::wasSet().

◆ ~MSBaseVehicle()

MSBaseVehicle::~MSBaseVehicle ( )
virtual

Member Function Documentation

◆ activateReminders()

void MSBaseVehicle::activateReminders ( const MSMoveReminder::Notification  reason,
const MSLane enteredLane = 0 
)
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
[in]enteredLaneThe lane, which is entered (if applicable)
See also
MSMoveReminder
MSMoveReminder::notifyEnter
MSMoveReminder::Notification

Reimplemented in MSVehicle.

Definition at line 458 of file MSBaseVehicle.cpp.

References myMoveReminders.

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

◆ addContainer()

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 391 of file MSBaseVehicle.cpp.

References MSDevice_Transportable::addTransportable(), MSDevice_Transportable::buildVehicleDevices(), SUMOVehicleParameter::depart, DEPART_TRIGGERED, SUMOVehicleParameter::departProcedure, MSNet::getCurrentTimeStep(), MSNet::getInstance(), myContainerDevice, myDevices, myMoveReminders, and myParameter.

Referenced by MSVehicle::addContainer(), and getDevices().

◆ addPerson()

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 379 of file MSBaseVehicle.cpp.

References MSDevice_Transportable::addTransportable(), MSDevice_Transportable::buildVehicleDevices(), SUMOVehicleParameter::depart, DEPART_TRIGGERED, SUMOVehicleParameter::departProcedure, MSNet::getCurrentTimeStep(), MSNet::getInstance(), myDevices, myMoveReminders, myParameter, and myPersonDevice.

Referenced by MSVehicle::addPerson(), and getDevices().

◆ addReminder()

void MSBaseVehicle::addReminder ( MSMoveReminder rem)

Adds a MoveReminder dynamically.

Parameters
[in]remthe reminder to add
See also
MSMoveReminder

Definition at line 431 of file MSBaseVehicle.cpp.

References myMoveReminders.

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

◆ addStop()

virtual bool SUMOVehicle::addStop ( const SUMOVehicleParameter::Stop stopPar,
std::string &  errorMsg,
SUMOTime  untilOffset = 0,
bool  collision = false,
ConstMSEdgeVector::const_iterator *  searchStart = 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(), and SUMOVehicle::~SUMOVehicle().

◆ 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 559 of file MSBaseVehicle.cpp.

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

Referenced by GUIMEVehicleControl::buildVehicle(), MEVehicleControl::buildVehicle(), GUIVehicleControl::buildVehicle(), MSVehicleControl::buildVehicle(), MEVehicle::getBlockTimeSeconds(), MSVehicle::replaceRoute(), and setChosenSpeedFactor().

◆ calculateArrivalParams()

◆ createDevice()

void MSBaseVehicle::createDevice ( const std::string &  deviceName)

◆ getAcceleration()

double MSBaseVehicle::getAcceleration ( ) const
virtual

Returns the vehicle's acceleration.

This default implementation returns always 0.

Returns
The acceleration

Implements SUMOTrafficObject.

Reimplemented in MSVehicle.

Definition at line 348 of file MSBaseVehicle.cpp.

Referenced by getCurrentRouteEdge().

◆ getAccumulatedWaitingTime()

virtual SUMOTime SUMOVehicle::getAccumulatedWaitingTime ( ) const
pure virtualinherited

◆ getAngle()

virtual double SUMOVehicle::getAngle ( ) const
pure virtualinherited

Get the vehicle's angle.

Returns
The angle of the vehicle (in degree)

Implements SUMOTrafficObject.

Implemented in MSVehicle, GUIMEVehicle, GUIVehicle, and MEVehicle.

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

◆ getArrivalPos()

virtual double 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 277 of file MSBaseVehicle.h.

References myArrivalPos.

Referenced by MSLCM_SL2015::_wantsChangeSublane(), MSLane::isInsertionSuccess(), and MSVehicle::rerouteParkingArea().

◆ getBackPositionOnLane()

virtual double SUMOTrafficObject::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 MSTransportable, MSVehicle, and MEVehicle.

Referenced by MSE3Collector::MSE3EntryReminder::notifyEnter(), MSInductLoop::notifyEnter(), MSE3Collector::MSE3LeaveReminder::notifyEnter(), MSE2Collector::notifyEnter(), and SUMOTrafficObject::~SUMOTrafficObject().

◆ getBrakeGap()

virtual double SUMOVehicle::getBrakeGap ( ) const
pure virtualinherited

get distance for coming to a stop (used for rerouting checks)

Implemented in MSVehicle, and MEVehicle.

Referenced by MSTriggeredRerouter::rerouteParkingArea(), and SUMOVehicle::~SUMOVehicle().

◆ getChosenSpeedFactor()

double 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 SUMOTrafficObject.

Definition at line 410 of file MSBaseVehicle.h.

References myChosenSpeedFactor.

Referenced by libsumo::Vehicle::getAllowedSpeed(), MSLane::getDepartSpeed(), GUIVehicle::getParameterWindow(), and GUIMEVehicle::getParameterWindow().

◆ getContainerDevice()

const MSDevice_Transportable* MSBaseVehicle::getContainerDevice ( ) const
inline

◆ getContainerNumber()

int MSBaseVehicle::getContainerNumber ( ) const
virtual

◆ getContainers()

const std::vector< MSTransportable * > & MSBaseVehicle::getContainers ( ) const
virtual

retrieve riding containers

Implements SUMOVehicle.

Definition at line 628 of file MSBaseVehicle.cpp.

References MSDevice_Transportable::getTransportables(), myContainerDevice, and myEmptyTransportableVector.

Referenced by getDevices(), and MSXMLRawOut::writeVehicle().

◆ getCurrentRouteEdge()

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 200 of file MSBaseVehicle.h.

References getAcceleration(), getSlope(), myCurrEdge, onDepart(), replaceRouteEdges(), and reroute().

Referenced by MSDevice_SSM::findFoeConflictLane(), libsumo::Vehicle::getDistance(), libsumo::Vehicle::getNextTLS(), MSRailSignal::hasOncomingRailTraffic(), libsumo::Vehicle::moveTo(), and libsumo::Vehicle::moveToXY().

◆ getDepartDelay()

SUMOTime MSBaseVehicle::getDepartDelay ( ) const
inlinevirtual

◆ getDepartPos()

double MSBaseVehicle::getDepartPos ( ) const
inlinevirtual

Returns this vehicle's real departure position.

Returns
This vehicle's real departure position

Implements SUMOVehicle.

Definition at line 269 of file MSBaseVehicle.h.

References myDepartPos.

Referenced by libsumo::Vehicle::getDistance().

◆ getDeparture()

SUMOTime MSBaseVehicle::getDeparture ( ) const
inlinevirtual

Returns this vehicle's real departure time.

Returns
This vehicle's real departure time

Implements SUMOVehicle.

Definition at line 256 of file MSBaseVehicle.h.

References myDeparture.

Referenced by getDepartDelay(), and MSVehicle::Influencer::postProcessRemoteControl().

◆ getDevice()

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

◆ getDeviceParameter()

std::string MSBaseVehicle::getDeviceParameter ( const std::string &  deviceName,
const std::string &  key 
) const

try to retrieve the given parameter from any of the vehicles devices, raise InvalidArgument if no device parameter by that name exists

Definition at line 669 of file MSBaseVehicle.cpp.

References myDevices.

Referenced by libsumo::Vehicle::getParameter(), and isVehicle().

◆ getDevices()

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

Returns this vehicle's devices.

Returns
This vehicle's devices

Implements SUMOVehicle.

Definition at line 325 of file MSBaseVehicle.h.

References activateReminders(), addContainer(), addPerson(), addReminder(), getContainers(), getPersons(), hasValidRoute(), myDevices, removeReminder(), and removeTransportable().

◆ getEdge()

◆ getID()

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

Returns the name of the vehicle.

Implements SUMOTrafficObject.

Definition at line 137 of file MSBaseVehicle.cpp.

References SUMOVehicleParameter::id, and myParameter.

Referenced by MSLCM_LC2013::_patchSpeed(), MSLCM_SL2015::_patchSpeed(), MSCFModel_Wiedemann::_v(), MSCFModel_ACC::_v(), MSCFModel_CACC::_v(), MSLCM_LC2013::_wantsChange(), MSLCM_SL2015::_wantsChangeSublane(), MSLaneChangerSublane::abortLCManeuver(), MSVehicle::adaptToLeader(), MSVehicle::adaptToLeaders(), MSVehicleTransfer::add(), MSPModel_Striping::addCrossingVehs(), MSLCM_SL2015::addLCSpeedAdvice(), MSVehicle::addTraciStopAtStoppingPlace(), MSCFModel::applyHeadwayAndSpeedDifferencePerceptionErrors(), MSCFModel::applyHeadwayPerceptionError(), libsumo::Helper::applySubscriptionFilters(), calculateArrivalParams(), MSLaneChangerSublane::change(), MSLaneChanger::change(), MSLCM_SL2015::changed(), MSLaneChanger::changeOpposite(), MELoop::changeSegment(), libsumo::Vehicle::changeTarget(), MSLaneChanger::checkChange(), MSLaneChangerSublane::checkChangeSublane(), MSLane::checkFailure(), MSLane::checkForPedestrians(), GUIApplicationWindow::checkGamingEvents(), MSVehicleTransfer::checkInsertions(), MSVehicle::checkLinkLeader(), MSVehicle::checkRewindLinkLanes(), MSLCM_SL2015::checkStrategicChange(), MSLaneChanger::checkTraCICommands(), MSAbstractLaneChangeModel::checkTraCICommands(), MSDevice_SSM::classifyEncounter(), MSDevice_SSM::closeEncounter(), MSLCM_SL2015::commitManoeuvre(), MSVehicle::computeAngle(), MSLCM_SL2015::computeSpeedLat(), MSDevice_SSM::computeSSMs(), MSLaneChanger::continueChange(), MSLaneChangerSublane::continueChangeSublane(), MSLCM_SL2015::decideDirection(), MSLane::detectCollisionBetween(), MSLane::detectCollisions(), MSLane::detectPedestrianJunctionCollision(), MSDevice_SSM::Encounter::Encounter(), MSCalibrator::execute(), MSVehicle::executeMove(), MSLane::executeMovements(), MSCFModel_Daniel1::finalizeSpeed(), MSCFModel::finalizeSpeed(), MSLaneChanger::findCandidate(), MSDevice_SSM::findFoeConflictLane(), MSDevice_SSM::findSurroundingVehicles(), MSDevice_SSM::flushGlobalMeasures(), MSCFModel_W99::followSpeed(), MSCFModel_CACC::followSpeed(), MSVehicle::getBackPosition(), MSVehicle::getBackPositionOnLane(), MSVehicle::getCenterOnEdge(), MSLaneChanger::getColumnleader(), MSLane::getCriticalLeader(), MSLane::getFirstVehicleInformation(), MSLane::getFollower(), MSLane::getFollowersOnConsecutive(), MSPModel_Striping::PStateVehicle::getID(), MSLane::getLastVehicleInformation(), MSVehicle::getLatOffset(), MSLane::getLeader(), MSLink::getLeaderInfo(), MSLane::getLeaderOnConsecutive(), MSLaneChangerSublane::getLeaders(), MSLane::getLeadersOnConsecutive(), MSLane::getOppositeFollower(), MSLane::getOppositeLeader(), MSLane::getPartialBehind(), MSSimpleDriverState::getPerceivedHeadway(), MSSimpleDriverState::getPerceivedSpeedDifference(), MSCFModel_CC::getRadarMeasurements(), MSLaneChanger::getRealFollower(), MSLaneChanger::getRealLeader(), getRNG(), MSVehicle::getSafeFollowSpeed(), MSAbstractLaneChangeModel::getShadowLane(), getSingularType(), MSDevice_SSM::getUpstreamVehicles(), MSPModel_Striping::getVehicleObstacles(), MSLink::getZipperSpeed(), MSLane::handleCollisionBetween(), MSVehicle::haveValidStopEdges(), libsumo::Vehicle::highlight(), MSVehicle::ignoreRed(), MSLCM_LC2013::inform(), MSLCM_SL2015::inform(), MSLCM_LC2013::informFollower(), MSLCM_SL2015::informFollower(), MSLCM_LC2013::informLeader(), MSLCM_SL2015::informLeader(), MESegment::initialise(), MSPedestrianPushButton::isActiveForEdge(), MSLane::isInsertionSuccess(), MSVehicle::isLeader(), isVehicle(), MSAbstractLaneChangeModel::laneChangeOutput(), MSVehicle::lateralDistanceToLane(), MSVehicle::leaveLane(), libsumo::Vehicle::moveToXY(), MSLCM_LC2013::MSLCM_LC2013(), MSSimpleDriverState::MSSimpleDriverState(), MSCalibrator::VehicleRemover::notifyEnter(), MSVehicle::onRemovalFromNet(), MSLaneChangerSublane::outputLCStarted(), MSLCM_LC2013::patchSpeed(), MSLCM_SL2015::patchSpeed(), MSCFModel_CC::performAutoLaneChange(), MSVehicle::planMove(), MSVehicle::planMoveInternal(), MSLCM_SL2015::prepareStep(), TraCIServerAPI_GUI::processGet(), MSVehicle::processLaneAdvances(), MSVehicle::processLinkApproaches(), MSVehicle::processNextStop(), MSVehicle::processTraCISpeedControl(), MSVehicle::removePassedDriveItems(), replaceRouteEdges(), reroute(), MSVehicle::rerouteParkingArea(), MSLane::resetManeuverReservation(), MSLane::resetPartialOccupation(), libsumo::Vehicle::resume(), MSLane::safeInsertionSpeed(), MSLCM_LC2013::saveBlockerLength(), MSLCM_SL2015::saveBlockerLength(), saveState(), MSCalibrator::scheduleRemoval(), GUIVehicle::selectBlockingFoes(), MSVehicle::setAngle(), MSVehicle::setApproachingForAllLinks(), MSSimpleDriverState::setAwareness(), MSAbstractLaneChangeModel::setManeuverDist(), MSLane::setManeuverReservation(), MSLCM_SL2015::setOwnState(), MSDevice_ToC::setParameter(), MSCFModel_CC::setParameter(), MSLane::setPartialOccupation(), libsumo::Helper::setRemoteControlled(), libsumo::Vehicle::setRoute(), libsumo::Vehicle::setRouteID(), MSLCM_LC2013::slowDownForBlocked(), MSLCM_SL2015::slowDownForBlocked(), MSLaneChangerSublane::startChangeSublane(), MELoop::teleportVehicle(), METriggeredCalibrator::tryEmit(), MSSimpleDriverState::update(), MSVehicle::updateBestLanes(), MSVehicle::updateDriveItems(), MSLCM_SL2015::updateExpectedSublaneSpeeds(), MSVehicle::updateFurtherLanes(), MSLCM_SL2015::updateGaps(), MSAbstractLaneChangeModel::updateShadowLane(), MSVehicle::updateState(), MSAbstractLaneChangeModel::updateTargetLane(), MSLCM_LC2013::wantsChange(), MSLCM_SL2015::wantsChange(), MSLCM_SL2015::wantsChangeSublane(), MSBatteryExport::write(), and MSXMLRawOut::writeVehicle().

◆ getImpatience()

◆ getLane()

◆ getLateralPositionOnLane()

virtual double 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 183 of file MSBaseVehicle.h.

◆ getLength()

◆ getMaxSpeed()

double MSBaseVehicle::getMaxSpeed ( ) const
virtual

◆ getNextParkingArea()

virtual MSParkingArea* SUMOVehicle::getNextParkingArea ( )
pure virtualinherited

returns the next imminent stop in the stop queue

Returns
the upcoming stop

Implemented in MSVehicle, and MEVehicle.

Referenced by MSTriggeredRerouter::notifyEnter(), MSTriggeredRerouter::rerouteParkingArea(), and SUMOVehicle::~SUMOVehicle().

◆ getNumberReroutes()

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 299 of file MSBaseVehicle.h.

References getContainerNumber(), getImpatience(), getPersonIDList(), getPersonNumber(), and myNumberReroutes.

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

◆ getNumericalID()

NumericalID MSBaseVehicle::getNumericalID ( ) const
inlinevirtual

return the numerical ID which is only for internal usage

Implements SUMOVehicle.

Definition at line 470 of file MSBaseVehicle.h.

References myNumericalID.

Referenced by MSVehicleTransfer::VehicleInformation::operator<().

◆ getParameter()

◆ getPersonDevice()

const MSDevice_Transportable* MSBaseVehicle::getPersonDevice ( ) const
inline

Definition at line 474 of file MSBaseVehicle.h.

References myPersonDevice.

Referenced by GUIBaseVehicle::getNumPassengers().

◆ getPersonIDList()

std::vector< std::string > MSBaseVehicle::getPersonIDList ( ) const
virtual

Returns the list of persons.

Returns
The list of passengers on-board

Implements SUMOVehicle.

Definition at line 589 of file MSBaseVehicle.cpp.

References getPersons().

Referenced by getNumberReroutes(), and libsumo::Vehicle::getPersonIDList().

◆ getPersonNumber()

int MSBaseVehicle::getPersonNumber ( ) const
virtual

◆ getPersons()

const std::vector< MSTransportable * > & MSBaseVehicle::getPersons ( ) const
virtual

◆ getPosition()

virtual Position SUMOTrafficObject::getPosition ( const double  offset = 0) const
pure virtualinherited

◆ getPositionOnLane()

◆ getPreviousSpeed()

double MSBaseVehicle::getPreviousSpeed ( ) const
virtual

Returns the vehicle's previous speed.

Returns
The vehicle's speed

Implements SUMOTrafficObject.

Reimplemented in MSVehicle.

Definition at line 68 of file MSBaseVehicle.cpp.

◆ getRerouteOrigin()

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 192 of file MSBaseVehicle.h.

References myCurrEdge.

Referenced by replaceRouteEdges(), and reroute().

◆ getRNG()

◆ getRoute()

◆ getSingularType()

MSVehicleType & MSBaseVehicle::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
MSBaseVehicle::myType

Definition at line 702 of file MSBaseVehicle.cpp.

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

Referenced by TraCIServerAPI_Vehicle::processSet(), MSVehicle::setActionStepLength(), setChosenSpeedFactor(), MSDevice_ToC::setState(), and libsumo::Vehicle::setVia().

◆ getSlope()

double MSBaseVehicle::getSlope ( ) const
virtual

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

This default implementation returns always 0.

Returns
The slope

Implements SUMOTrafficObject.

Reimplemented in MSVehicle, and MEVehicle.

Definition at line 354 of file MSBaseVehicle.cpp.

Referenced by getCurrentRouteEdge().

◆ getSpeed()

◆ getStopEdges()

virtual const ConstMSEdgeVector MSBaseVehicle::getStopEdges ( double &  firstPos,
double &  lastPos 
) const
protectedpure virtual

Returns the list of still pending stop edges.

Implemented in MSVehicle, and MEVehicle.

Referenced by getContainerDevice(), and reroute().

◆ getStopIndices()

virtual std::vector<std::pair<int, double> > SUMOVehicle::getStopIndices ( ) const
pure virtualinherited

return list of route indices and stop positions for the remaining stops

Implemented in MSVehicle, and MEVehicle.

Referenced by SUMOVehicle::~SUMOVehicle().

◆ getVClass()

◆ getVehicleType()

const MSVehicleType& MSBaseVehicle::getVehicleType ( ) const
inlinevirtual

Returns the vehicle's type definition.

Returns
The vehicle's type definition

Implements SUMOTrafficObject.

Definition at line 118 of file MSBaseVehicle.h.

References myType.

Referenced by MSLCM_LC2013::_patchSpeed(), MSLCM_SL2015::_patchSpeed(), MSLCM_LC2013::_wantsChange(), MSLCM_SL2015::_wantsChangeSublane(), MSCFModel_ACC::accelGapControl(), MSLCM_LC2013::adaptSpeedToPedestrians(), MSVehicle::adaptToLeaders(), MSPModel_Striping::addCrossingVehs(), libsumo::Helper::applySubscriptionFilters(), MSVehicle::basePos(), MSLaneChanger::change(), MSLaneChanger::changeOpposite(), MSLCM_SL2015::checkBlocking(), MSLaneChanger::checkChange(), MSLaneChangerSublane::checkChangeToNewLane(), MSLane::checkFailure(), MSLane::checkForPedestrians(), GUIApplicationWindow::checkGamingEvents(), MSVehicleTransfer::checkInsertions(), MSVehicle::checkRewindLinkLanes(), MSLCM_SL2015::checkStrategicChange(), MSDevice_SSM::classifyEncounter(), MSLCM_SL2015::commitManoeuvre(), MSLaneChanger::computeOvertakingTime(), MSLCM_SL2015::computeSpeedLat(), MSAbstractLaneChangeModel::computeSpeedLat(), MSLane::detectCollisionBetween(), MSLane::detectCollisions(), GUIVehicle::drawAction_drawCarriageClass(), GUIVehicle::drawAction_drawLinkItems(), GUIVehicle::drawAction_drawVehicleBlinker(), GUIVehicle::drawAction_drawVehicleBrakeLight(), GUIEdge::drawMesoVehicles(), MSLane::enteredByLaneChange(), MSVehicle::enterLaneAtInsertion(), MSVehicle::enterLaneAtLaneChange(), MSDevice_SSM::estimateConflictTimes(), MSAbstractLaneChangeModel::estimateLCDuration(), MEVehicle::estimateLeaveSpeed(), MSVehicle::estimateLeaveSpeed(), MSLane::executeMovements(), MSLane::freeInsertion(), MSVehicle::Influencer::gapControlSpeed(), MEVehicle::getBackPositionOnLane(), MSLane::getBruttoOccupancy(), GUIBaseVehicle::getCenteringBoundary(), MSLaneChanger::getColumnleader(), MSLane::getCriticalLeader(), MSEdge::getDepartLane(), MSEdge::getDepartPosBound(), MSLane::getDepartPosLat(), libsumo::Vehicle::getDrivingDistance2D(), MSLane::getFollower(), MSLane::getFollowersOnConsecutive(), getImpatience(), MSVehicle::getLateralOverlap(), MSLane::getLeader(), MSVehicle::getLeader(), MSLink::getLeaderInfo(), MSLane::getLeaderOnConsecutive(), MSLaneChangerSublane::getLeaders(), MSLane::getLeadersOnConsecutive(), GUIVehicle::getLeftSideOnEdge(), MSPModel_Striping::PStateVehicle::getMaxX(), MSPModel_Striping::PStateVehicle::getMinX(), MSLane::getNettoOccupancy(), MSLane::getOppositeFollower(), MSLane::getOppositeLeader(), MSLaneChanger::getRealFollower(), MSLaneChanger::getRealLeader(), MSVehicle::getRightSideOnEdge(), MSVehicle::getRightSideOnLane(), MSVehicle::getSafeFollowSpeed(), MSLeaderInfo::getSubLanes(), MSVehicle::getTimeGapOnLane(), MESegment::getTimeHeadway(), MSPModel_Striping::getVehicleObstacles(), GUIBaseVehicle::getVType(), MSLCM_SL2015::getWidth(), MSPModel_Striping::PStateVehicle::getWidth(), MSLink::getZipperSpeed(), MSLane::handleCollisionBetween(), MESegment::hasSpaceFor(), MSVehicle::ignoreRed(), MSVehicle::Influencer::implicitSpeedRemote(), MSLane::incorporateVehicle(), MSLCM_SL2015::informFollower(), MSLCM_SL2015::informLeader(), MSLCM_SL2015::informLeaders(), MSLane::insertVehicle(), MSLane::isInsertionSuccess(), MESegment::isOpen(), MSVehicle::keepClear(), MSLCM_SL2015::keepLatGap(), MSAbstractLaneChangeModel::laneChangeOutput(), MSLane::lastInsertion(), MSLane::leftByLaneChange(), MESegment::loadState(), MSPModel_Striping::moveInDirection(), libsumo::Vehicle::moveToXY(), libsumo::Vehicle::openGap(), MSVehicle::overlap(), MSLCM_LC2013::overtakeDistance(), MSLCM_DK2008::patchSpeed(), MSCFModel_Krauss::patchSpeedBeforeLC(), MSVehicle::planMoveInternal(), MSVehicle::Influencer::postProcessRemoteControl(), MSVehicle::processLinkApproaches(), MSVehicle::processNextStop(), MSVehicle::processTraCISpeedControl(), MESegment::receive(), MSLaneChanger::ChangeElem::registerHop(), MSLaneChanger::registerUnchanged(), MSAbstractLaneChangeModel::remainingTime(), MESegment::removeCar(), MSLane::removeVehicle(), MSLane::safeInsertionSpeed(), MSLCM_LC2013::saveBlockerLength(), MSLCM_SL2015::saveBlockerLength(), saveState(), GUIVehicle::selectBlockingFoes(), MSVehicleType::setActionStepLength(), MSAbstractLaneChangeModel::setFollowerGaps(), GUIBaseVehicle::setFunctionalColor(), MSAbstractLaneChangeModel::setLeaderGaps(), MSAbstractLaneChangeModel::setOrigLeaderGaps(), MSVehicle::setTentativeLaneAndPosition(), MSLCM_LC2013::slowDownForBlocked(), MSLCM_SL2015::slowDownForBlocked(), MSCFModel_CACC::speedGapControl(), MSLaneChangerSublane::startChangeSublane(), MSVehicle::unsafeLinkAhead(), MSLCM_SL2015::updateCFRelated(), MSLCM_SL2015::updateExpectedSublaneSpeeds(), MSLCM_SL2015::updateGaps(), MSLCM_DK2008::wantsChangeToLeft(), MSLCM_DK2008::wantsChangeToRight(), MSBatteryExport::write(), and MSQueueExport::writeLane().

◆ getWaitingTime()

virtual SUMOTime SUMOTrafficObject::getWaitingTime ( ) const
pure virtualinherited

◆ getWidth()

◆ hasArrived()

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 SUMOTrafficObject.

Reimplemented in MSVehicle, and MEVehicle.

Definition at line 374 of file MSBaseVehicle.cpp.

References succEdge().

Referenced by setArrivalPos().

◆ hasDeparted()

bool MSBaseVehicle::hasDeparted ( ) const
virtual

◆ hasDevice()

bool MSBaseVehicle::hasDevice ( const std::string &  deviceName) const

check whether the vehicle is equiped with a device of the given type

Definition at line 639 of file MSBaseVehicle.cpp.

References myDevices.

Referenced by createDevice(), libsumo::Vehicle::getParameter(), and isVehicle().

◆ hasValidRoute()

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 403 of file MSBaseVehicle.cpp.

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

Referenced by getDevices(), MESegment::initialise(), libsumo::Vehicle::isRouteValid(), MSBaseVehicle(), replaceRouteEdges(), and libsumo::Vehicle::setRouteID().

◆ isFrontOnLane()

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 175 of file MSBaseVehicle.h.

◆ isOnRoad()

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 155 of file MSBaseVehicle.h.

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

◆ isParking()

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 GUIVehicleControl::insertVehicleIDs(), libsumo::Vehicle::isVisible(), MSFCDExport::write(), and SUMOVehicle::~SUMOVehicle().

◆ isRemoteControlled()

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 163 of file MSBaseVehicle.h.

◆ isSelected()

virtual bool MSBaseVehicle::isSelected ( ) const
inlinevirtual

whether this vehicle is selected in the GUI

Implements SUMOVehicle.

Reimplemented in GUIVehicle.

Definition at line 463 of file MSBaseVehicle.h.

References getRNG().

Referenced by MSCFModel_Wiedemann::_v(), and MSCFModel_IDM::followSpeed().

◆ isStopped()

virtual bool SUMOTrafficObject::isStopped ( ) const
pure virtualinherited

◆ isStoppedInRange()

virtual bool SUMOVehicle::isStoppedInRange ( const double  pos,
const double  tolerance 
) const
pure virtualinherited

Returns whether the vehicle is stopped in the range of the given position.

Implemented in MSVehicle, and MEVehicle.

Referenced by SUMOVehicle::~SUMOVehicle().

◆ isStoppedTriggered()

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.

Referenced by SUMOVehicle::~SUMOVehicle().

◆ isVehicle()

bool MSBaseVehicle::isVehicle ( ) const
inlinevirtual

Get the vehicle's ID.

Returns
The the ID of the vehicle

Implements SUMOTrafficObject.

Definition at line 79 of file MSBaseVehicle.h.

References createDevice(), getDeviceParameter(), getID(), getParameter(), hasDevice(), replaceParameter(), and setDeviceParameter().

◆ loadState()

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.

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

◆ onDepart()

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 360 of file MSBaseVehicle.cpp.

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

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

◆ operator=()

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

invalidated assignment operator

◆ remainingStopDuration()

virtual SUMOTime SUMOVehicle::remainingStopDuration ( ) const
pure virtualinherited

Returns the remaining stop duration for a stopped vehicle or 0.

Implemented in MSVehicle, and MEVehicle.

Referenced by SUMOVehicle::~SUMOVehicle().

◆ removeReminder()

void MSBaseVehicle::removeReminder ( MSMoveReminder rem)

Removes a MoveReminder dynamically.

Parameters
[in]remthe reminder to remove
See also
MSMoveReminder

Definition at line 442 of file MSBaseVehicle.cpp.

References myMoveReminders.

Referenced by getDevices().

◆ removeTransportable()

void MSBaseVehicle::removeTransportable ( MSTransportable t)
virtual

removes a person or container

Implements SUMOVehicle.

Definition at line 606 of file MSBaseVehicle.cpp.

References myContainerDevice, myPersonDevice, and MSDevice_Transportable::removeTransportable().

Referenced by getDevices().

◆ replaceParameter()

void MSBaseVehicle::replaceParameter ( const SUMOVehicleParameter newParameter)
virtual

replace the vehicle parameter (deleting the old one)

Implements SUMOVehicle.

Definition at line 148 of file MSBaseVehicle.cpp.

References myParameter.

Referenced by isVehicle(), and MSVehicle::rerouteParkingArea().

◆ replaceParkingArea()

virtual bool SUMOVehicle::replaceParkingArea ( MSParkingArea parkingArea,
std::string &  errorMsg 
)
pure virtualinherited

Replaces a stop.

The stop replace the next stop into the sorted list.

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

Implemented in MSVehicle, and MEVehicle.

Referenced by MSTriggeredRerouter::notifyEnter(), and SUMOVehicle::~SUMOVehicle().

◆ replaceRoute()

virtual bool SUMOVehicle::replaceRoute ( const MSRoute route,
const std::string &  info,
bool  onInit = false,
int  offset = 0,
bool  addStops = true,
bool  removeStops = true 
)
pure virtualinherited

Replaces the current route by the given one.

Implemented in MEVehicle, and MSVehicle.

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

◆ replaceRouteEdges()

bool MSBaseVehicle::replaceRouteEdges ( ConstMSEdgeVector edges,
double  cost,
double  savings,
const std::string &  info,
bool  onInit = false,
bool  check = false,
bool  removeStops = true 
)
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
[in]removeStopsWhether stops should be removed if they do not fit onto the new route
Returns
Whether the new route was accepted

Implements SUMOVehicle.

Definition at line 292 of file MSBaseVehicle.cpp.

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

Referenced by libsumo::Vehicle::changeTarget(), getCurrentRouteEdge(), MSVehicle::Influencer::postProcessRemoteControl(), reroute(), GUIVehicle::rerouteDRTStop(), MSVehicle::rerouteParkingArea(), and libsumo::Vehicle::setRoute().

◆ replaceVehicleType()

void MSBaseVehicle::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 "myType".

Parameters
[in]typeThe new vehicle type
See also
MSBaseVehicle::myType

Definition at line 692 of file MSBaseVehicle.cpp.

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

Referenced by getSingularType(), setChosenSpeedFactor(), libsumo::Vehicle::setType(), and MSDevice_ToC::switchHolderType().

◆ reroute()

void MSBaseVehicle::reroute ( SUMOTime  t,
const std::string &  info,
SUMOAbstractRouter< MSEdge, SUMOVehicle > &  router,
const bool  onInit = false,
const bool  withTaz = false,
const bool  silent = false 
)
virtual

◆ saveState()

◆ setArrivalPos()

virtual void MSBaseVehicle::setArrivalPos ( double  arrivalPos)
inlinevirtual

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

Implements SUMOVehicle.

Definition at line 283 of file MSBaseVehicle.h.

References hasArrived(), hasDeparted(), and myArrivalPos.

◆ setChosenSpeedFactor()

void MSBaseVehicle::setChosenSpeedFactor ( const double  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 417 of file MSBaseVehicle.h.

References addStops(), getDevice(), getSingularType(), myChosenSpeedFactor, replaceVehicleType(), and saveState().

Referenced by MSCFModel_CC::finalizeSpeed(), and libsumo::Vehicle::remove().

◆ setDeviceParameter()

void MSBaseVehicle::setDeviceParameter ( const std::string &  deviceName,
const std::string &  key,
const std::string &  value 
)

try to set the given parameter from any of the vehicles devices, raise InvalidArgument if no device parameter by that name exists

Definition at line 680 of file MSBaseVehicle.cpp.

References myDevices.

Referenced by isVehicle(), and libsumo::Vehicle::setParameter().

◆ stopsAt()

virtual bool SUMOVehicle::stopsAt ( MSStoppingPlace stop) const
pure virtualinherited

Returns whether the vehicle stops at the given stopping place.

Implemented in MSVehicle, and MEVehicle.

Referenced by MSTransportable::Stage_Driving::isWaitingFor(), and SUMOVehicle::~SUMOVehicle().

◆ succEdge()

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 160 of file MSBaseVehicle.cpp.

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

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

◆ wasRemoteControlled()

virtual bool MSBaseVehicle::wasRemoteControlled ( SUMOTime  lookBack = DELTA_T) const
inlinevirtual

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

Returns
Whether the vehicle was remote-controlled within the given time range

Implements SUMOVehicle.

Reimplemented in MSVehicle.

Definition at line 167 of file MSBaseVehicle.h.

References UNUSED_PARAMETER.

Friends And Related Function Documentation

◆ GUIBaseVehicle

friend class GUIBaseVehicle
friend

Definition at line 63 of file MSBaseVehicle.h.

Field Documentation

◆ myArrivalLane

int MSBaseVehicle::myArrivalLane
protected

The destination lane where the vehicle stops.

Definition at line 541 of file MSBaseVehicle.h.

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

◆ myArrivalPos

double MSBaseVehicle::myArrivalPos
protected

◆ myChosenSpeedFactor

double MSBaseVehicle::myChosenSpeedFactor
protected

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

Definition at line 505 of file MSBaseVehicle.h.

Referenced by getChosenSpeedFactor(), saveState(), and setChosenSpeedFactor().

◆ myContainerDevice

MSDevice_Transportable* MSBaseVehicle::myContainerDevice
protected

◆ myCurrEdge

◆ myCurrentNumericalIndex

SUMOVehicle::NumericalID MSBaseVehicle::myCurrentNumericalIndex = 0
staticprivate

Definition at line 556 of file MSBaseVehicle.h.

◆ myDepartPos

double MSBaseVehicle::myDepartPos
protected

The real depart position.

Definition at line 535 of file MSBaseVehicle.h.

Referenced by getDepartPos(), MEVehicle::loadState(), MSVehicle::loadState(), onDepart(), MEVehicle::saveState(), and MSVehicle::saveState().

◆ myDeparture

SUMOTime MSBaseVehicle::myDeparture
protected

◆ myDevices

◆ myEmptyTransportableVector

std::vector< MSTransportable * > MSBaseVehicle::myEmptyTransportableVector
staticprotected

Definition at line 551 of file MSBaseVehicle.h.

Referenced by getContainers(), and getPersons().

◆ myMoveReminders

◆ myNumberReroutes

int MSBaseVehicle::myNumberReroutes
protected

The number of reroutings.

Definition at line 544 of file MSBaseVehicle.h.

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

◆ myNumericalID

const NumericalID MSBaseVehicle::myNumericalID
private

Definition at line 554 of file MSBaseVehicle.h.

Referenced by getNumericalID().

◆ myParameter

◆ myPersonDevice

MSDevice_Transportable* MSBaseVehicle::myPersonDevice
protected

◆ myRoute

◆ myType

◆ NOT_YET_DEPARTED

const SUMOTime MSBaseVehicle::NOT_YET_DEPARTED = SUMOTime_MAX
staticprotected

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