Eclipse SUMO - Simulation of Urban MObility
MEVehicle Class Reference

A vehicle from the mesoscopic point of view. More...

#include <MEVehicle.h>

Inheritance diagram for MEVehicle:
Collaboration diagram for MEVehicle:

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...
 
bool addStop (const SUMOVehicleParameter::Stop &stopPar, std::string &errorMsg, SUMOTime untilOffset=0, bool collision=false, MSRouteIterator *searchStart=0)
 Adds a stop. More...
 
void createDevice (const std::string &deviceName)
 create device of the given type More...
 
double estimateLeaveSpeed (const MSLink *link) const
 Returns the vehicle's estimated speed after driving accross the link. More...
 
virtual double getAcceleration () const
 Returns the vehicle's acceleration. More...
 
SUMOTime getAccumulatedWaitingTime () const
 Returns the duration for which the vehicle was blocked. More...
 
double getAngle () const
 Returns the vehicle's direction in degrees. More...
 
virtual double getArrivalPos () const
 Returns this vehicle's desired arrivalPos for its current route (may change on reroute) More...
 
double getAverageSpeed () const
 Returns the vehicle's estimated average speed on the segment assuming no further delays. More...
 
double getBackPositionOnLane (const MSLane *lane) const
 Get the vehicle's position relative to the given lane. More...
 
SUMOTime getBlockTime () const
 Returns the time at which the vehicle was blocked. More...
 
double getBlockTimeSeconds () const
 Returns the time at which the vehicle was blocked on the current segment. More...
 
double getBrakeGap () const
 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...
 
double getConservativeSpeed (SUMOTime &earliestArrival) const
 Returns the vehicle's estimated speed taking into account delays. More...
 
int getContainerNumber () const
 Returns the number of containers. More...
 
const std::vector< MSTransportable * > & getContainers () const
 retrieve riding containers More...
 
double getCurrentLinkPenaltySeconds () const
 Returns the delay that is accrued due to option –meso-tls-penalty or –meso-minor-penalty. More...
 
const MSRouteIteratorgetCurrentRouteEdge () const
 Returns an iterator pointing to the current edge in this vehicles route. More...
 
double getCurrentStoppingTimeSeconds () const
 Returns the delay that is accrued due to option –meso-tls-penalty or –meso-minor-penalty. 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...
 
SUMOTime getEventTime () const
 Returns the (planned) time at which the vehicle leaves his current cell. More...
 
double getEventTimeSeconds () const
 Returns the earliest leave time for the current segment. More...
 
const std::string & getID () const
 Returns the name of the vehicle. More...
 
double getImpatience () const
 Returns this vehicles impatience. More...
 
MSLanegetLane () const
 Returns the lane the vehicle is on. More...
 
SUMOTime getLastEntryTime () const
 Returns the time the vehicle entered the current segment. More...
 
double getLastEntryTimeSeconds () const
 Returns the entry time for the current segment. 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...
 
MSParkingAreagetNextParkingArea ()
 get the current parking area stop 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...
 
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...
 
Position getPosition (const double offset=0) const
 Return current position (x/y, cartesian) More...
 
double getPositionOnLane () const
 Get the vehicle's position along the lane. More...
 
double getPreviousSpeed () const
 Returns the vehicle's previous speed. More...
 
int getQueIndex () const
 Returns the index of the que the vehicle is in. More...
 
virtual const MSEdgegetRerouteOrigin () const
 Returns the starting point for reroutes (usually the current edge) More...
 
const MSRoutegetRoute () const
 Returns the current route. More...
 
MESegmentgetSegment () const
 Returns the current segment the vehicle is on. More...
 
MSVehicleTypegetSingularType ()
 Replaces the current vehicle type with a new one used by this vehicle only. More...
 
double getSlope () const
 Returns the slope of the road at vehicle's position. More...
 
double getSpeed () const
 Returns the vehicle's estimated speed assuming no delays. More...
 
const ConstMSEdgeVector getStopEdges (double &firstPos, double &lastPos) const
 Returns the list of still pending stop edges. More...
 
std::vector< std::pair< int, double > > getStopIndices () const
 return list of route indices for the remaining stops More...
 
SUMOTime getStoptime (const MESegment *const seg, SUMOTime time) const
 Returns until when to stop at the given segment. More...
 
SUMOVehicleClass getVClass () const
 Returns the vehicle's access class. More...
 
const MSVehicleTypegetVehicleType () const
 Returns the vehicle's type definition. More...
 
double getWaitingSeconds () const
 Returns the number of seconds waited (speed was lesser than 0.1m/s) More...
 
SUMOTime getWaitingTime () const
 Returns the duration for which the vehicle was blocked. More...
 
double getWidth () const
 Returns the vehicle's width. More...
 
bool hasArrived () const
 Returns whether this vehicle has already arived (reached the arrivalPosition on 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...
 
bool isOnRoad () const
 Returns the information whether the vehicle is on a road (is simulated) More...
 
bool isParking () const
 Returns whether the vehicle is parking. More...
 
virtual bool isRemoteControlled () const
 Returns the information whether the vehicle is fully controlled via TraCI. More...
 
bool isStopped () const
 Returns whether the vehicle is at a stop. More...
 
bool isStoppedInRange (const double pos, const double tolerance) const
 return whether the given position is within range of the current stop More...
 
bool isStoppedTriggered () const
 Returns whether the vehicle is on a triggered stop. More...
 
bool isVehicle () const
 Get the vehicle's ID. More...
 
bool mayProceed () const
 Returns whether the vehicle is allowed to pass the next junction. More...
 
 MEVehicle (SUMOVehicleParameter *pars, const MSRoute *route, MSVehicleType *type, const double speedFactor)
 Constructor. More...
 
bool moveRoutePointer ()
 Update when the vehicle enters a new edge in the move step. More...
 
void onDepart ()
 Called when the vehicle is inserted into the network. More...
 
void processStop ()
 ends the current stop and performs loading/unloading More...
 
SUMOTime remainingStopDuration () const
 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...
 
bool replaceParkingArea (MSParkingArea *, std::string &)
 replace the current parking area stop with a new stop with merge duration More...
 
bool replaceRoute (const MSRoute *route, const std::string &info, bool onInit=false, int offset=0, bool addStops=true, bool removeStops=true)
 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 setBlockTime (const SUMOTime t)
 Sets the time at which the vehicle was blocked. 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...
 
void setEventTime (SUMOTime t, bool hasDelay=true)
 Sets the (planned) time at which the vehicle leaves his current cell. More...
 
void setLastEntryTime (SUMOTime t)
 Sets the entry time for the current segment. More...
 
virtual void setSegment (MESegment *s, int idx=0)
 Sets the current segment the vehicle is at together with its que. More...
 
bool stopsAt (MSStoppingPlace *) const
 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...
 
void updateDetectorForWriting (MSMoveReminder *rem, SUMOTime currentTime, SUMOTime exitTime)
 Updates a single vehicle detector if present. More...
 
void updateDetectors (SUMOTime currentTime, const bool isLeave, const MSMoveReminder::Notification reason=MSMoveReminder::NOTIFICATION_JUNCTION)
 Updates all vehicle detectors. More...
 
virtual bool wasRemoteControlled (SUMOTime lookBack=DELTA_T) const
 Returns the information whether the vehicle is fully controlled via TraCI. 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...
 
MSDevice_TransportablemyContainerDevice
 The containers this vehicle may have. 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...
 
MSDevice_TransportablemyPersonDevice
 The passengers this vehicle may have. More...
 

Static Protected Attributes

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

Private Attributes

const NumericalID myNumericalID
 

Static Private Attributes

static NumericalID myCurrentNumericalIndex = 0
 

state io

MESegmentmySegment
 The segment the vehicle is at. More...
 
int myQueIndex
 Index of the que the vehicle is in (important for multiqueue extension) More...
 
SUMOTime myEventTime
 The (planned) time of leaving the segment (cell) More...
 
SUMOTime myLastEntryTime
 The time the vehicle entered its current segment. More...
 
SUMOTime myBlockTime
 The time at which the vehicle was blocked on its current segment. More...
 
std::map< const MESegment *const, std::vector< SUMOVehicleParameter::Stop > > myStops
 where to stop More...
 
ConstMSEdgeVector myStopEdges
 edges to stop More...
 
void saveState (OutputDevice &out)
 Saves the states of a vehicle. More...
 
void loadState (const SUMOSAXAttributes &attrs, const SUMOTime offset)
 Loads the state of this vehicle from the given description. More...
 

state io

const SUMOVehicleParametermyParameter
 This vehicle's parameter. More...
 
const MSRoutemyRoute
 This vehicle's route. More...
 
MSVehicleTypemyType
 This vehicle's type. More...
 
MSRouteIterator myCurrEdge
 Iterator to current route-edge. More...
 
double myChosenSpeedFactor
 A precomputed factor by which the driver wants to be faster than the speed limit. More...
 
void addStops (const bool ignoreStopErrors)
 Adds stops to the built vehicle. More...
 
virtual bool isSelected () const
 whether this vehicle is selected in the GUI More...
 
std::mt19937 * getRNG () const
 
NumericalID getNumericalID () const
 return the numerical ID which is only for internal usage More...
 
const MSDevice_TransportablegetPersonDevice () const
 
const MSDevice_TransportablegetContainerDevice () const
 
void calculateArrivalParams ()
 (Re-)Calculates the arrival position and lane from the vehicle parameters More...
 

Move reminder structures

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

Detailed Description

A vehicle from the mesoscopic point of view.

Definition at line 45 of file MEVehicle.h.

Member Typedef Documentation

◆ MoveReminderCont

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

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

◆ MEVehicle()

MEVehicle::MEVehicle ( 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 51 of file MEVehicle.cpp.

References DEPART_SPEED_GIVEN, SUMOVehicleParameter::departSpeed, SUMOVehicleParameter::departSpeedProcedure, MSVehicleType::getID(), MSVehicleType::getMaxSpeed(), MSVehicleType::getVehicleClass(), and SUMOVehicleParameter::id.

Member Function Documentation

◆ activateReminders()

void MSBaseVehicle::activateReminders ( const MSMoveReminder::Notification  reason,
const MSLane enteredLane = 0 
)
virtualinherited

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

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

◆ addContainer()

void MSBaseVehicle::addContainer ( MSTransportable container)
virtualinherited

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(), MSBaseVehicle::myContainerDevice, MSBaseVehicle::myDevices, MSBaseVehicle::myMoveReminders, and MSBaseVehicle::myParameter.

Referenced by MSVehicle::addContainer().

◆ addPerson()

void MSBaseVehicle::addPerson ( MSTransportable person)
virtualinherited

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(), MSBaseVehicle::myDevices, MSBaseVehicle::myMoveReminders, MSBaseVehicle::myParameter, and MSBaseVehicle::myPersonDevice.

Referenced by MSVehicle::addPerson().

◆ addReminder()

void MSBaseVehicle::addReminder ( MSMoveReminder rem)
inherited

Adds a MoveReminder dynamically.

Parameters
[in]remthe reminder to add
See also
MSMoveReminder

Definition at line 431 of file MSBaseVehicle.cpp.

References MSBaseVehicle::myMoveReminders.

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

◆ addStop()

bool MEVehicle::addStop ( const SUMOVehicleParameter::Stop stopPar,
std::string &  errorMsg,
SUMOTime  untilOffset = 0,
bool  collision = false,
MSRouteIterator searchStart = 0 
)
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

Implements SUMOVehicle.

Definition at line 221 of file MEVehicle.cpp.

References MSEdge::dictionary(), SUMOVehicleParameter::Stop::endPos, MELoop::getSegmentForEdge(), MSGlobals::gMesoNet, SUMOVehicleParameter::Stop::index, SUMOVehicleParameter::Stop::lane, myStopEdges, myStops, and STOP_INDEX_FIT.

◆ addStops()

void MSBaseVehicle::addStops ( const bool  ignoreStopErrors)
inherited

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(), MSBaseVehicle::myParameter, MSBaseVehicle::myRoute, SUMOVehicleParameter::repetitionOffset, SUMOVehicleParameter::repetitionsDone, SUMOVehicleParameter::stops, and WRITE_WARNING.

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

◆ calculateArrivalParams()

◆ createDevice()

◆ estimateLeaveSpeed()

double MEVehicle::estimateLeaveSpeed ( const MSLink link) const

Returns the vehicle's estimated speed after driving accross the link.

See also
MSVehicle.cpp::estimateLeaveSpeed

Definition at line 123 of file MEVehicle.cpp.

References MSVehicleType::getCarFollowModel(), MSLink::getLength(), MSCFModel::getMaxAccel(), getSpeed(), MSLane::getVehicleMaxSpeed(), MSBaseVehicle::getVehicleType(), MSLink::getViaLaneOrLane(), and MIN2().

Referenced by MESegment::isOpen().

◆ getAcceleration()

double MSBaseVehicle::getAcceleration ( ) const
virtualinherited

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.

◆ getAccumulatedWaitingTime()

SUMOTime MEVehicle::getAccumulatedWaitingTime ( ) const
inlinevirtual

Returns the duration for which the vehicle was blocked.

Implements SUMOVehicle.

Definition at line 296 of file MEVehicle.h.

References getWaitingTime().

◆ getAngle()

double MEVehicle::getAngle ( ) const
virtual

Returns the vehicle's direction in degrees.

Returns
The vehicle's current angle

Implements SUMOVehicle.

Definition at line 86 of file MEVehicle.cpp.

References MSBaseVehicle::getEdge(), MSEdge::getLanes(), getPositionOnLane(), MSLane::getShape(), MSLane::interpolateLanePosToGeometryPos(), and PositionVector::rotationAtOffset().

Referenced by GUIMEVehicle::getAngle().

◆ getArrivalPos()

virtual double MSBaseVehicle::getArrivalPos ( ) const
inlinevirtualinherited

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 MSBaseVehicle::myArrivalPos.

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

◆ getAverageSpeed()

double MEVehicle::getAverageSpeed ( ) const

Returns the vehicle's estimated average speed on the segment assuming no further delays.

Returns
The vehicle's estimated average speed
Note
This is only an upper bound. The speed will be lower if the preceeding vehicle is delayed

Definition at line 117 of file MEVehicle.cpp.

References MESegment::getLength(), myEventTime, myLastEntryTime, mySegment, and STEPS2TIME.

Referenced by getSpeed().

◆ getBackPositionOnLane()

double MEVehicle::getBackPositionOnLane ( const MSLane lane) const
virtual

Get the vehicle's position relative to the given lane.

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

Implements SUMOTrafficObject.

Definition at line 72 of file MEVehicle.cpp.

References MSVehicleType::getLength(), getPositionOnLane(), and MSBaseVehicle::getVehicleType().

◆ getBlockTime()

SUMOTime MEVehicle::getBlockTime ( ) const
inline

Returns the time at which the vehicle was blocked.

Returns
The blocking time

Definition at line 285 of file MEVehicle.h.

References myBlockTime.

Referenced by MELoop::checkCar(), and getBlockTimeSeconds().

◆ getBlockTimeSeconds()

double MEVehicle::getBlockTimeSeconds ( ) const
inline

Returns the time at which the vehicle was blocked on the current segment.

Definition at line 323 of file MEVehicle.h.

References getBlockTime(), and STEPS2TIME.

Referenced by GUIMEVehicle::getParameterWindow().

◆ getBrakeGap()

double MEVehicle::getBrakeGap ( ) const
inlinevirtual

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

Implements SUMOVehicle.

Definition at line 195 of file MEVehicle.h.

◆ getChosenSpeedFactor()

double MSBaseVehicle::getChosenSpeedFactor ( ) const
inlinevirtualinherited

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 MSBaseVehicle::myChosenSpeedFactor.

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

◆ getConservativeSpeed()

double MEVehicle::getConservativeSpeed ( SUMOTime earliestArrival) const

Returns the vehicle's estimated speed taking into account delays.

Returns
The vehicle's estimated speed
Parameters
[in,out]earliestArrivalA lower bound on leaveTime, modified to contain new lower bound on leave Time
Note
This is only an upper bound. The speed may be even lower if there are further delays downstream

Definition at line 132 of file MEVehicle.cpp.

References DELTA_T, MESegment::getLength(), MAX2(), myEventTime, myLastEntryTime, mySegment, and STEPS2TIME.

◆ getContainerDevice()

const MSDevice_Transportable* MSBaseVehicle::getContainerDevice ( ) const
inlineinherited

Definition at line 478 of file MSBaseVehicle.h.

References MSBaseVehicle::myContainerDevice.

Referenced by GUIBaseVehicle::getNumContainers().

◆ getContainerNumber()

int MSBaseVehicle::getContainerNumber ( ) const
virtualinherited

◆ getContainers()

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

◆ getCurrentLinkPenaltySeconds()

double MEVehicle::getCurrentLinkPenaltySeconds ( ) const

Returns the delay that is accrued due to option –meso-tls-penalty or –meso-minor-penalty.

Definition at line 369 of file MEVehicle.cpp.

References MESegment::getLinkPenalty(), mySegment, and STEPS2TIME.

Referenced by GUIMEVehicle::getParameterWindow().

◆ getCurrentRouteEdge()

const MSRouteIterator& MSBaseVehicle::getCurrentRouteEdge ( ) const
inlinevirtualinherited

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 MSBaseVehicle::myCurrEdge.

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

◆ getCurrentStoppingTimeSeconds()

double MEVehicle::getCurrentStoppingTimeSeconds ( ) const

Returns the delay that is accrued due to option –meso-tls-penalty or –meso-minor-penalty.

Definition at line 276 of file MEVehicle.cpp.

References getStoptime(), myLastEntryTime, mySegment, and STEPS2TIME.

Referenced by GUIMEVehicle::getParameterWindow(), and MSDevice_Tripinfo::notifyMoveInternal().

◆ getDepartDelay()

SUMOTime MSBaseVehicle::getDepartDelay ( ) const
inlinevirtualinherited

◆ getDepartPos()

double MSBaseVehicle::getDepartPos ( ) const
inlinevirtualinherited

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 MSBaseVehicle::myDepartPos.

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

◆ getDeparture()

SUMOTime MSBaseVehicle::getDeparture ( ) const
inlinevirtualinherited

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 MSBaseVehicle::myDeparture.

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

◆ getDevice()

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

◆ getDeviceParameter()

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

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 MSBaseVehicle::myDevices.

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

◆ getDevices()

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

Returns this vehicle's devices.

Returns
This vehicle's devices

Implements SUMOVehicle.

Definition at line 325 of file MSBaseVehicle.h.

References MSBaseVehicle::myDevices.

◆ getEdge()

◆ getEventTime()

SUMOTime MEVehicle::getEventTime ( ) const
inline

Returns the (planned) time at which the vehicle leaves his current cell.

Returns
The time the vehicle thinks he leaves his cell at

Definition at line 226 of file MEVehicle.h.

References myEventTime.

Referenced by MELoop::addLeaderCar(), MELoop::checkCar(), getEventTimeSeconds(), MESegment::isOpen(), MESegment::receive(), MELoop::removeLeaderCar(), MESegment::send(), MELoop::setApproaching(), MESegment::setSpeedForQueue(), MELoop::teleportVehicle(), updateDetectors(), and MELoop::vaporizeCar().

◆ getEventTimeSeconds()

double MEVehicle::getEventTimeSeconds ( ) const
inline

Returns the earliest leave time for the current segment.

Definition at line 313 of file MEVehicle.h.

References getEventTime(), and STEPS2TIME.

Referenced by GUIMEVehicle::getParameterWindow().

◆ getID()

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

Returns the name of the vehicle.

Implements SUMOTrafficObject.

Definition at line 137 of file MSBaseVehicle.cpp.

References SUMOVehicleParameter::id, and MSBaseVehicle::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(), MSBaseVehicle::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(), 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(), MSVehicle::getSafeFollowSpeed(), MSAbstractLaneChangeModel::getShadowLane(), MSBaseVehicle::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(), 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(), MSBaseVehicle::replaceRouteEdges(), MSBaseVehicle::reroute(), MSVehicle::rerouteParkingArea(), MSLane::resetManeuverReservation(), MSLane::resetPartialOccupation(), libsumo::Vehicle::resume(), MSLane::safeInsertionSpeed(), MSLCM_LC2013::saveBlockerLength(), MSLCM_SL2015::saveBlockerLength(), MSBaseVehicle::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()

MSLane* MEVehicle::getLane ( ) const
inlinevirtual

Returns the lane the vehicle is on.

Returns
The vehicle's current lane

Implements SUMOVehicle.

Definition at line 84 of file MEVehicle.h.

◆ getLastEntryTime()

SUMOTime MEVehicle::getLastEntryTime ( ) const
inline

Returns the time the vehicle entered the current segment.

Returns
The entry time

Definition at line 268 of file MEVehicle.h.

References myLastEntryTime.

Referenced by getLastEntryTimeSeconds(), MESegment::newArrival(), updateDetectorForWriting(), and updateDetectors().

◆ getLastEntryTimeSeconds()

double MEVehicle::getLastEntryTimeSeconds ( ) const
inline

Returns the entry time for the current segment.

Definition at line 318 of file MEVehicle.h.

References getLastEntryTime(), and STEPS2TIME.

Referenced by GUIMEVehicle::getParameterWindow().

◆ getLateralPositionOnLane()

virtual double MSBaseVehicle::getLateralPositionOnLane ( ) const
inlinevirtualinherited

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
virtualinherited

◆ getNextParkingArea()

MSParkingArea* MEVehicle::getNextParkingArea ( )
inlinevirtual

get the current parking area stop

Implements SUMOVehicle.

Definition at line 207 of file MEVehicle.h.

◆ getNumberReroutes()

int MSBaseVehicle::getNumberReroutes ( ) const
inlinevirtualinherited

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 MSBaseVehicle::myNumberReroutes.

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

◆ getNumericalID()

NumericalID MSBaseVehicle::getNumericalID ( ) const
inlinevirtualinherited

return the numerical ID which is only for internal usage

Implements SUMOVehicle.

Definition at line 470 of file MSBaseVehicle.h.

References MSBaseVehicle::myNumericalID.

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

◆ getParameter()

◆ getPersonDevice()

const MSDevice_Transportable* MSBaseVehicle::getPersonDevice ( ) const
inlineinherited

Definition at line 474 of file MSBaseVehicle.h.

References MSBaseVehicle::myPersonDevice.

Referenced by GUIBaseVehicle::getNumPassengers().

◆ getPersonIDList()

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

Returns the list of persons.

Returns
The list of passengers on-board

Implements SUMOVehicle.

Definition at line 589 of file MSBaseVehicle.cpp.

References MSBaseVehicle::getPersons().

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

◆ getPersonNumber()

int MSBaseVehicle::getPersonNumber ( ) const
virtualinherited

◆ getPersons()

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

◆ getPosition()

Position MEVehicle::getPosition ( const double  offset = 0) const
virtual

Return current position (x/y, cartesian)

If the vehicle's myLane is 0, Position::INVALID.

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

Implements SUMOTrafficObject.

Definition at line 100 of file MEVehicle.cpp.

References MSLane::geometryPositionAtOffset(), MSBaseVehicle::getEdge(), MSEdge::getLanes(), and getPositionOnLane().

Referenced by GUIMEVehicle::getPosition().

◆ getPositionOnLane()

double MEVehicle::getPositionOnLane ( ) const
virtual

Get the vehicle's position along the lane.

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

Implements SUMOTrafficObject.

Definition at line 78 of file MEVehicle.cpp.

References MESegment::getIndex(), MESegment::getLength(), and mySegment.

Referenced by getAngle(), getBackPositionOnLane(), GUIMEVehicle::getParameterWindow(), getPosition(), getSlope(), and hasArrived().

◆ getPreviousSpeed()

double MSBaseVehicle::getPreviousSpeed ( ) const
virtualinherited

Returns the vehicle's previous speed.

Returns
The vehicle's speed

Implements SUMOTrafficObject.

Reimplemented in MSVehicle.

Definition at line 68 of file MSBaseVehicle.cpp.

◆ getQueIndex()

int MEVehicle::getQueIndex ( ) const
inline

Returns the index of the que the vehicle is in.

Returns
The que index

Definition at line 252 of file MEVehicle.h.

References myQueIndex.

Referenced by MESegment::getLink(), MESegment::removeCar(), saveState(), and MESegment::send().

◆ getRerouteOrigin()

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

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 MSBaseVehicle::myCurrEdge.

Referenced by MSBaseVehicle::replaceRouteEdges(), and MSBaseVehicle::reroute().

◆ getRNG()

◆ getRoute()

◆ getSegment()

MESegment* MEVehicle::getSegment ( ) const
inline

Returns the current segment the vehicle is on.

Returns
The segment the vehicle is on

Definition at line 244 of file MEVehicle.h.

References mySegment.

Referenced by MELoop::changeSegment(), MELoop::checkCar(), GUIMEVehicle::getColorValue(), GUIMEVehicle::getSegmentIndex(), isOnRoad(), MESegment::loadState(), MELoop::setApproaching(), MELoop::teleportVehicle(), and MELoop::vaporizeCar().

◆ getSingularType()

MSVehicleType & MSBaseVehicle::getSingularType ( )
inherited

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(), MSBaseVehicle::getID(), MSVehicleType::getID(), MSVehicleType::isVehicleSpecific(), MSBaseVehicle::myType, and MSBaseVehicle::replaceVehicleType().

Referenced by TraCIServerAPI_Vehicle::processSet(), MSVehicle::setActionStepLength(), and MSDevice_ToC::setState().

◆ getSlope()

double MEVehicle::getSlope ( ) const
virtual

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

Returns
The slope

Reimplemented from MSBaseVehicle.

Definition at line 93 of file MEVehicle.cpp.

References MSBaseVehicle::getEdge(), MSEdge::getLanes(), getPositionOnLane(), MSLane::getShape(), MSLane::interpolateLanePosToGeometryPos(), and PositionVector::slopeDegreeAtOffset().

◆ getSpeed()

double MEVehicle::getSpeed ( ) const
virtual

Returns the vehicle's estimated speed assuming no delays.

Returns
The vehicle's estimated speed
Note
This is only an upper bound. The speed will be lower if the preceeding vehicle is delayed

Implements SUMOTrafficObject.

Definition at line 107 of file MEVehicle.cpp.

References getAverageSpeed(), and getWaitingTime().

Referenced by estimateLeaveSpeed(), GUIMEVehicle::getColorValue(), GUIMEVehicle::getParameterWindow(), MESegment::isOpen(), MESegment::newArrival(), MESegment::receive(), and MELoop::setApproaching().

◆ getStopEdges()

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

Returns the list of still pending stop edges.

Implements MSBaseVehicle.

Definition at line 282 of file MEVehicle.cpp.

References myStopEdges.

◆ getStopIndices()

std::vector< std::pair< int, double > > MEVehicle::getStopIndices ( ) const
virtual

return list of route indices for the remaining stops

Implements SUMOVehicle.

Definition at line 293 of file MEVehicle.cpp.

References MSRoute::begin(), MSRoute::end(), MSBaseVehicle::myCurrEdge, MSBaseVehicle::myRoute, and myStopEdges.

◆ getStoptime()

SUMOTime MEVehicle::getStoptime ( const MESegment *const  seg,
SUMOTime  time 
) const

Returns until when to stop at the given segment.

Parameters
[in]segThe segment in question
[in]timethe current time
Returns
stop time for the segment

Definition at line 260 of file MEVehicle.cpp.

References myStops.

Referenced by getCurrentStoppingTimeSeconds(), and MESegment::receive().

◆ getVClass()

◆ getVehicleType()

const MSVehicleType& MSBaseVehicle::getVehicleType ( ) const
inlinevirtualinherited

Returns the vehicle's type definition.

Returns
The vehicle's type definition

Implements SUMOTrafficObject.

Definition at line 118 of file MSBaseVehicle.h.

References MSBaseVehicle::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(), estimateLeaveSpeed(), MSVehicle::estimateLeaveSpeed(), MSLane::executeMovements(), MSLane::freeInsertion(), MSVehicle::Influencer::gapControlSpeed(), getBackPositionOnLane(), MSLane::getBruttoOccupancy(), GUIBaseVehicle::getCenteringBoundary(), MSLaneChanger::getColumnleader(), MSLane::getCriticalLeader(), MSEdge::getDepartLane(), MSEdge::getDepartPosBound(), MSLane::getDepartPosLat(), libsumo::Vehicle::getDrivingDistance2D(), MSLane::getFollower(), MSLane::getFollowersOnConsecutive(), MSBaseVehicle::getImpatience(), MSVehicle::getLateralOverlap(), MSLane::getLeader(), MSVehicle::getLeader(), MSLink::getLeaderInfo(), MSLane::getLeaderOnConsecutive(), MSLaneChangerSublane::getLeaders(), MSLane::getLeadersOnConsecutive(), GUIVehicle::getLeftSideOnEdge(), 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(), libsumo::Helper::getVehicleType(), GUIBaseVehicle::getVType(), MSLCM_SL2015::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(), MSBaseVehicle::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().

◆ getWaitingSeconds()

double MEVehicle::getWaitingSeconds ( ) const
inline

Returns the number of seconds waited (speed was lesser than 0.1m/s)

The value is reset if the vehicle moves faster than 0.1m/s Intentional stopping does not count towards this time.

Returns
The time the vehicle is standing

Definition at line 307 of file MEVehicle.h.

References getWaitingTime(), and STEPS2TIME.

Referenced by GUIMEVehicle::getColorValue(), and GUIMEVehicle::getParameterWindow().

◆ getWaitingTime()

SUMOTime MEVehicle::getWaitingTime ( ) const
inlinevirtual

Returns the duration for which the vehicle was blocked.

Implements SUMOTrafficObject.

Definition at line 291 of file MEVehicle.h.

References MAX2(), myBlockTime, and myEventTime.

Referenced by MELoop::checkCar(), getAccumulatedWaitingTime(), getSpeed(), getWaitingSeconds(), MESegment::isOpen(), and MELoop::setApproaching().

◆ getWidth()

◆ hasArrived()

bool MEVehicle::hasArrived ( ) const
virtual

Returns whether this vehicle has already arived (reached the arrivalPosition on its final edge)

Reimplemented from MSBaseVehicle.

Definition at line 157 of file MEVehicle.cpp.

References MSRoute::end(), getPositionOnLane(), MSBaseVehicle::myArrivalPos, MSBaseVehicle::myCurrEdge, myEventTime, MSBaseVehicle::myRoute, mySegment, POSITION_EPS, and SUMOTime_MIN.

Referenced by moveRoutePointer(), and MESegment::receive().

◆ hasDeparted()

bool MSBaseVehicle::hasDeparted ( ) const
virtualinherited

◆ hasDevice()

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

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

Definition at line 639 of file MSBaseVehicle.cpp.

References MSBaseVehicle::myDevices.

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

◆ hasValidRoute()

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

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(), MSBaseVehicle::myCurrEdge, MSBaseVehicle::myRoute, and MSBaseVehicle::myType.

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

◆ isFrontOnLane()

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

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

bool MEVehicle::isOnRoad ( ) const
virtual

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

Returns
Whether the vehicle is simulated

Reimplemented from MSBaseVehicle.

Definition at line 166 of file MEVehicle.cpp.

References getSegment().

◆ isParking()

bool MEVehicle::isParking ( ) const
virtual

Returns whether the vehicle is parking.

Returns
whether the vehicle is parking

Implements SUMOVehicle.

Definition at line 172 of file MEVehicle.cpp.

Referenced by GUIMEVehicle::getStopInfo().

◆ isRemoteControlled()

virtual bool MSBaseVehicle::isRemoteControlled ( ) const
inlinevirtualinherited

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
inlinevirtualinherited

whether this vehicle is selected in the GUI

Implements SUMOVehicle.

Reimplemented in GUIVehicle.

Definition at line 463 of file MSBaseVehicle.h.

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

◆ isStopped()

bool MEVehicle::isStopped ( ) const
virtual

Returns whether the vehicle is at a stop.

Returns
Whether it has stopped

Implements SUMOTrafficObject.

Definition at line 242 of file MEVehicle.cpp.

References mySegment, and myStops.

Referenced by GUIMEVehicle::getStopInfo(), isStoppedInRange(), processStop(), MESegment::receive(), and MESegment::send().

◆ isStoppedInRange()

bool MEVehicle::isStoppedInRange ( const double  pos,
const double  tolerance 
) const
virtual

return whether the given position is within range of the current stop

Implements SUMOVehicle.

Definition at line 254 of file MEVehicle.cpp.

References isStopped().

◆ isStoppedTriggered()

bool MEVehicle::isStoppedTriggered ( ) const
virtual

Returns whether the vehicle is on a triggered stop.

Returns
whether the vehicle is on a triggered stop

Implements SUMOVehicle.

Definition at line 248 of file MEVehicle.cpp.

◆ isVehicle()

bool MSBaseVehicle::isVehicle ( ) const
inlinevirtualinherited

Get the vehicle's ID.

Returns
The the ID of the vehicle

Implements SUMOTrafficObject.

Definition at line 79 of file MSBaseVehicle.h.

◆ loadState()

◆ mayProceed()

bool MEVehicle::mayProceed ( ) const

Returns whether the vehicle is allowed to pass the next junction.

Returns
true iff the vehicle may drive over the next junction

Definition at line 363 of file MEVehicle.cpp.

References MESegment::isOpen(), and mySegment.

Referenced by MELoop::changeSegment(), and MELoop::checkCar().

◆ moveRoutePointer()

bool MEVehicle::moveRoutePointer ( )

Update when the vehicle enters a new edge in the move step.

Returns
Whether the vehicle's route has ended (due to vaporization, or because the destination was reached)

Definition at line 139 of file MEVehicle.cpp.

References MSRoute::end(), hasArrived(), MSBaseVehicle::myCurrEdge, MSBaseVehicle::myParameter, MSBaseVehicle::myRoute, and SUMOVehicleParameter::via.

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

◆ onDepart()

void MSBaseVehicle::onDepart ( )
virtualinherited

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(), MSBaseVehicle::myDepartPos, MSBaseVehicle::myDeparture, and MSVehicleControl::vehicleDeparted().

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

◆ processStop()

◆ remainingStopDuration()

SUMOTime MEVehicle::remainingStopDuration ( ) const
inlinevirtual

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

Implements SUMOVehicle.

Definition at line 158 of file MEVehicle.h.

◆ removeReminder()

void MSBaseVehicle::removeReminder ( MSMoveReminder rem)
inherited

Removes a MoveReminder dynamically.

Parameters
[in]remthe reminder to remove
See also
MSMoveReminder

Definition at line 442 of file MSBaseVehicle.cpp.

References MSBaseVehicle::myMoveReminders.

◆ removeTransportable()

void MSBaseVehicle::removeTransportable ( MSTransportable t)
virtualinherited

removes a person or container

Implements SUMOVehicle.

Definition at line 606 of file MSBaseVehicle.cpp.

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

◆ replaceParameter()

void MSBaseVehicle::replaceParameter ( const SUMOVehicleParameter newParameter)
virtualinherited

replace the vehicle parameter (deleting the old one)

Implements SUMOVehicle.

Definition at line 148 of file MSBaseVehicle.cpp.

References MSBaseVehicle::myParameter.

Referenced by MSVehicle::rerouteParkingArea().

◆ replaceParkingArea()

bool MEVehicle::replaceParkingArea ( MSParkingArea ,
std::string &   
)
inlinevirtual

replace the current parking area stop with a new stop with merge duration

Implements SUMOVehicle.

Definition at line 201 of file MEVehicle.h.

◆ replaceRoute()

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

◆ replaceRouteEdges()

bool MSBaseVehicle::replaceRouteEdges ( ConstMSEdgeVector edges,
double  cost,
double  savings,
const std::string &  info,
bool  onInit = false,
bool  check = false,
bool  removeStops = true 
)
virtualinherited

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(), MSBaseVehicle::getID(), MSBaseVehicle::getNumberReroutes(), MSBaseVehicle::getRerouteOrigin(), MSBaseVehicle::hasValidRoute(), MSBaseVehicle::myCurrEdge, MSBaseVehicle::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(), MSVehicle::Influencer::postProcessRemoteControl(), MSBaseVehicle::reroute(), GUIVehicle::rerouteDRTStop(), MSVehicle::rerouteParkingArea(), and libsumo::Vehicle::setRoute().

◆ replaceVehicleType()

void MSBaseVehicle::replaceVehicleType ( MSVehicleType type)
inherited

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(), MSBaseVehicle::myType, and MSVehicleControl::removeVType().

Referenced by MSBaseVehicle::getSingularType(), 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 
)
virtualinherited

◆ saveState()

◆ setArrivalPos()

virtual void MSBaseVehicle::setArrivalPos ( double  arrivalPos)
inlinevirtualinherited

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

Implements SUMOVehicle.

Definition at line 283 of file MSBaseVehicle.h.

References MSBaseVehicle::myArrivalPos.

◆ setBlockTime()

void MEVehicle::setBlockTime ( const SUMOTime  t)
inline

Sets the time at which the vehicle was blocked.

Parameters
[in]tThe blocking time

Definition at line 276 of file MEVehicle.h.

References myBlockTime, and myLastEntryTime.

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

◆ setChosenSpeedFactor()

void MSBaseVehicle::setChosenSpeedFactor ( const double  factor)
inlinevirtualinherited

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 MSBaseVehicle::myChosenSpeedFactor.

Referenced by MSCFModel_CC::finalizeSpeed().

◆ setDeviceParameter()

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

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 MSBaseVehicle::myDevices.

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

◆ setEventTime()

void MEVehicle::setEventTime ( SUMOTime  t,
bool  hasDelay = true 
)
inline

Sets the (planned) time at which the vehicle leaves his current cell.

Parameters
[in]tThe leaving time

Definition at line 214 of file MEVehicle.h.

References MESegment::getEdge(), MSEdge::markDelayed(), myEventTime, myLastEntryTime, and mySegment.

Referenced by MELoop::checkCar(), METriggeredCalibrator::execute(), MESegment::receive(), MESegment::send(), MESegment::setSpeedForQueue(), and MELoop::teleportVehicle().

◆ setLastEntryTime()

void MEVehicle::setLastEntryTime ( SUMOTime  t)
inline

Sets the entry time for the current segment.

Parameters
[in]tThe entry time

Definition at line 260 of file MEVehicle.h.

References myLastEntryTime.

Referenced by MESegment::receive().

◆ setSegment()

virtual void MEVehicle::setSegment ( MESegment s,
int  idx = 0 
)
inlinevirtual

Sets the current segment the vehicle is at together with its que.

Parameters
[in]sThe current segment
[in]qThe current que

Definition at line 235 of file MEVehicle.h.

References myQueIndex, and mySegment.

Referenced by MELoop::changeSegment(), METriggeredCalibrator::execute(), loadState(), MESegment::receive(), and MELoop::teleportVehicle().

◆ stopsAt()

bool MEVehicle::stopsAt ( MSStoppingPlace ) const
inlinevirtual

Returns whether the vehicle stops at the given stopping place.

Implements SUMOVehicle.

Definition at line 175 of file MEVehicle.h.

◆ succEdge()

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

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

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

◆ updateDetectorForWriting()

void MEVehicle::updateDetectorForWriting ( MSMoveReminder rem,
SUMOTime  currentTime,
SUMOTime  exitTime 
)

Updates a single vehicle detector if present.

Definition at line 379 of file MEVehicle.cpp.

References MESegment::getIndex(), getLastEntryTime(), MESegment::getLength(), MSBaseVehicle::myMoveReminders, mySegment, and MSMoveReminder::updateDetector().

◆ updateDetectors()

void MEVehicle::updateDetectors ( SUMOTime  currentTime,
const bool  isLeave,
const MSMoveReminder::Notification  reason = MSMoveReminder::NOTIFICATION_JUNCTION 
)

◆ wasRemoteControlled()

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

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.

Field Documentation

◆ myArrivalLane

int MSBaseVehicle::myArrivalLane
protectedinherited

The destination lane where the vehicle stops.

Definition at line 541 of file MSBaseVehicle.h.

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

◆ myArrivalPos

double MSBaseVehicle::myArrivalPos
protectedinherited

◆ myBlockTime

SUMOTime MEVehicle::myBlockTime
protected

The time at which the vehicle was blocked on its current segment.

Definition at line 376 of file MEVehicle.h.

Referenced by getBlockTime(), getWaitingTime(), loadState(), saveState(), and setBlockTime().

◆ myChosenSpeedFactor

double MSBaseVehicle::myChosenSpeedFactor
protectedinherited

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 MSBaseVehicle::getChosenSpeedFactor(), MSBaseVehicle::saveState(), and MSBaseVehicle::setChosenSpeedFactor().

◆ myContainerDevice

◆ myCurrEdge

◆ myCurrentNumericalIndex

SUMOVehicle::NumericalID MSBaseVehicle::myCurrentNumericalIndex = 0
staticprivateinherited

Definition at line 556 of file MSBaseVehicle.h.

◆ myDepartPos

double MSBaseVehicle::myDepartPos
protectedinherited

◆ myDeparture

◆ myDevices

◆ myEmptyTransportableVector

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

Definition at line 551 of file MSBaseVehicle.h.

Referenced by MSBaseVehicle::getContainers(), and MSBaseVehicle::getPersons().

◆ myEventTime

SUMOTime MEVehicle::myEventTime
protected

The (planned) time of leaving the segment (cell)

Definition at line 370 of file MEVehicle.h.

Referenced by getAverageSpeed(), getConservativeSpeed(), getEventTime(), getWaitingTime(), hasArrived(), loadState(), saveState(), and setEventTime().

◆ myLastEntryTime

SUMOTime MEVehicle::myLastEntryTime
protected

◆ myMoveReminders

◆ myNumberReroutes

int MSBaseVehicle::myNumberReroutes
protectedinherited

The number of reroutings.

Definition at line 544 of file MSBaseVehicle.h.

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

◆ myNumericalID

const NumericalID MSBaseVehicle::myNumericalID
privateinherited

Definition at line 554 of file MSBaseVehicle.h.

Referenced by MSBaseVehicle::getNumericalID().

◆ myParameter

◆ myPersonDevice

◆ myQueIndex

int MEVehicle::myQueIndex
protected

Index of the que the vehicle is in (important for multiqueue extension)

Definition at line 367 of file MEVehicle.h.

Referenced by getQueIndex(), and setSegment().

◆ myRoute

◆ mySegment

◆ myStopEdges

ConstMSEdgeVector MEVehicle::myStopEdges
protected

edges to stop

Definition at line 382 of file MEVehicle.h.

Referenced by addStop(), getStopEdges(), getStopIndices(), and processStop().

◆ myStops

std::map<const MESegment* const, std::vector<SUMOVehicleParameter::Stop> > MEVehicle::myStops
protected

where to stop

Definition at line 379 of file MEVehicle.h.

Referenced by addStop(), getStoptime(), isStopped(), processStop(), and saveState().

◆ myType

◆ NOT_YET_DEPARTED

const SUMOTime MSBaseVehicle::NOT_YET_DEPARTED = SUMOTime_MAX
staticprotectedinherited

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