Eclipse SUMO - Simulation of Urban MObility
MSDevice_Battery.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3// Copyright (C) 2013-2023 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
19// The Battery parameters for the vehicle
20/****************************************************************************/
21#include <config.h>
22
29#include <microsim/MSNet.h>
30#include <microsim/MSLane.h>
31#include <microsim/MSEdge.h>
32#include <microsim/MSVehicle.h>
33#include "MSDevice_Tripinfo.h"
34#include "MSDevice_Emissions.h"
35#include "MSDevice_Battery.h"
36
37#define DEFAULT_MAX_CAPACITY 35000
38#define DEFAULT_CHARGE_RATIO 0.5
39
40
41// ===========================================================================
42// method definitions
43// ===========================================================================
44// ---------------------------------------------------------------------------
45// static initialisation methods
46// ---------------------------------------------------------------------------
47void
49 insertDefaultAssignmentOptions("battery", "Battery", oc);
50 // custom options
51 oc.doRegister("device.battery.track-fuel", new Option_Bool(false));
52 oc.addDescription("device.battery.track-fuel", "Battery", TL("Track fuel consumption for non-electric vehicles"));
53}
54
55
56void
57MSDevice_Battery::buildVehicleDevices(SUMOVehicle& v, std::vector<MSVehicleDevice*>& into) {
58 // Check if vehicle should get a battery
60 const SUMOVTypeParameter& typeParams = v.getVehicleType().getParameter();
61 // obtain maximumBatteryCapacity
62 const double maximumBatteryCapacity = typeParams.getDouble(toString(SUMO_ATTR_MAXIMUMBATTERYCAPACITY), DEFAULT_MAX_CAPACITY);
63
64 // obtain actualBatteryCapacity
65 double actualBatteryCapacity = 0;
67 actualBatteryCapacity = typeParams.getDouble(toString(SUMO_ATTR_ACTUALBATTERYCAPACITY),
68 maximumBatteryCapacity * DEFAULT_CHARGE_RATIO);
69 } else {
71 }
72
73 const double powerMax = typeParams.getDouble(toString(SUMO_ATTR_MAXIMUMPOWER), 150000.);
74 const double stoppingThreshold = typeParams.getDouble(toString(SUMO_ATTR_STOPPINGTHRESHOLD), 0.1);
75
76 // battery constructor
77 MSDevice_Battery* device = new MSDevice_Battery(v, "battery_" + v.getID(),
78 actualBatteryCapacity, maximumBatteryCapacity, powerMax, stoppingThreshold);
79
80 // Add device to vehicle
81 into.push_back(device);
82 }
83}
84
85
86// ---------------------------------------------------------------------------
87// MSDevice_Battery-methods
88// ---------------------------------------------------------------------------
89MSDevice_Battery::MSDevice_Battery(SUMOVehicle& holder, const std::string& id, const double actualBatteryCapacity, const double maximumBatteryCapacity,
90 const double powerMax, const double stoppingThreshold) :
91 MSVehicleDevice(holder, id),
92 myActualBatteryCapacity(0), // [actualBatteryCapacity <= maximumBatteryCapacity]
93 myMaximumBatteryCapacity(0), // [maximumBatteryCapacity >= 0]
94 myPowerMax(0), // [maximumPower >= 0]
95 myStoppingThreshold(0), // [stoppingThreshold >= 0]
96 myLastAngle(std::numeric_limits<double>::infinity()),
97 myChargingStopped(false), // Initially vehicle don't charge stopped
98 myChargingInTransit(false), // Initially vehicle don't charge in transit
99 myChargingStartTime(0), // Initially charging start time (must be if the vehicle was launched at the charging station)
100 myConsum(0), // Initially the vehicle is stopped and therefore the consum is zero.
101 myTotalConsumption(0.0),
102 myTotalRegenerated(0.0),
103 myActChargingStation(nullptr), // Initially the vehicle isn't over a Charging Station
104 myPreviousNeighbouringChargingStation(nullptr), // Initially the vehicle wasn't over a Charging Station
105 myEnergyCharged(0), // Initially the energy charged is zero
106 myVehicleStopped(0) { // Initially the vehicle is stopped and the corresponding variable is 0
107
108 if (maximumBatteryCapacity < 0) {
109 WRITE_WARNINGF(TL("Battery builder: Vehicle '%' doesn't have a valid value for parameter % (%)."), getID(), toString(SUMO_ATTR_MAXIMUMBATTERYCAPACITY), toString(maximumBatteryCapacity));
110 } else {
111 myMaximumBatteryCapacity = maximumBatteryCapacity;
112 }
113
114 if (actualBatteryCapacity > maximumBatteryCapacity) {
115 WRITE_WARNING("Battery builder: Vehicle '" + getID() + "' has a " + toString(SUMO_ATTR_ACTUALBATTERYCAPACITY) + " (" + toString(actualBatteryCapacity) + ") greater than it's " + toString(SUMO_ATTR_MAXIMUMBATTERYCAPACITY) + " (" + toString(maximumBatteryCapacity) + "). A max battery capacity value will be asigned");
117 } else {
118 myActualBatteryCapacity = actualBatteryCapacity;
119 }
120
121 if (powerMax < 0) {
122 WRITE_WARNINGF(TL("Battery builder: Vehicle '%' doesn't have a valid value for parameter % (%)."), getID(), toString(SUMO_ATTR_MAXIMUMPOWER), toString(powerMax));
123 } else {
124 myPowerMax = powerMax;
125 }
126
127 if (stoppingThreshold < 0) {
128 WRITE_WARNINGF(TL("Battery builder: Vehicle '%' doesn't have a valid value for parameter % (%)."), getID(), toString(SUMO_ATTR_STOPPINGTHRESHOLD), toString(stoppingThreshold));
129 } else {
130 myStoppingThreshold = stoppingThreshold;
131 }
132
144
146}
147
148
150}
151
152
153bool MSDevice_Battery::notifyMove(SUMOTrafficObject& tObject, double /* oldPos */, double /* newPos */, double /* newSpeed */) {
154 if (!tObject.isVehicle()) {
155 return false;
156 }
157 SUMOVehicle& veh = static_cast<SUMOVehicle&>(tObject);
158 // Start vehicleStoppedTimer if the vehicle is stopped. In other case reset timer
159 if (veh.getSpeed() < myStoppingThreshold) {
160 // Increase vehicle stopped timer
162 } else {
163 // Reset vehicle Stopped
165 }
166
167 // Update Energy from the battery
169 if (getMaximumBatteryCapacity() != 0) {
170 params->setDouble(SUMO_ATTR_ANGLE, myLastAngle == std::numeric_limits<double>::infinity() ? 0. : GeomHelper::angleDiff(myLastAngle, veh.getAngle()));
171 if (myTrackFuel) {
172 // [ml]
174 veh.getSlope(), params) * TS;
175 } else {
176 // [Wh]
178 veh.getSlope(), params) * TS;
179 }
180 if (veh.isParking()) {
181 // recuperation from last braking step is ok but further consumption should cease
182 myConsum = MIN2(myConsum, 0.0);
183 }
184
185 // Energy lost/gained from vehicle movement (via vehicle energy model) [Wh]
187
188 // Track total energy consumption and regeneration
189 if (myConsum > 0.0) {
191 } else {
193 }
194
195 // saturate between 0 and myMaximumBatteryCapacity [Wh]
196 if (getActualBatteryCapacity() < 0) {
198 if (getMaximumBatteryCapacity() > 0) {
199 WRITE_WARNINGF(TL("Battery of vehicle '%' is depleted."), veh.getID());
200 }
203 }
204 myLastAngle = veh.getAngle();
205 }
206
207 // Check if vehicle has under their position one charge Station
208 const std::string chargingStationID = MSNet::getInstance()->getStoppingPlaceID(veh.getLane(), veh.getPositionOnLane(), SUMO_TAG_CHARGING_STATION);
209
210 // If vehicle is over a charging station
211 if (chargingStationID != "") {
212 // if the vehicle is almost stopped, or charge in transit is enabled, then charge vehicle
214 if ((veh.getSpeed() < myStoppingThreshold) || cs->getChargeInTransit()) {
215 // Set Flags Stopped/intransit to
216 if (veh.getSpeed() < myStoppingThreshold) {
217 // vehicle ist almost stopped, then is charging stopped
218 myChargingStopped = true;
219
220 // therefore isn't charging in transit
221 myChargingInTransit = false;
222 } else {
223 // vehicle is moving, and the Charging station allow charge in transit
224 myChargingStopped = false;
225
226 // Therefore charge in transit
227 myChargingInTransit = true;
228 }
229
230 // get pointer to charging station
232
233 // Only update charging start time if vehicle allow charge in transit, or in other case
234 // if the vehicle not allow charge in transit but it's stopped.
236 // Update Charging start time
238 }
239
240 // time it takes the vehicle at the station < charging station time delay?
242 // Enable charging vehicle
244
245 // Calulate energy charged
247
248 // Update Battery charge
251 } else {
253 }
254 }
255 // add charge value for output to myActChargingStation
257 }
258 // else disable charging vehicle
259 else {
260 cs->setChargingVehicle(false);
261 }
262 // disable charging vehicle from previous (not current) ChargingStation (reason: if there is no gap between two different chargingStations = the vehicle switches from used charging station to other one in a single timestap)
265 }
267 }
268 // In other case, vehicle will be not charged
269 else {
270 // Disable flags
271 myChargingInTransit = false;
272 myChargingStopped = false;
273
274 // Disable charging vehicle
275 if (myActChargingStation != nullptr) {
277 }
278
279 // Set charging station pointer to NULL
280 myActChargingStation = nullptr;
281
282 // Set energy charged to 0
283 myEnergyCharged = 0.00;
284
285 // Reset timer
287 }
288
289 // Always return true.
290 return true;
291}
292
293
294void
295MSDevice_Battery::setActualBatteryCapacity(const double actualBatteryCapacity) {
296 if (actualBatteryCapacity < 0) {
298 } else if (actualBatteryCapacity > myMaximumBatteryCapacity) {
300 } else {
301 myActualBatteryCapacity = actualBatteryCapacity;
302 }
303}
304
305
306void
307MSDevice_Battery::setMaximumBatteryCapacity(const double maximumBatteryCapacity) {
308 if (myMaximumBatteryCapacity < 0) {
309 WRITE_WARNINGF(TL("Trying to set into the battery device of vehicle '%' an invalid % (%)."), getID(), toString(SUMO_ATTR_MAXIMUMBATTERYCAPACITY), toString(maximumBatteryCapacity));
310 } else {
311 myMaximumBatteryCapacity = maximumBatteryCapacity;
312 }
313}
314
315
316void
317MSDevice_Battery::setPowerMax(const double powerMax) {
318 if (myPowerMax < 0) {
319 WRITE_WARNINGF(TL("Trying to set into the battery device of vehicle '%' an invalid % (%)."), getID(), toString(SUMO_ATTR_MAXIMUMPOWER), toString(powerMax));
320 } else {
321 myPowerMax = powerMax;
322 }
323}
324
325
326void
327MSDevice_Battery::setStoppingThreshold(const double stoppingThreshold) {
328 if (stoppingThreshold < 0) {
329 WRITE_WARNINGF(TL("Trying to set into the battery device of vehicle '%' an invalid % (%)."), getID(), toString(SUMO_ATTR_STOPPINGTHRESHOLD), toString(stoppingThreshold));
330 } else {
331 myStoppingThreshold = stoppingThreshold;
332 }
333}
334
335
336void
339}
340
341
342void
345}
346
347
348void
351}
352
353
354void
357}
358
359
360double
363}
364
365
366double
369}
370
371
372double
374 return myPowerMax;
375}
376
377
378double
380 return myConsum;
381}
382
383double
385 return myTotalConsumption;
386}
387
388
389double
391 return myTotalRegenerated;
392}
393
394
395bool
397 return myChargingStopped;
398}
399
400
401bool
403 return myChargingInTransit;
404}
405
406
409 return myChargingStartTime;
410}
411
412
413std::string
415 if (myActChargingStation != nullptr) {
416 return myActChargingStation->getID();
417 } else {
418 return "NULL";
419 }
420}
421
422double
424 return myEnergyCharged;
425}
426
427
428int
430 return myVehicleStopped;
431}
432
433
434double
436 return myStoppingThreshold;
437}
438
439
440std::string
441MSDevice_Battery::getParameter(const std::string& key) const {
444 } else if (key == toString(SUMO_ATTR_ENERGYCONSUMED)) {
445 return toString(getConsum());
446 } else if (key == toString(SUMO_ATTR_TOTALENERGYCONSUMED)) {
448 } else if (key == toString(SUMO_ATTR_TOTALENERGYREGENERATED)) {
450 } else if (key == toString(SUMO_ATTR_ENERGYCHARGED)) {
451 return toString(getEnergyCharged());
452 } else if (key == toString(SUMO_ATTR_MAXIMUMBATTERYCAPACITY)) {
454 } else if (key == toString(SUMO_ATTR_CHARGINGSTATIONID)) {
455 return getChargingStationID();
456 } else if (key == toString(SUMO_ATTR_VEHICLEMASS)) {
458 }
459 throw InvalidArgument("Parameter '" + key + "' is not supported for device of type '" + deviceName() + "'");
460}
461
462
463void
464MSDevice_Battery::setParameter(const std::string& key, const std::string& value) {
465 double doubleValue;
466 try {
467 doubleValue = StringUtils::toDouble(value);
468 } catch (NumberFormatException&) {
469 throw InvalidArgument("Setting parameter '" + key + "' requires a number for device of type '" + deviceName() + "'");
470 }
472 setActualBatteryCapacity(doubleValue);
473 } else if (key == toString(SUMO_ATTR_MAXIMUMBATTERYCAPACITY)) {
474 setMaximumBatteryCapacity(doubleValue);
475 } else if (key == toString(SUMO_ATTR_VEHICLEMASS)) {
477 } else {
478 throw InvalidArgument("Setting parameter '" + key + "' is not supported for device of type '" + deviceName() + "'");
479 }
480}
481
482
483void
485 // @note: only charing is performed but no energy is consumed
487 myConsum = 0;
488}
489
490
491/****************************************************************************/
long long int SUMOTime
Definition: GUI.h:36
#define DEFAULT_CHARGE_RATIO
#define DEFAULT_MAX_CAPACITY
#define WRITE_WARNINGF(...)
Definition: MsgHandler.h:268
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:267
#define TL(string)
Definition: MsgHandler.h:284
SUMOTime DELTA_T
Definition: SUMOTime.cpp:37
#define TS
Definition: SUMOTime.h:41
@ SUMO_TAG_CHARGING_STATION
A Charging Station.
@ SUMO_ATTR_MAXIMUMPOWER
Maximum Power.
@ SUMO_ATTR_ENERGYCONSUMED
Energy consumed.
@ SUMO_ATTR_MAXIMUMBATTERYCAPACITY
Maxium battery capacity.
@ SUMO_ATTR_ROLLDRAGCOEFFICIENT
Roll Drag coefficient.
@ SUMO_ATTR_CONSTANTPOWERINTAKE
Constant Power Intake.
@ SUMO_ATTR_RECUPERATIONEFFICIENCY_BY_DECELERATION
Recuperation efficiency (by deceleration)
@ SUMO_ATTR_STOPPINGTHRESHOLD
Stopping threshold.
@ SUMO_ATTR_RECUPERATIONEFFICIENCY
Recuperation efficiency (constant)
@ SUMO_ATTR_AIRDRAGCOEFFICIENT
Air drag coefficient.
@ SUMO_ATTR_CHARGINGSTATIONID
Charging Station ID.
@ SUMO_ATTR_ANGLE
@ SUMO_ATTR_ACTUALBATTERYCAPACITY
@ SUMO_ATTR_VEHICLEMASS
Vehicle mass.
@ SUMO_ATTR_RADIALDRAGCOEFFICIENT
Radial drag coefficient.
@ SUMO_ATTR_ENERGYCHARGED
tgotal of Energy charged
@ SUMO_ATTR_TOTALENERGYREGENERATED
Total energy regenerated.
@ SUMO_ATTR_PROPULSIONEFFICIENCY
Propulsion efficiency.
@ SUMO_ATTR_TOTALENERGYCONSUMED
Total energy consumed.
@ SUMO_ATTR_INTERNALMOMENTOFINERTIA
Internal moment of inertia.
@ SUMO_ATTR_FRONTSURFACEAREA
Front surface area.
T MIN2(T a, T b)
Definition: StdDefs.h:76
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:46
An upper class for objects with additional parameters.
Definition: EnergyParams.h:41
double getDouble(SumoXMLAttr attr) const
void setDouble(SumoXMLAttr attr, double value)
Sets a parameter.
void checkParam(const SumoXMLAttr paramKey, const std::string &id, const double lower=0., const double upper=std::numeric_limits< double >::infinity())
static double angleDiff(const double angle1, const double angle2)
Returns the difference of the second angle to the first angle in radiants.
Definition: GeomHelper.cpp:179
double compute(const SUMOEmissionClass c, const PollutantsInterface::EmissionType e, const double v, const double a, const double slope, const EnergyParams *param) const
Computes the emitted pollutant amount using the given speed and acceleration.
double getChargingPower(bool usingFuel) const
Get charging station's charging power in the.
bool getChargeInTransit() const
Get chargeInTransit.
void setChargingVehicle(bool value)
enable or disable charging vehicle
void addChargeValueForOutput(double WCharged, MSDevice_Battery *battery)
add charge value for output
SUMOTime getChargeDelay() const
Get Charge Delay.
double getEfficency() const
Get efficiency of the charging station.
Battery device for electric vehicles.
SUMOTime getChargingStartTime() const
Get charging start time.
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_Example-options.
MSDevice_Battery(SUMOVehicle &holder, const std::string &id, const double actualBatteryCapacity, const double maximumBatteryCapacity, const double powerMax, const double stoppingThreshold)
Constructor.
void notifyParking()
called to update state for parking vehicles
int myVehicleStopped
Parameter, How many timestep the vehicle is stopped.
bool myChargingInTransit
Parameter, Flag: Vehicles it's charging in transit (by default is false)
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
double getActualBatteryCapacity() const
Get the actual vehicle's Battery Capacity in Wh.
int getVehicleStopped() const
Get number of timestep that vehicle is stopped.
double myMaximumBatteryCapacity
Parameter, The total vehicles's Battery Capacity in Wh, [myMaximumBatteryCapacity >= 0].
void increaseVehicleStoppedTimer()
Increase myVehicleStopped.
double myActualBatteryCapacity
Parameter, The actual vehicles's Battery Capacity in Wh, [myActualBatteryCapacity <= myMaximumBattery...
double myPowerMax
Parameter, The Maximum Power when accelerating, [myPowerMax >= 0].
bool notifyMove(SUMOTrafficObject &veh, double oldPos, double newPos, double newSpeed)
Checks for waiting steps when the vehicle moves.
void increaseChargingStartTime()
Increase Charging Start time.
MSChargingStation * myPreviousNeighbouringChargingStation
Parameter, Pointer to charging station neighbouring with myActChargingStation in which vehicle was pl...
void setStoppingThreshold(const double stoppingThreshold)
Set vehicle's stopping threshold.
double getMaximumBatteryCapacity() const
Get the total vehicle's Battery Capacity in Wh.
bool myChargingStopped
Parameter, Flag: Vehicles it's charging stopped (by default is false)
double getConsum() const
Get consum.
void setActualBatteryCapacity(const double actualBatteryCapacity)
Set actual vehicle's Battery Capacity in kWh.
bool myTrackFuel
whether to track fuel consumption instead of electricity
void setPowerMax(const double new_Pmax)
Set maximum power when accelerating.
double getMaximumPower() const
Get the maximum power when accelerating.
double myEnergyCharged
Parameter, Energy charged in each timestep.
double myLastAngle
Parameter, Vehicle's last angle.
double getStoppingThreshold() const
Get stopping threshold.
double myTotalRegenerated
Parameter, total vehicle energy regeneration.
SUMOTime myChargingStartTime
Parameter, Moment, wich the vehicle has beging to charging.
bool isChargingInTransit() const
Get true if Vehicle it's charging, false if not.
std::string getParameter(const std::string &key) const
try to retrieve the given parameter from this device. Throw exception for unsupported key
void resetChargingStartTime()
Reset charging start time.
double myTotalConsumption
Parameter, total vehicle energy consumption.
const std::string deviceName() const
return the name for this type of device
void resetVehicleStoppedTimer()
Reset myVehicleStopped.
void setParameter(const std::string &key, const std::string &value)
try to set the given parameter for this device. Throw exception for unsupported key
double getTotalRegenerated() const
Get total regenerated.
double getTotalConsumption() const
Get total consumption.
MSChargingStation * myActChargingStation
Parameter, Pointer to current charging station in which vehicle is placed (by default is NULL)
~MSDevice_Battery()
Destructor.
double myConsum
Parameter, Vehicle consum during a time step (by default is 0.)
double getEnergyCharged() const
Get charged energy.
std::string getChargingStationID() const
Get current Charging Station ID.
void setMaximumBatteryCapacity(const double maximumBatteryCapacity)
Set total vehicle's Battery Capacity in kWh.
double myStoppingThreshold
Parameter, stopping vehicle threshold [myStoppingThreshold >= 0].
bool isChargingStopped() const
Get true if Vehicle is charging, false if not.
static void insertDefaultAssignmentOptions(const std::string &deviceName, const std::string &optionsTopic, OptionsCont &oc, const bool isPerson=false)
Adds common command options that allow to assign devices to vehicles.
Definition: MSDevice.cpp:144
static bool equippedByDefaultAssignmentOptions(const OptionsCont &oc, const std::string &deviceName, DEVICEHOLDER &v, bool outputOptionSet, const bool isPerson=false)
Determines whether a vehicle should get a certain device.
Definition: MSDevice.h:202
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:183
std::string getStoppingPlaceID(const MSLane *lane, const double pos, const SumoXMLTag category) const
Returns the stop of the given category close to the given position.
Definition: MSNet.cpp:1359
MSStoppingPlace * getStoppingPlace(const std::string &id, const SumoXMLTag category) const
Returns the named stopping place of the given category.
Definition: MSNet.cpp:1350
Abstract in-vehicle device.
SUMOVehicle & myHolder
The vehicle that stores the device.
SUMOEmissionClass getEmissionClass() const
Get this vehicle type's emission class.
const SUMOVTypeParameter & getParameter() const
const std::string & getID() const
Returns the id.
Definition: Named.h:74
A storage for options typed value containers)
Definition: OptionsCont.h:89
void addDescription(const std::string &name, const std::string &subtopic, const std::string &description)
Adds a description for an option.
void doRegister(const std::string &name, Option *o)
Adds an option under the given name.
Definition: OptionsCont.cpp:75
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:59
double getDouble(const std::string &key, const double defaultValue) const
Returns the value for a given key converted to a double.
virtual const std::string getParameter(const std::string &key, const std::string defaultValue="") const
Returns the value for a given key.
bool includesClass(const SUMOEmissionClass c) const
static const HelpersEnergy & getEnergyHelper()
get energy helper
static double compute(const SUMOEmissionClass c, const EmissionType e, const double v, const double a, const double slope, const EnergyParams *param)
Returns the amount of the emitted pollutant given the vehicle type and state (in mg/s or ml/s for fue...
Representation of a vehicle, person, or container.
virtual bool isVehicle() const
Whether it is a vehicle.
virtual double getAcceleration() const =0
Returns the object's acceleration.
virtual const MSVehicleType & getVehicleType() const =0
Returns the object's "vehicle" type.
virtual double getSlope() const =0
Returns the slope of the road at object's position in degrees.
virtual const MSLane * getLane() const =0
Returns the lane the object is currently at.
virtual double getSpeed() const =0
Returns the object's current speed.
virtual const SUMOVehicleParameter & getParameter() const =0
Returns the vehicle's parameter (including departure definition)
virtual double getPositionOnLane() const =0
Get the object's position along the lane.
Structure representing possible vehicle parameter.
Representation of a vehicle.
Definition: SUMOVehicle.h:62
virtual bool isParking() const =0
Returns the information whether the vehicle is parked.
virtual EnergyParams * getEmissionParameters() const =0
Returns the vehicle's emission model parameter.
virtual double getAngle() const =0
Get the vehicle's angle.
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
Definition: json.hpp:4471