![]() |
SUMO - Simulation of Urban MObility
|
The base class for microscopic and mesoscopic vehicles. More...
#include <MSBaseVehicle.h>
Public Types | |
typedef Named::NamedLikeComparatorIdLess< SUMOVehicle > | ComparatorIdLess |
Public Member Functions | |
virtual void | activateReminders (const MSMoveReminder::Notification reason) |
"Activates" all current move reminder More... | |
virtual void | addContainer (MSTransportable *container) |
Adds a container to this vehicle. More... | |
virtual void | addPerson (MSTransportable *person) |
Adds a person to this vehicle. More... | |
void | addReminder (MSMoveReminder *rem) |
Adds a MoveReminder dynamically. More... | |
virtual bool | addStop (const SUMOVehicleParameter::Stop &stopPar, std::string &errorMsg, SUMOTime untilOffset=0)=0 |
Adds a stop. More... | |
void | addStops (const bool ignoreStopErrors) |
Adds stops to the built vehicle. More... | |
virtual SUMOReal | getAcceleration () const |
Returns the vehicle's acceleration. More... | |
virtual SUMOReal | getAngle () const =0 |
Get the vehicle's angle. More... | |
virtual SUMOReal | getArrivalPos () const |
Returns this vehicle's desired arrivalPos for its current route (may change on reroute) More... | |
virtual SUMOReal | getBackPositionOnLane (const MSLane *lane) const =0 |
Get the vehicle's back position along the given lane. More... | |
SUMOReal | getChosenSpeedFactor () const |
Returns the precomputed factor by which the driver wants to be faster than the speed limit. More... | |
const MSRouteIterator & | getCurrentRouteEdge () const |
Returns an iterator pointing to the current edge in this vehicles route. More... | |
SUMOTime | getDepartDelay () const |
Returns the depart delay. More... | |
SUMOReal | getDepartPos () const |
Returns this vehicle's real departure position. More... | |
SUMOTime | getDeparture () const |
Returns this vehicle's real departure time. More... | |
MSDevice * | getDevice (const std::type_info &type) const |
Returns a device of the given type if it exists or 0. More... | |
const std::vector< MSDevice * > & | getDevices () const |
Returns this vehicle's devices. More... | |
const MSEdge * | getEdge () const |
Returns the edge the vehicle is currently at. More... | |
const std::string & | getID () const |
Returns the name of the vehicle. More... | |
SUMOReal | getImpatience () const |
Returns this vehicles impatience. More... | |
virtual MSLane * | getLane () const =0 |
Returns the lane the vehicle is on. More... | |
virtual SUMOReal | getLateralPositionOnLane () const |
Get the vehicle's lateral position on the lane. More... | |
SUMOReal | getMaxSpeed () const |
Returns the maximum speed. More... | |
int | getNumberReroutes () const |
Returns the number of new routes this vehicle got. More... | |
const SUMOVehicleParameter & | getParameter () const |
Returns the vehicle's parameter (including departure definition) More... | |
virtual Position | getPosition (const SUMOReal offset=0) const =0 |
Return current position (x/y, cartesian) More... | |
virtual SUMOReal | getPositionOnLane () const =0 |
Get the vehicle's position along the lane. More... | |
virtual const MSEdge * | getRerouteOrigin () const |
Returns the starting point for reroutes (usually the current edge) More... | |
const MSRoute & | getRoute () const |
Returns the current route. More... | |
virtual SUMOReal | getSlope () const |
Returns the slope of the road at vehicle's position. More... | |
virtual SUMOReal | getSpeed () const =0 |
Returns the vehicle's current speed. More... | |
SUMOVehicleClass | getVClass () const |
Returns the vehicle's access class. More... | |
const MSVehicleType & | getVehicleType () const |
Returns the vehicle's type definition. More... | |
virtual SUMOTime | getWaitingTime () const =0 |
virtual bool | hasArrived () const |
Returns whether this vehicle has already arived (by default this is true if the vehicle has reached its final edge) More... | |
bool | hasDeparted () const |
Returns whether this vehicle has already departed. More... | |
bool | hasValidRoute (std::string &msg, const MSRoute *route=0) const |
Validates the current or given route. More... | |
virtual bool | isFrontOnLane (const MSLane *) const |
Returns the information whether the front of the vehhicle is on the given lane. More... | |
virtual bool | isOnRoad () const |
Returns the information whether the vehicle is on a road (is simulated) More... | |
virtual bool | isParking () const =0 |
Returns the information whether the vehicle is parked. More... | |
virtual bool | isRemoteControlled () const |
Returns the information whether the vehicle is fully controlled via TraCI. More... | |
virtual bool | isStopped () const =0 |
Returns whether the vehicle is at a stop. More... | |
virtual bool | isStoppedTriggered () const =0 |
Returns whether the vehicle is at a stop and waiting for a person or container to continue. More... | |
MSBaseVehicle (SUMOVehicleParameter *pars, const MSRoute *route, const MSVehicleType *type, const SUMOReal speedFactor) | |
Constructor. More... | |
void | onDepart () |
Called when the vehicle is inserted into the network. More... | |
void | removeReminder (MSMoveReminder *rem) |
Removes a MoveReminder dynamically. More... | |
virtual bool | replaceRoute (const MSRoute *route, bool onInit=false, int offset=0)=0 |
Replaces the current route by the given one. More... | |
bool | replaceRouteEdges (ConstMSEdgeVector &edges, bool onInit=false, bool check=false) |
Replaces the current route by the given edges. More... | |
void | reroute (SUMOTime t, SUMOAbstractRouter< MSEdge, SUMOVehicle > &router, const bool onInit=false, const bool withTaz=false) |
Performs a rerouting using the given router. More... | |
virtual void | setArrivalPos (SUMOReal arrivalPos) |
Sets this vehicle's desired arrivalPos for its current route. More... | |
void | setChosenSpeedFactor (const SUMOReal factor) |
Returns the precomputed factor by which the driver wants to be faster than the speed limit. More... | |
const MSEdge * | succEdge (int nSuccs) const |
Returns the nSuccs'th successor of edge the vehicle is currently at. More... | |
virtual | ~MSBaseVehicle () |
Destructor. More... | |
state io | |
virtual void | saveState (OutputDevice &out) |
Saves the (common) state of a vehicle. More... | |
state io | |
virtual void | loadState (const SUMOSAXAttributes &attrs, const SUMOTime offset)=0 |
Loads the state of this vehicle from the given description. More... | |
Protected Member Functions | |
void | calculateArrivalParams () |
(Re-)Calculates the arrival position and lane from the vehicle parameters More... | |
virtual const ConstMSEdgeVector | getStopEdges () const =0 |
Returns the list of still pending stop edges. More... | |
Protected Attributes | |
int | myArrivalLane |
The destination lane where the vehicle stops. More... | |
SUMOReal | myArrivalPos |
The position on the destination lane where the vehicle stops. More... | |
SUMOReal | myChosenSpeedFactor |
A precomputed factor by which the driver wants to be faster than the speed limit. More... | |
MSRouteIterator | myCurrEdge |
Iterator to current route-edge. More... | |
SUMOReal | myDepartPos |
The real depart position. More... | |
SUMOTime | myDeparture |
The real departure time. More... | |
std::vector< MSDevice * > | myDevices |
The devices this vehicle has. More... | |
int | myNumberReroutes |
The number of reroutings. More... | |
const SUMOVehicleParameter * | myParameter |
This Vehicle's parameter. More... | |
const MSRoute * | myRoute |
This Vehicle's route. More... | |
const MSVehicleType * | myType |
This Vehicle's type. More... | |
Static Protected Attributes | |
static const SUMOTime | NOT_YET_DEPARTED = SUMOTime_MAX |
Private Member Functions | |
MSBaseVehicle & | operator= (const MSBaseVehicle &s) |
invalidated assignment operator More... | |
Friends | |
class | GUIBaseVehicle |
Move reminder structures | |
typedef std::vector< std::pair< MSMoveReminder *, SUMOReal > > | MoveReminderCont |
Definition of a move reminder container. More... | |
MoveReminderCont | myMoveReminders |
Current lane's move reminder. More... | |
The base class for microscopic and mesoscopic vehicles.
Definition at line 56 of file MSBaseVehicle.h.
|
inherited |
Definition at line 68 of file SUMOVehicle.h.
|
protected |
Definition of a move reminder container.
Definition at line 403 of file MSBaseVehicle.h.
MSBaseVehicle::MSBaseVehicle | ( | SUMOVehicleParameter * | pars, |
const MSRoute * | route, | ||
const MSVehicleType * | type, | ||
const SUMOReal | speedFactor | ||
) |
Constructor.
[in] | pars | The vehicle description |
[in] | route | The vehicle's route |
[in] | type | The vehicle's type |
[in] | speedFactor | The factor for driven lane's speed limits |
ProcessError | If a value is wrong |
Definition at line 63 of file MSBaseVehicle.cpp.
References MSRoute::addReference(), MSDevice::buildVehicleDevices(), calculateArrivalParams(), myDevices, myMoveReminders, myRoute, VEHPARS_FORCE_REROUTE, and SUMOVehicleParameter::wasSet().
|
virtual |
Destructor.
Definition at line 92 of file MSBaseVehicle.cpp.
References MSRoute::checkDist(), myDevices, myParameter, myRoute, MSRoute::release(), SUMOVehicleParameter::repetitionNumber, and SUMOVehicleParameter::routeid.
|
virtual |
"Activates" all current move reminder
For all move reminder stored in "myMoveReminders", their method "MSMoveReminder::notifyEnter" is called.
[in] | reason | The reason for changing the reminders' states |
Reimplemented in MSVehicle.
Definition at line 339 of file MSBaseVehicle.cpp.
References myMoveReminders.
Referenced by getDevices(), MESegment::receive(), and MELoop::teleportVehicle().
|
virtual |
Adds a container to this vehicle.
The default implementation does nothing since containers are not supported by default
[in] | container | The container to add |
Implements SUMOVehicle.
Reimplemented in MSVehicle.
Definition at line 280 of file MSBaseVehicle.cpp.
Referenced by getDevices().
|
virtual |
Adds a person to this vehicle.
The default implementation does nothing since persons are not supported by default
[in] | person | The person to add |
Implements SUMOVehicle.
Reimplemented in MSVehicle.
Definition at line 276 of file MSBaseVehicle.cpp.
Referenced by getDevices().
void MSBaseVehicle::addReminder | ( | MSMoveReminder * | rem | ) |
Adds a MoveReminder dynamically.
[in] | rem | the reminder to add |
Definition at line 312 of file MSBaseVehicle.cpp.
References myMoveReminders.
Referenced by MSVehicle::adaptLaneEntering2MoveReminder(), MESegment::addReminders(), MSVehicle::enterLaneAtInsertion(), MSVehicle::enterLaneAtLaneChange(), and getDevices().
|
pure virtualinherited |
Adds a stop.
The stop is put into the sorted list.
[in] | stop | The stop to add |
Implemented in MSVehicle, and MEVehicle.
Referenced by addStops(), and SUMOVehicle::~SUMOVehicle().
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
[in] | ignoreStopErrors | whether invalid stops trigger a warning only |
Definition at line 431 of file MSBaseVehicle.cpp.
References SUMOVehicle::addStop(), OutputDevice::closeTag(), MSMoveReminder::getDescription(), OutputDevice::getDeviceByOption(), getID(), MSNet::getInstance(), MSRoute::getStops(), OptionsCont::getStringVector(), OptionsCont::isSet(), myParameter, myRoute, OutputDevice::openTag(), STEPS2TIME, SUMOVehicleParameter::stops, SUMO_ATTR_ID, SUMO_ATTR_TIME, SUMOReal, toString(), WRITE_WARNING, and OutputDevice::writeAttr().
Referenced by MEVehicleControl::buildVehicle(), GUIMEVehicleControl::buildVehicle(), GUIVehicleControl::buildVehicle(), MSVehicleControl::buildVehicle(), and setChosenSpeedFactor().
|
protected |
(Re-)Calculates the arrival position and lane from the vehicle parameters
Definition at line 361 of file MSBaseVehicle.cpp.
References ARRIVAL_LANE_GIVEN, ARRIVAL_POS_GIVEN, ARRIVAL_POS_RANDOM, ARRIVAL_SPEED_GIVEN, SUMOVehicleParameter::arrivalLane, SUMOVehicleParameter::arrivalLaneProcedure, SUMOVehicleParameter::arrivalPos, SUMOVehicleParameter::arrivalPosProcedure, SUMOVehicleParameter::arrivalSpeed, SUMOVehicleParameter::arrivalSpeedProcedure, Named::getID(), getID(), MSEdge::getLanes(), MSRoute::getLastEdge(), MSVehicleType::getVehicleClass(), MAX2(), MIN2(), myArrivalLane, myArrivalPos, myParameter, myRoute, myType, RandHelper::rand(), SUMOReal, toString(), and WRITE_WARNING.
Referenced by MSBaseVehicle(), MSVehicle::replaceRoute(), MEVehicle::replaceRoute(), replaceRouteEdges(), and setChosenSpeedFactor().
|
virtual |
Returns the vehicle's acceleration.
This default implementation returns always 0.
Implements SUMOVehicle.
Reimplemented in MSVehicle.
Definition at line 245 of file MSBaseVehicle.cpp.
References SUMOReal.
Referenced by getCurrentRouteEdge().
|
pure virtualinherited |
Get the vehicle's angle.
Implemented in MSVehicle, GUIMEVehicle, GUIVehicle, and MEVehicle.
Referenced by MSDevice_Battery::getPropEnergy(), MSDevice_Battery::notifyMove(), MSEmissionExport::write(), MSFCDExport::write(), MSFullExport::writeVehicles(), and SUMOVehicle::~SUMOVehicle().
|
inlinevirtual |
Returns this vehicle's desired arrivalPos for its current route (may change on reroute)
Implements SUMOVehicle.
Definition at line 250 of file MSBaseVehicle.h.
References myArrivalPos.
|
pure virtualinherited |
Get the vehicle's back position along the given lane.
Implemented in MSVehicle, and MEVehicle.
Referenced by MSE2Collector::notifyEnter(), and SUMOVehicle::~SUMOVehicle().
|
inlinevirtual |
Returns the precomputed factor by which the driver wants to be faster than the speed limit.
Implements SUMOVehicle.
Definition at line 340 of file MSBaseVehicle.h.
References myChosenSpeedFactor.
Referenced by GUIMEVehicle::getParameterWindow(), GUIVehicle::getParameterWindow(), and TraCIServerAPI_Vehicle::processGet().
|
inlinevirtual |
Returns an iterator pointing to the current edge in this vehicles route.
Implements SUMOVehicle.
Definition at line 174 of file MSBaseVehicle.h.
References getAcceleration(), getSlope(), myCurrEdge, onDepart(), replaceRouteEdges(), reroute(), and SUMOReal.
Referenced by TraCIServerAPI_Vehicle::vtdMap_matchingRoutePosition().
|
inlinevirtual |
Returns the depart delay.
Implements SUMOVehicle.
Definition at line 234 of file MSBaseVehicle.h.
References SUMOVehicleParameter::depart, getDeparture(), and getParameter().
Referenced by GUIMEVehicle::getColorValue(), GUIVehicle::getColorValue(), GUIMEVehicle::getParameterWindow(), and GUIVehicle::getParameterWindow().
|
inlinevirtual |
Returns this vehicle's real departure position.
Implements SUMOVehicle.
Definition at line 242 of file MSBaseVehicle.h.
References myDepartPos.
Referenced by TraCIServerAPI_Vehicle::processGet().
|
inlinevirtual |
Returns this vehicle's real departure time.
Implements SUMOVehicle.
Definition at line 229 of file MSBaseVehicle.h.
References myDeparture.
Referenced by getDepartDelay().
|
virtual |
Returns a device of the given type if it exists or 0.
Implements SUMOVehicle.
Definition at line 409 of file MSBaseVehicle.cpp.
References myDevices.
Referenced by GUIBaseVehicle::drawOnPos(), setChosenSpeedFactor(), and MSBatteryExport::write().
|
inlinevirtual |
Returns this vehicle's devices.
Implements SUMOVehicle.
Definition at line 283 of file MSBaseVehicle.h.
References activateReminders(), addContainer(), addPerson(), addReminder(), hasValidRoute(), myDevices, and removeReminder().
|
virtual |
Returns the edge the vehicle is currently at.
Implements SUMOVehicle.
Definition at line 133 of file MSBaseVehicle.cpp.
References myCurrEdge.
Referenced by MSVehicleTransfer::add(), MELoop::changeSegment(), GUIApplicationWindow::checkGamingEvents(), MSVehicleTransfer::checkInsertions(), TraCIServerAPI_Vehicle::commandDistanceRequest(), MSVehicle::enterLaneAtLaneChange(), METriggeredCalibrator::execute(), MEVehicle::getAngle(), GUIMEVehicle::getParameterWindow(), MEVehicle::getPosition(), MEVehicle::getSlope(), getVClass(), TraCIServerAPI_Vehicle::processSet(), MESegment::receive(), MELoop::teleportVehicle(), and TraCIServerAPI_Vehicle::vtdMap().
|
virtual |
Returns the name of the vehicle.
Implements SUMOVehicle.
Definition at line 105 of file MSBaseVehicle.cpp.
References SUMOVehicleParameter::id, and myParameter.
Referenced by MSLCM_JE2013::_patchSpeed(), MSLCM_SL2015::_patchSpeed(), MSLCM_LC2013::_patchSpeed(), MSLCM_JE2013::_wantsChange(), MSLCM_LC2013::_wantsChange(), MSLCM_SL2015::_wantsChangeSublane(), MSVehicle::adaptToLeader(), MSVehicle::adaptToLeaders(), MSVehicleTransfer::add(), addStops(), MSVehicle::addTraciBusOrContainerStop(), calculateArrivalParams(), MSLaneChangerSublane::change(), MSLaneChanger::change(), MSLCM_SL2015::changed(), MSLaneChanger::changeOpposite(), MELoop::changeSegment(), MSLaneChanger::checkChange(), MSLaneChangerSublane::checkChangeSublane(), MSLane::checkFailure(), MSVehicleTransfer::checkInsertions(), MSVehicle::checkRewindLinkLanes(), MSLCM_SL2015::checkStrategicChange(), MSAbstractLaneChangeModel::cleanupShadowLane(), MSVehicle::computeAngle(), MSLaneChanger::continueChange(), MSLCM_SL2015::decideDirection(), GUIVehicle::drawOutsideNetwork(), MSCalibrator::execute(), MSVehicle::executeMove(), MSLane::executeMovements(), MSVehicle::getBackPosition(), MSVehicle::getBackPositionOnLane(), MSVehicle::getCenterOnEdge(), MSE2Collector::getCurrentVehicleIDs(), MSE2Collector::getEstimateQueueLength(), MSLane::getFirstVehicleInformation(), MSLane::getFollower(), MSLane::getFollowersOnConsecutive(), MSLane::getLastVehicleInformation(), MSVehicle::getLatOffset(), MSLane::getLeader(), MSLane::getLeaderOnConsecutive(), MSLaneChangerSublane::getLeaders(), MSLane::getLeadersOnConsecutive(), MSLane::getOppositeFollower(), MSLane::getOppositeLeader(), GUIMEVehicle::getParameterWindow(), GUIVehicle::getParameterWindow(), MSLane::getPartialBehind(), MSAbstractLaneChangeModel::getShadowLane(), MSLane::handleCollisionBetween(), MSLCM_SL2015::inform(), MSLCM_JE2013::inform(), MSLCM_LC2013::inform(), MSLCM_JE2013::informFollower(), MSLCM_LC2013::informFollower(), MSLCM_SL2015::informFollower(), MSLCM_JE2013::informLeader(), MSLCM_LC2013::informLeader(), MSLCM_SL2015::informLeader(), MESegment::initialise(), MSPedestrianPushButton::isActiveForEdge(), MSLane::isInsertionSuccess(), MSVehicle::leaveLane(), MSCFModel_Daniel1::moveHelper(), MSCFModel_SmartSK::moveHelper(), MSLCM_JE2013::MSLCM_JE2013(), MSLCM_LC2013::MSLCM_LC2013(), MSCalibrator::VehicleRemover::notifyEnter(), MSLCM_DK2008::patchSpeed(), MSLCM_SL2015::patchSpeed(), MSLCM_JE2013::patchSpeed(), MSLCM_LC2013::patchSpeed(), MSVehicle::planMove(), MSVehicle::planMoveInternal(), MSAbstractLaneChangeModel::primaryLaneChanged(), MSVehicle::processNextStop(), TraCIServerAPI_Vehicle::processSet(), replaceRouteEdges(), reroute(), MSLane::resetPartialOccupation(), MSLCM_JE2013::saveBlockerLength(), MSLCM_LC2013::saveBlockerLength(), MSLCM_SL2015::saveBlockerLength(), MSCalibrator::scheduleRemoval(), MSLane::setPartialOccupation(), TraCIServer::setVTDControlled(), MSLCM_JE2013::slowDownForBlocked(), MSLCM_LC2013::slowDownForBlocked(), MSLCM_SL2015::slowDownForBlocked(), MELoop::teleportVehicle(), METriggeredCalibrator::tryEmit(), MSVehicle::updateBestLanes(), MSLCM_SL2015::updateGaps(), MSAbstractLaneChangeModel::updateShadowLane(), MSLCM_JE2013::wantsChange(), MSLCM_LC2013::wantsChange(), MSLCM_SL2015::wantsChangeSublane(), MSLCM_DK2008::wantsChangeToLeft(), MSLCM_DK2008::wantsChangeToRight(), MSBatteryExport::write(), MSLink::writeApproaching(), and MSXMLRawOut::writeVehicle().
|
virtual |
Returns this vehicles impatience.
Implements SUMOVehicle.
Definition at line 400 of file MSBaseVehicle.cpp.
References getVehicleType(), SUMOVehicle::getWaitingTime(), MSGlobals::gTimeToGridlock, MAX2(), MIN2(), and SUMOReal.
Referenced by MSVehicle::checkRewindLinkLanes(), MSVehicle::executeMove(), MSLane::getCriticalLeader(), MSLane::getLeaderOnConsecutive(), MSLane::getLeadersOnConsecutive(), getNumberReroutes(), GUIVehicle::getParameterWindow(), MSLane::isInsertionSuccess(), MESegment::isOpen(), and GUIVehicle::selectBlockingFoes().
|
pure virtualinherited |
Returns the lane the vehicle is on.
Implemented in MSVehicle, and MEVehicle.
Referenced by GUIBaseVehicle::drawOnPos(), MSDevice_Battery::getPropEnergy(), MSDevice_Battery::notifyEnter(), MSDevice_Battery::notifyMove(), and SUMOVehicle::~SUMOVehicle().
|
inlinevirtual |
Get the vehicle's lateral position on the lane.
Implements SUMOVehicle.
Reimplemented in MSVehicle.
Definition at line 157 of file MSBaseVehicle.h.
|
virtual |
Returns the maximum speed.
Implements SUMOVehicle.
Definition at line 117 of file MSBaseVehicle.cpp.
References MSVehicleType::getMaxSpeed(), and myType.
Referenced by MSCFModel_Wiedemann::_v(), MSVehicleTransfer::checkInsertions(), MSVehicle::estimateSpeedAfterDistance(), GUIMEVehicle::getTypeParameterWindow(), GUIVehicle::getTypeParameterWindow(), getVClass(), MSVehicle::Influencer::implicitDeltaPosVTD(), and MSVehicle::Influencer::implicitSpeedVTD().
|
inlinevirtual |
Returns the number of new routes this vehicle got.
Implements SUMOVehicle.
Definition at line 272 of file MSBaseVehicle.h.
References getImpatience(), myNumberReroutes, and SUMOReal.
Referenced by GUIBaseVehicle::drawGLAdditional(), GUIMEVehicle::getColorValue(), GUIVehicle::getColorValue(), and replaceRouteEdges().
|
virtual |
Returns the vehicle's parameter (including departure definition)
Implements SUMOVehicle.
Definition at line 111 of file MSBaseVehicle.cpp.
References myParameter, and SUMOReal.
Referenced by MSTransportableControl::boardAnyWaiting(), GUIBaseVehicle::drawOnPos(), getDepartDelay(), MSEdge::getDepartLane(), MSLane::getDepartSpeed(), GUIMEVehicle::getParameterWindow(), GUIVehicle::getParameterWindow(), MSLane::insertVehicle(), MSLane::isInsertionSuccess(), MSTransportableControl::loadAnyWaiting(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Vehicle::processSet(), GUIBaseVehicle::setFunctionalColor(), and METriggeredCalibrator::tryEmit().
Return current position (x/y, cartesian)
If the vehicle is not in the net, Position::INVALID.
[in] | offset | optional offset in longitudinal direction |
Implemented in MSVehicle, MEVehicle, GUIMEVehicle, and GUIVehicle.
Referenced by MSVTypeProbe::execute(), MSTransportable::Stage_Driving::getPosition(), MSDevice_BTreceiver::notifyEnter(), MSDevice_BTsender::notifyEnter(), MSDevice_BTreceiver::notifyLeave(), MSDevice_BTsender::notifyLeave(), MSDevice_BTreceiver::notifyMove(), MSDevice_BTsender::notifyMove(), MSEmissionExport::write(), MSFCDExport::write(), MSFullExport::writeVehicles(), and SUMOVehicle::~SUMOVehicle().
|
pure virtualinherited |
Get the vehicle's position along the lane.
Implemented in MSVehicle, and MEVehicle.
Referenced by MSDevice_Tripinfo::computeLengthAndDuration(), GUIBaseVehicle::drawOnPos(), MSVTypeProbe::execute(), MSTransportable::Stage_Driving::getEdgePos(), MSDevice_Battery::getPropEnergy(), MSDevice_BTreceiver::notifyEnter(), MSDevice_BTsender::notifyEnter(), MSInductLoop::notifyEnter(), MSTriggeredRerouter::notifyEnter(), MSE2Collector::notifyEnter(), MSDevice_Tripinfo::notifyLeave(), MSDevice_BTreceiver::notifyLeave(), MSDevice_BTsender::notifyLeave(), MSDevice_Battery::notifyMove(), onDepart(), MSE2Collector::by_vehicle_position_sorter::operator()(), MSEmissionExport::write(), MSFCDExport::write(), MSXMLRawOut::writeVehicle(), MSFullExport::writeVehicles(), and SUMOVehicle::~SUMOVehicle().
|
inlinevirtual |
Returns the starting point for reroutes (usually the current edge)
This differs from *myCurrEdge only if the vehicle is on an internal edge
Reimplemented in MSVehicle.
Definition at line 166 of file MSBaseVehicle.h.
References myCurrEdge.
Referenced by replaceRouteEdges(), and reroute().
|
inlinevirtual |
Returns the current route.
Implements SUMOVehicle.
Definition at line 89 of file MSBaseVehicle.h.
References myRoute.
Referenced by TraCIServerAPI_Vehicle::commandDistanceRequest(), GUIBaseVehicle::drawRoute(), MSEdge::getDepartLane(), MSLane::isInsertionSuccess(), MSVehicle::Influencer::postProcessVTD(), TraCIServerAPI_Vehicle::processGet(), GUIBaseVehicle::setFunctionalColor(), TraCIServerAPI_Vehicle::vtdMap(), and TraCIServerAPI_Vehicle::vtdMap_matchingRoutePosition().
|
virtual |
Returns the slope of the road at vehicle's position.
This default implementation returns always 0.
Implements SUMOVehicle.
Reimplemented in MSVehicle, and MEVehicle.
Definition at line 251 of file MSBaseVehicle.cpp.
Referenced by getCurrentRouteEdge().
|
pure virtualinherited |
Returns the vehicle's current speed.
Implemented in MSVehicle, and MEVehicle.
Referenced by MSInductLoop::collectVehiclesOnDet(), MSE3Collector::detectorUpdate(), MSE3Collector::enter(), MSVTypeProbe::execute(), MSDevice_Battery::getPropEnergy(), MSTransportable::Stage_Driving::getSpeed(), MSE3Collector::leave(), MSDevice_Battery::notifyEnter(), MSDevice_BTreceiver::notifyEnter(), MSDevice_BTsender::notifyEnter(), MSDevice_Tripinfo::notifyEnter(), MSInstantInductLoop::notifyLeave(), MSDevice_Tripinfo::notifyLeave(), MSDevice_BTreceiver::notifyLeave(), MSDevice_BTsender::notifyLeave(), MSDevice_Battery::notifyMove(), MSEmissionExport::write(), MSFCDExport::write(), MSAmitranTrajectories::writeVehicle(), MSXMLRawOut::writeVehicle(), MSFullExport::writeVehicles(), and SUMOVehicle::~SUMOVehicle().
|
protectedpure virtual |
Returns the list of still pending stop edges.
Implemented in MSVehicle, and MEVehicle.
Referenced by reroute(), and setChosenSpeedFactor().
|
inlinevirtual |
Returns the vehicle's access class.
Implements SUMOVehicle.
Definition at line 105 of file MSBaseVehicle.h.
References getEdge(), getMaxSpeed(), MSVehicleType::getParameter(), myType, succEdge(), SUMOReal, and SUMOVTypeParameter::vehicleClass.
Referenced by MSPedestrianPushButton::isActiveForEdge(), and reroute().
|
inlinevirtual |
Returns the vehicle's type definition.
Implements SUMOVehicle.
Definition at line 97 of file MSBaseVehicle.h.
References myType.
Referenced by MSLCM_JE2013::_patchSpeed(), MSLCM_SL2015::_patchSpeed(), MSLCM_LC2013::_patchSpeed(), MSLCM_JE2013::_wantsChange(), MSLCM_LC2013::_wantsChange(), MSLCM_SL2015::_wantsChangeSublane(), MSVehicle::adaptToLeaders(), MSVehicle::addStop(), MSLane::basePos(), MSTransportableControl::boardAnyWaiting(), MSLaneChanger::change(), MSLaneChanger::changeOpposite(), MSLCM_SL2015::checkBlocking(), MSLCM_SL2015::checkBlockingVehicles(), MSLaneChanger::checkChange(), MSLane::checkFailure(), GUIApplicationWindow::checkGamingEvents(), MSVehicleTransfer::checkInsertions(), MSVehicle::checkRewindLinkLanes(), MSLaneChanger::computeOvertakingTime(), MSLaneChanger::continueChange(), MSLane::detectCollisionBetween(), MSE2Collector::detectorUpdate(), GUIVehicle::drawAction_drawLinkItems(), GUIVehicle::drawAction_drawRailCarriages(), GUIVehicle::drawAction_drawVehicleBlinker(), GUIVehicle::drawAction_drawVehicleBrakeLight(), GUIEdge::drawMesoVehicles(), MSLane::enteredByLaneChange(), MSVehicle::enterLaneAtInsertion(), MSVehicle::enterLaneAtLaneChange(), MEVehicle::estimateLeaveSpeed(), MSVehicle::estimateLeaveSpeed(), MSVehicle::estimateSpeedAfterDistance(), MSVehicle::executeMove(), MSLane::executeMovements(), MSLane::freeInsertion(), MEVehicle::getBackPositionOnLane(), MSLane::getBruttoOccupancy(), GUIBaseVehicle::getCenteringBoundary(), MSLane::getCriticalLeader(), MSEdge::getDepartLane(), MSE2Collector::getEstimatedCurrentVehicleNumber(), MSE2Collector::getEstimateQueueLength(), MSLane::getFollower(), MSLane::getFollowersOnConsecutive(), getImpatience(), MSVehicle::getLateralOverlap(), MSLane::getLeader(), MSVehicle::getLeader(), MSLane::getLeaderOnConsecutive(), MSLaneChangerSublane::getLeaders(), MSLane::getLeadersOnConsecutive(), MSLane::getNettoOccupancy(), MSLane::getOppositeFollower(), MSLane::getOppositeLeader(), MSLaneChanger::getRealFollower(), MSLaneChanger::getRealLeader(), MSVehicle::getRightSideOnEdge(), MSVehicle::getRightSideOnLane(), MSLeaderInfo::getSubLanes(), MSVehicle::getTimeGap(), MSLink::getZipperSpeed(), MESegment::hasSpaceFor(), MSLane::incorporateVehicle(), MSLCM_JE2013::informFollower(), MSLCM_LC2013::informFollower(), MSLCM_SL2015::informFollower(), MSLCM_JE2013::informLeader(), MSLCM_LC2013::informLeader(), MSLCM_SL2015::informLeader(), MSLane::insertVehicle(), MSLane::integrateNewVehicle(), MSLane::isInsertionSuccess(), MESegment::isOpen(), MSLCM_SL2015::keepLatGap(), MSLane::lastInsertion(), MSLane::leftByLaneChange(), MSTransportableControl::loadAnyWaiting(), MESegment::loadState(), MSVehicle::overlap(), MSLCM_DK2008::patchSpeed(), MSVehicle::planMoveInternal(), MSVehicle::Influencer::postProcessVTD(), TraCIServerAPI_Vehicle::processGet(), MSVehicle::processNextStop(), TraCIServerAPI_Vehicle::processSet(), MESegment::receive(), MSLaneChanger::registerUnchanged(), MESegment::removeCar(), MSLane::removeVehicle(), MSLane::safeInsertionSpeed(), MSLCM_JE2013::saveBlockerLength(), MSLCM_LC2013::saveBlockerLength(), MSLCM_SL2015::saveBlockerLength(), GUIVehicle::selectBlockingFoes(), MESegment::send(), GUIBaseVehicle::setFunctionalColor(), MSVehicle::setTentativeLaneAndPosition(), MSLCM_JE2013::slowDownForBlocked(), MSLCM_LC2013::slowDownForBlocked(), MSLCM_SL2015::slowDownForBlocked(), MSLaneChanger::startChange(), MSLaneChangerSublane::startChangeSublane(), MSVehicle::unsafeLinkAhead(), MSLCM_SL2015::updateExpectedSublaneSpeeds(), MSVehicle::updateFurtherLanes(), MSLCM_SL2015::updateGaps(), MSLCM_DK2008::wantsChangeToLeft(), MSLCM_DK2008::wantsChangeToRight(), MSBatteryExport::write(), and MSQueueExport::writeLane().
|
pure virtualinherited |
Implemented in MSVehicle, and MEVehicle.
Referenced by getImpatience(), MSDevice_Tripinfo::notifyMoveInternal(), and SUMOVehicle::~SUMOVehicle().
|
virtual |
Returns whether this vehicle has already arived (by default this is true if the vehicle has reached its final edge)
Implements SUMOVehicle.
Reimplemented in MSVehicle, and MEVehicle.
Definition at line 271 of file MSBaseVehicle.cpp.
References succEdge().
Referenced by setArrivalPos().
|
virtual |
Returns whether this vehicle has already departed.
Implements SUMOVehicle.
Definition at line 265 of file MSBaseVehicle.cpp.
References myDeparture, and NOT_YET_DEPARTED.
Referenced by MSVehicle::addStop(), MSLane::forceVehicleInsertion(), MEVehicle::loadState(), MSVehicle::loadState(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Vehicle::processSet(), and setArrivalPos().
|
virtual |
Validates the current or given route.
[out] | msg | Description why the route is not valid (if it is the case) |
[in] | route | The route to check (or 0 if the current route shall be checked) |
Implements SUMOVehicle.
Definition at line 284 of file MSBaseVehicle.cpp.
References MSRoute::begin(), MSRoute::end(), MSVehicleType::getVehicleClass(), myCurrEdge, myRoute, and myType.
Referenced by getDevices(), MESegment::initialise(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Vehicle::processSet(), and replaceRouteEdges().
|
inlinevirtual |
Returns the information whether the front of the vehhicle is on the given lane.
Implements SUMOVehicle.
Reimplemented in MSVehicle.
Definition at line 149 of file MSBaseVehicle.h.
|
inlinevirtual |
Returns the information whether the vehicle is on a road (is simulated)
Implements SUMOVehicle.
Reimplemented in MSVehicle, and MEVehicle.
Definition at line 134 of file MSBaseVehicle.h.
Referenced by GUIBaseVehicle::drawGLAdditional(), and MSXMLRawOut::writeVehicle().
|
pure virtualinherited |
Returns the information whether the vehicle is parked.
Implemented in MSVehicle, and MEVehicle.
Referenced by MSFCDExport::write(), and SUMOVehicle::~SUMOVehicle().
|
inlinevirtual |
Returns the information whether the vehicle is fully controlled via TraCI.
Implements SUMOVehicle.
Reimplemented in MSVehicle.
Definition at line 142 of file MSBaseVehicle.h.
|
pure virtualinherited |
Returns whether the vehicle is at a stop.
Implemented in MSVehicle, and MEVehicle.
Referenced by MSDevice_Transportable::notifyMove(), MSDevice_Tripinfo::notifyMove(), and SUMOVehicle::~SUMOVehicle().
|
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().
|
pure virtualinherited |
Loads the state of this vehicle from the given description.
Implemented in MSVehicle, and MEVehicle.
Referenced by SUMOVehicle::~SUMOVehicle().
|
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 257 of file MSBaseVehicle.cpp.
References MSNet::getCurrentTimeStep(), MSNet::getInstance(), SUMOVehicle::getPositionOnLane(), MSNet::getVehicleControl(), myDepartPos, myDeparture, and MSVehicleControl::vehicleDeparted().
Referenced by MSVehicle::enterLaneAtInsertion(), getCurrentRouteEdge(), and MESegment::receive().
|
private |
invalidated assignment operator
void MSBaseVehicle::removeReminder | ( | MSMoveReminder * | rem | ) |
Removes a MoveReminder dynamically.
[in] | rem | the reminder to remove |
Definition at line 323 of file MSBaseVehicle.cpp.
References myMoveReminders.
Referenced by getDevices().
|
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().
|
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).
[in] | edges | The new list of edges to pass |
[in] | onInit | Whether the vehicle starts with this route |
[in] | check | Whether the route should be checked for validity |
Implements SUMOVehicle.
Definition at line 186 of file MSBaseVehicle.cpp.
References MSRoute::addReference(), MSRoute::begin(), calculateArrivalParams(), RGBColor::DEFAULT_COLOR, MSRoute::dictionary(), MSGlobals::gCheckRoutes, MSRoute::getColor(), MSRoute::getEdges(), Named::getID(), getID(), getNumberReroutes(), getRerouteOrigin(), MSRoute::getStops(), hasValidRoute(), myCurrEdge, myRoute, MSRoute::release(), SUMOVehicle::replaceRoute(), MSRoute::size(), SUMOReal, toString(), and WRITE_WARNING.
Referenced by getCurrentRouteEdge(), MSVehicle::Influencer::postProcessVTD(), TraCIServerAPI_Vehicle::processSet(), and reroute().
|
virtual |
Performs a rerouting using the given router.
Tries to find a new route between the current edge and the destination edge, first. Tries to replace the current route by the new one using replaceRoute.
[in] | t | The time for which the route is computed |
[in] | router | The router to use |
Implements SUMOVehicle.
Definition at line 139 of file MSBaseVehicle.cpp.
References MSEdge::allowedLanes(), SUMOAbstractRouter< E, V >::compute(), MSEdge::dictionary(), MSEdge::EDGEFUNCTION_DISTRICT, SUMOVehicleParameter::fromTaz, Named::getID(), getID(), MSRoute::getLastEdge(), getRerouteOrigin(), getStopEdges(), getVClass(), myParameter, myRoute, replaceRouteEdges(), SUMOVehicleParameter::toTaz, and SUMOVehicleParameter::via.
Referenced by getCurrentRouteEdge(), and TraCIServerAPI_Vehicle::processSet().
|
virtual |
Saves the (common) state of a vehicle.
Implements SUMOVehicle.
Reimplemented in MSVehicle, and MEVehicle.
Definition at line 420 of file MSBaseVehicle.cpp.
References SUMOVehicleParameter::depart, Named::getID(), MSVehicleType::getID(), SUMOVehicleParameter::id, myParameter, myRoute, myType, OutputDevice::openTag(), SUMO_ATTR_DEPART, SUMO_ATTR_ID, SUMO_ATTR_ROUTE, SUMO_ATTR_TYPE, SUMO_TAG_VEHICLE, time2string(), and OutputDevice::writeAttr().
Referenced by MEVehicle::saveState(), MSVehicle::saveState(), and setChosenSpeedFactor().
|
inlinevirtual |
Sets this vehicle's desired arrivalPos for its current route.
Implements SUMOVehicle.
Definition at line 256 of file MSBaseVehicle.h.
References hasArrived(), hasDeparted(), and myArrivalPos.
|
inlinevirtual |
Returns the precomputed factor by which the driver wants to be faster than the speed limit.
Implements SUMOVehicle.
Definition at line 347 of file MSBaseVehicle.h.
References addStops(), calculateArrivalParams(), getDevice(), getStopEdges(), myChosenSpeedFactor, and saveState().
Referenced by TraCIServerAPI_Vehicle::processSet().
|
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.
[in] | nSuccs | The number of edge to look forward |
Implements SUMOVehicle.
Definition at line 123 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(), TraCIServerAPI_Vehicle::processSet(), and MESegment::receive().
|
friend |
Definition at line 59 of file MSBaseVehicle.h.
|
protected |
The destination lane where the vehicle stops.
Definition at line 422 of file MSBaseVehicle.h.
Referenced by calculateArrivalParams(), and MSVehicle::updateBestLanes().
|
protected |
The position on the destination lane where the vehicle stops.
Definition at line 419 of file MSBaseVehicle.h.
Referenced by calculateArrivalParams(), getArrivalPos(), MEVehicle::hasArrived(), MSVehicle::hasArrived(), MSVehicle::planMoveInternal(), MSVehicle::resetRoutePosition(), setArrivalPos(), and MSVehicle::updateBestLanes().
|
protected |
A precomputed factor by which the driver wants to be faster than the speed limit.
Definition at line 396 of file MSBaseVehicle.h.
Referenced by getChosenSpeedFactor(), and setChosenSpeedFactor().
|
protected |
Iterator to current route-edge.
Definition at line 393 of file MSBaseVehicle.h.
Referenced by MSVehicle::addStop(), MSVehicle::enterLaneAtMove(), MSVehicle::executeMove(), getCurrentRouteEdge(), MSVehicle::getDistanceToPosition(), getEdge(), getRerouteOrigin(), MSVehicle::getRerouteOrigin(), MSVehicle::getRoutePosition(), MEVehicle::hasArrived(), MSVehicle::hasArrived(), hasValidRoute(), MSVehicle::leaveLane(), MEVehicle::loadState(), MSVehicle::loadState(), MEVehicle::moveRoutePointer(), MSVehicle::planMoveInternal(), MSVehicle::Influencer::postProcessVTD(), MSVehicle::processNextStop(), MSVehicle::replaceRoute(), MEVehicle::replaceRoute(), replaceRouteEdges(), MSVehicle::resetRoutePosition(), MEVehicle::saveState(), MSVehicle::saveState(), succEdge(), MSVehicle::updateBestLanes(), and MSVehicle::willPass().
|
protected |
The real depart position.
Definition at line 416 of file MSBaseVehicle.h.
Referenced by getDepartPos(), and onDepart().
|
protected |
The real departure time.
Definition at line 413 of file MSBaseVehicle.h.
Referenced by MSVehicle::enterLaneAtInsertion(), getDeparture(), hasDeparted(), MEVehicle::loadState(), MSVehicle::loadState(), onDepart(), MEVehicle::saveState(), and MSVehicle::saveState().
|
protected |
The devices this vehicle has.
Definition at line 410 of file MSBaseVehicle.h.
Referenced by MSVehicle::addContainer(), MSVehicle::addPerson(), getDevice(), getDevices(), GUIMEVehicle::getParameterWindow(), GUIVehicle::getParameterWindow(), GUIBaseVehicle::GUIBaseVehicle(), MSBaseVehicle(), and ~MSBaseVehicle().
|
protected |
Current lane's move reminder.
Definition at line 406 of file MSBaseVehicle.h.
Referenced by activateReminders(), MSVehicle::activateReminders(), MSVehicle::adaptLaneEntering2MoveReminder(), MSVehicle::addContainer(), MSVehicle::addPerson(), addReminder(), GUIBaseVehicle::GUIBaseVehicle(), MSVehicle::leaveLane(), MSBaseVehicle(), removeReminder(), MEVehicle::updateDetectorForWriting(), MEVehicle::updateDetectors(), and MSVehicle::workOnMoveReminders().
|
protected |
The number of reroutings.
Definition at line 425 of file MSBaseVehicle.h.
Referenced by getNumberReroutes(), MSVehicle::replaceRoute(), and MEVehicle::replaceRoute().
|
protected |
This Vehicle's parameter.
Definition at line 384 of file MSBaseVehicle.h.
Referenced by MSVehicle::addStop(), addStops(), calculateArrivalParams(), MSVehicle::getContainerNumber(), getID(), getParameter(), GUIMEVehicle::getParameterWindow(), GUIVehicle::getParameterWindow(), MSVehicle::getPersonNumber(), MSVehicle::planMoveInternal(), reroute(), saveState(), MSVehicle::updateBestLanes(), and ~MSBaseVehicle().
|
protected |
This Vehicle's route.
Definition at line 387 of file MSBaseVehicle.h.
Referenced by MSVehicle::addStop(), addStops(), calculateArrivalParams(), GUIVehicle::drawRouteHelper(), MSVehicle::executeMove(), MSVehicle::getDistanceToPosition(), MSVehicle::getRerouteOrigin(), getRoute(), MSVehicle::getRoutePosition(), MEVehicle::hasArrived(), MSVehicle::hasArrived(), hasValidRoute(), MEVehicle::moveRoutePointer(), MSBaseVehicle(), MSVehicle::planMoveInternal(), MSVehicle::replaceRoute(), MEVehicle::replaceRoute(), replaceRouteEdges(), reroute(), MSVehicle::resetRoutePosition(), MEVehicle::saveState(), saveState(), MSVehicle::saveState(), succEdge(), MSVehicle::updateBestLanes(), MSVehicle::willPass(), and ~MSBaseVehicle().
|
protected |
This Vehicle's type.
Definition at line 390 of file MSBaseVehicle.h.
Referenced by MSVehicle::addStop(), calculateArrivalParams(), MSVehicle::enterLaneAtInsertion(), MSVehicle::executeMove(), MSVehicle::getBackPosition(), MSVehicle::getBackPositionOnLane(), MSVehicle::getBoundingBox(), MSVehicle::getBoundingPoly(), MSVehicle::getCarFollowModel(), MSVehicle::getCO2Emissions(), MSVehicle::getCOEmissions(), MSVehicle::getElectricityConsumption(), MSVehicle::getFuelConsumption(), MSVehicle::getHarmonoise_NoiseEmissions(), MSVehicle::getHCEmissions(), getMaxSpeed(), MSVehicle::getNOxEmissions(), MSVehicle::getPMxEmissions(), MSVehicle::getPositionOnLane(), GUIMEVehicle::getTypeParameterWindow(), GUIVehicle::getTypeParameterWindow(), getVClass(), getVehicleType(), hasValidRoute(), MSVehicle::processNextStop(), MSVehicle::replaceVehicleType(), saveState(), MSVehicle::updateBestLanes(), and MSVehicle::~MSVehicle().
|
staticprotected |
Definition at line 430 of file MSBaseVehicle.h.
Referenced by MSVehicle::enterLaneAtInsertion(), and hasDeparted().