98 void setID(
const std::string& newID);
119 bool hasDevice(
const std::string& deviceName)
const;
125 std::string
getDeviceParameter(
const std::string& deviceName,
const std::string& key)
const;
128 void setDeviceParameter(
const std::string& deviceName,
const std::string& key,
const std::string& value);
252 bool replaceRouteEdges(
ConstMSEdgeVector& edges,
double cost,
double savings,
const std::string& info,
bool onInit =
false,
bool check =
false,
bool removeStops =
true);
264 virtual bool replaceRoute(
const MSRoute* route,
const std::string& info,
bool onInit =
false,
int offset = 0,
bool addStops =
true,
bool removeStops =
true);
385 inline const std::vector<MSVehicleDevice*>&
getDevices()
const {
402 const std::vector<MSTransportable*>&
getPersons()
const;
513 virtual bool handleCollisionStop(
MSStop& stop,
const bool collision,
const double distToStop,
const std::string& errorMsgStart, std::string& errorMsg);
581 inline const std::vector<SUMOVehicleParameter::Stop>&
getPastStops()
const {
605 std::mt19937*
getRNG()
const;
758 virtual std::pair<const MSVehicle* const, double>
getLeader(
double dist = 0)
const {
761 return std::make_pair(
nullptr, -1);
772 virtual std::pair<const MSVehicle* const, double>
getFollower(
double dist = 0)
const {
775 return std::make_pair(
nullptr, -1);
876 static void initMoveReminderOutput(
const OptionsCont& oc);
880 void traceMoveReminder(
const std::string& type,
MSMoveReminder* rem,
double pos,
bool keep)
const;
883 const bool myTraceMoveReminders;
886 static std::set<std::string> myShallTraceMoveReminders;
std::vector< const MSEdge * > ConstMSEdgeVector
ConstMSEdgeVector::const_iterator MSRouteIterator
#define WRITE_WARNING(msg)
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
DepartLaneDefinition
Possible ways to choose a lane on depart.
const double INVALID_DOUBLE
#define UNUSED_PARAMETER(x)
A MSVehicle extended by some values for usage within the gui.
static void cleanup()
Static cleanup.
int myRoutingMode
routing mode (see TraCIConstants.h)
static void init()
Static initalization.
virtual ~BaseInfluencer()
Destructor.
BaseInfluencer()
Constructor.
SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterTT(const int rngIndex, SUMOVehicleClass svc) const
void setRoutingMode(int value)
Sets routing behavior.
int getRoutingMode() const
return the current routing mode
The base class for microscopic and mesoscopic vehicles.
double getMaxSpeed() const
Returns the maximum speed.
MSVehicleDevice * getDevice(const std::type_info &type) const
Returns a device of the given type if it exists or 0.
void addStops(const bool ignoreStopErrors, MSRouteIterator *searchStart=nullptr)
Adds stops to the built vehicle.
double getDepartPos() const
Returns this vehicle's real departure position.
virtual bool isSelected() const
whether this vehicle is selected in the GUI
const MSDevice_Transportable * getPersonDevice() const
virtual bool isRemoteControlled() const
Returns the information whether the vehicle is fully controlled via TraCI.
std::list< MSStop > myStops
The vehicle's list of stops.
double getImpatience() const
Returns this vehicles impatience.
const std::vector< MSTransportable * > & getPersons() const
retrieve riding persons
virtual void initDevices()
const MSEdge * succEdge(int nSuccs) const
Returns the nSuccs'th successor of edge the vehicle is currently at.
void resetRoutePosition(int index, DepartLaneDefinition departLaneProcedure)
reset index of edge within route
virtual double getLateralPositionOnLane() const
Get the vehicle's lateral position on the lane.
virtual BaseInfluencer & getBaseInfluencer()=0
Returns the velocity/lane influencer.
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 dev...
void setChosenSpeedFactor(const double factor)
Returns the precomputed factor by which the driver wants to be faster than the speed limit.
virtual double getArrivalPos() const
Returns this vehicle's desired arrivalPos for its current route (may change on reroute)
MSVehicleType * myType
This vehicle's type.
virtual double getStopDelay() const
Returns the estimated public transport stop (departure) delay in seconds.
MoveReminderCont myMoveReminders
Currently relevant move reminders.
bool allowsBoarding(MSTransportable *t) const
whether the given transportable is allowed to board this vehicle
double myDepartPos
The real depart position.
const std::list< MSStop > & getStops() const
const SUMOVehicleParameter & getParameter() const
Returns the vehicle's parameter (including departure definition)
void addReminder(MSMoveReminder *rem)
Adds a MoveReminder dynamically.
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.
double getFuelConsumption() const
Returns fuel consumption of the current state.
void replaceParameter(const SUMOVehicleParameter *newParameter)
replace the vehicle parameter (deleting the old one)
double getCO2Emissions() const
Returns CO2 emission of the current state.
virtual std::pair< const MSVehicle *const, double > getFollower(double dist=0) const
Returns the follower of the vehicle looking for a fixed distance.
double getChosenSpeedFactor() const
Returns the precomputed factor by which the driver wants to be faster than the speed limit.
std::vector< MSVehicleDevice * > myDevices
The devices this vehicle has.
virtual 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.
double getPreviousSpeed() const
Returns the vehicle's previous speed.
virtual void addTransportable(MSTransportable *transportable)
Adds a person or container to this vehicle.
double getElectricityConsumption() const
Returns electricity consumption of the current state.
int getRouteValidity(bool update=true, bool silent=false)
check for route validity at first insertion attempt
std::vector< std::pair< MSMoveReminder *, double > > MoveReminderCont
Definition of a move reminder container.
double getOdometer() const
Returns the distance that was already driven by this vehicle.
virtual bool hasArrived() const
Returns whether this vehicle has already arived (by default this is true if the vehicle has reached i...
const NumericalID myNumericalID
static NumericalID myCurrentNumericalIndex
MSVehicleType & getSingularType()
Replaces the current vehicle type with a new one used by this vehicle only.
void replaceVehicleType(MSVehicleType *type)
Replaces the current vehicle type by the one given.
virtual bool wasRemoteControlled(SUMOTime lookBack=DELTA_T) const
Returns the information whether the vehicle is fully controlled via TraCI.
virtual void onRemovalFromNet(const MSMoveReminder::Notification)
Called when the vehicle is removed from the network.
double getLength() const
Returns the vehicle's length.
bool isParking() const
Returns whether the vehicle is parking.
const MSEdge * getEdge() const
Returns the edge the vehicle is currently at.
double getHarmonoise_NoiseEmissions() const
Returns noise emissions of the current state.
const std::map< int, double > * getEmissionParameters() const
Returns the vehicle's emission model parameter.
bool hasValidRoute(std::string &msg, const MSRoute *route=0) const
Validates the current or given route.
bool isStoppedInRange(const double pos, const double tolerance) const
return whether the given position is within range of the current stop
int getPersonNumber() const
Returns the number of persons.
virtual std::pair< const MSVehicle *const, double > getLeader(double dist=0) const
Returns the leader of the vehicle looking for a fixed distance.
const MSDevice_Transportable * getContainerDevice() const
double getNOxEmissions() const
Returns NOx emission of the current state.
void setID(const std::string &newID)
set the id (inherited from Named but forbidden for vehicles)
std::mt19937 * getRNG() const
double getPMxEmissions() const
Returns PMx emission of the current state.
MSRouteIterator myCurrEdge
Iterator to current route-edge.
static std::vector< MSTransportable * > myEmptyTransportableVector
bool hasDeparted() const
Returns whether this vehicle has already departed.
double getWidth() const
Returns the vehicle's width.
double getCOEmissions() const
Returns CO emission of the current state.
MSDevice_Transportable * myContainerDevice
The containers this vehicle may have.
MSBaseVehicle(SUMOVehicleParameter *pars, const MSRoute *route, MSVehicleType *type, const double speedFactor)
Constructor.
double getStateOfCharge() const
Returns actual state of charge of battery (Wh) RICE_CHECK: This may be a misnomer,...
MSEdgeWeightsStorage & _getWeightsStorage() const
bool isVehicle() const
Whether it is a vehicle.
bool hasDevice(const std::string &deviceName) const
check whether the vehicle is equiped with a device of the given type
virtual const MSEdge * getRerouteOrigin() const
Returns the starting point for reroutes (usually the current edge)
SUMOTime getDeparture() const
Returns this vehicle's real departure time.
void calculateArrivalParams()
(Re-)Calculates the arrival position and lane from the vehicle parameters
double basePos(const MSEdge *edge) const
departure position where the vehicle fits fully onto the edge (if possible)
const MSRouteIterator & getCurrentRouteEdge() const
Returns an iterator pointing to the current edge in this vehicles route.
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 p...
MSDevice_Transportable * myPersonDevice
The passengers this vehicle may have.
const MSRoute * myRoute
This vehicle's route.
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
bool hasStops() const
Returns whether the vehicle has to stop somewhere.
virtual void activateReminders(const MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
"Activates" all current move reminder
bool isLineStop(double position) const
returns whether the vehicle serves a public transport line that serves the given stop
double myChosenSpeedFactor
A precomputed factor by which the driver wants to be faster than the speed limit.
@ ROUTE_INVALID
route was checked and is valid
@ ROUTE_START_INVALID_LANE
@ ROUTE_START_INVALID_PERMISSIONS
std::string getPrefixedParameter(const std::string &key, std::string &error) const
retrieve parameters of devices, models and the vehicle itself
void removeTransportable(MSTransportable *t)
removes a person or container
SUMOVehicleClass getVClass() const
Returns the vehicle's access class.
virtual double getStopArrivalDelay() const
Returns the estimated public transport stop arrival delay in seconds.
int myArrivalLane
The destination lane where the vehicle stops.
virtual ~MSBaseVehicle()
Destructor.
SUMOTime myDeparture
The real departure time.
virtual void setArrivalPos(double arrivalPos)
Sets this vehicle's desired arrivalPos for its current route.
std::vector< std::string > getPersonIDList() const
Returns the list of persons.
const MSEdgeWeightsStorage & getWeightsStorage() const
Returns the vehicle's internal edge travel times/efforts container.
bool isStoppedTriggered() const
Returns whether the vehicle is on a triggered stop.
const std::vector< MSVehicleDevice * > & getDevices() const
Returns this vehicle's devices.
virtual bool hasInfluencer() const =0
bool addStop(const SUMOVehicleParameter::Stop &stopPar, std::string &errorMsg, SUMOTime untilOffset=0, bool collision=false, MSRouteIterator *searchStart=nullptr)
Adds a stop.
double getHCEmissions() const
Returns HC emission of the current state.
NumericalID getNumericalID() const
return the numerical ID which is only for internal usage
virtual bool resumeFromStopping()
std::vector< SUMOVehicleParameter::Stop > myPastStops
The list of stops that the vehicle has already reached.
void onDepart()
Called when the vehicle is inserted into the network.
void removeReminder(MSMoveReminder *rem)
Removes a MoveReminder dynamically.
bool haveValidStopEdges() const
check whether all stop.edge MSRouteIterators are valid and in order
virtual double getAcceleration() const
Returns the vehicle's acceleration.
virtual bool handleCollisionStop(MSStop &stop, const bool collision, const double distToStop, const std::string &errorMsgStart, std::string &errorMsg)
virtual const BaseInfluencer * getBaseInfluencer() const =0
int getRoutePosition() const
return index of edge within route
static const SUMOTime NOT_YET_DEPARTED
SUMOTime getDepartDelay() const
Returns the depart delay.
double getElecHybridCurrent() const
Returns actual current (A) of ElecHybrid device RICE_CHECK: Is this the current consumed from the ove...
const SUMOVehicleParameter * myParameter
This vehicle's parameter.
virtual bool hasValidRouteStart(std::string &msg)
checks wether the vehicle can depart on the first edge
int myRouteValidity
status of the current vehicle route
std::vector< std::pair< int, double > > getStopIndices() const
return list of route indices for the remaining stops
virtual bool isFrontOnLane(const MSLane *) const
Returns the information whether the front of the vehhicle is on the given lane.
const ConstMSEdgeVector getStopEdges(double &firstPos, double &lastPos) const
Returns the list of still pending stop edges also returns the first and last stop position.
SUMOTime myStopUntilOffset
The offset when adding route stops with 'until' on route replacement.
int getNumberReroutes() const
Returns the number of new routes this vehicle got.
virtual bool isOnRoad() const
Returns the information whether the vehicle is on a road (is simulated)
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.
const std::vector< SUMOVehicleParameter::Stop > & getPastStops() const
const std::vector< MSTransportable * > & getContainers() const
retrieve riding containers
const MSRoute & getRoute() const
Returns the current route.
MSEdgeWeightsStorage * myEdgeWeights
MSBaseVehicle & operator=(const MSBaseVehicle &s)=delete
invalidated assignment operator
void createDevice(const std::string &deviceName)
create device of the given type
bool isStopped() const
Returns whether the vehicle is at a stop.
bool abortNextStop(int nextStopIndex=0)
deletes the next stop at the given index if it exists
int myNumberReroutes
The number of reroutings.
double myArrivalPos
The position on the destination lane where the vehicle stops.
virtual void saveState(OutputDevice &out)
Saves the (common) state of a vehicle.
double myOdometer
A simple odometer to keep track of the length of the route already driven.
int getContainerNumber() const
Returns the number of containers.
A road/street connecting two junctions.
A storage for edge travel times and efforts.
Representation of a lane in the micro simulation.
Something on a lane to be noticed about vehicle movement.
Notification
Definition of a vehicle state.
Abstract in-vehicle device.
The car-following model and parameter.
double getWidth() const
Get the width which vehicles of this class shall have when being drawn.
double getLength() const
Get vehicle's length [m].
const SUMOVTypeParameter & getParameter() const
A storage for options typed value containers)
Static storage of an output device and its base (abstract) implementation.
SUMOVehicleClass vehicleClass
The vehicle's class.
Representation of a vehicle.
long long int NumericalID
Definition of vehicle stop (position and duration)
Structure representing possible vehicle parameter.