 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
37 #define DEFAULT_MAX_CAPACITY 35000
38 #define DEFAULT_CHARGE_RATIO 0.5
59 std::map<int, double> param;
64 double actualBatteryCapacity = 0;
87 actualBatteryCapacity, maximumBatteryCapacity, powerMax, stoppingTreshold, param);
90 into.push_back(device);
99 SUMOVehicle& veh = static_cast<SUMOVehicle&>(tObject);
133 if (chargingStationID !=
"") {
214 const double powerMax,
const double stoppingTreshold,
const std::map<int, double>& param) :
216 myActualBatteryCapacity(0),
217 myMaximumBatteryCapacity(0),
219 myStoppingTreshold(0),
221 myLastAngle(std::numeric_limits<double>::infinity()),
222 myChargingStopped(false),
223 myChargingInTransit(false),
225 myActChargingStation(nullptr),
227 myVehicleStopped(0) {
229 if (maximumBatteryCapacity < 0) {
235 if (actualBatteryCapacity > maximumBatteryCapacity) {
248 if (stoppingTreshold < 0) {
282 if (actualBatteryCapacity < 0) {
314 if (stoppingTreshold < 0) {
void checkParam(const SumoXMLAttr paramKey, const double lower=0., const double upper=std::numeric_limits< double >::infinity())
~MSDevice_Battery()
Destructor.
double getChargingPower() const
Get charging station's charging power.
Representation of a vehicle or person.
double getMaximumBatteryCapacity() const
Get the total vehicle's Battery Capacity in kWh.
static const HelpersEnergy & getEnergyHelper()
get energy helper
virtual double getAngle() const =0
Get the vehicle's angle.
std::string getChargingStationID() const
Get current Charging Station ID.
#define WRITE_WARNING(msg)
double getStoppingTreshold() const
Get stopping treshold.
static double angleDiff(const double angle1, const double angle2)
Returns the difference of the second angle to the first angle in radiants.
double compute(const SUMOEmissionClass c, const PollutantsInterface::EmissionType e, const double v, const double a, const double slope, const std::map< int, double > *param) const
Computes the emitted pollutant amount using the given speed and acceleration.
virtual const SUMOVehicleParameter & getParameter() const =0
Returns the vehicle's parameter (including departure definition)
virtual double getAcceleration() const =0
Returns the vehicle's acceleration.
double myEnergyCharged
Parameter, Energy charged in each timestep.
double getEnergyCharged() const
Get charged energy.
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle's type.
virtual bool isVehicle() const =0
Get the vehicle's ID.
double getActualBatteryCapacity() const
Get the actual vehicle's Battery Capacity in kWh.
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
virtual const std::string & getID() const =0
Get the vehicle's ID.
std::string getParameter(const std::string &key) const
try to retrieve the given parameter from this device. Throw exception for unsupported key
double myConsum
Parameter, Vehicle consum during a time step (by default is 0.)
Representation of a vehicle.
static OptionsCont & getOptions()
Retrieves the options.
bool notifyMove(SUMOTrafficObject &veh, double oldPos, double newPos, double newSpeed)
Checks for waiting steps when the vehicle moves.
void setStoppingTreshold(const double stoppingTreshold)
Set vehicle's stopping treshold.
void setActualBatteryCapacity(const double actualBatteryCapacity)
Set actual vehicle's Battery Capacity in kWh.
double getDefaultParam(int paramKey) const
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.
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
void setChargingVehicle(bool value)
enable or disable charging vehicle
double getEfficency() const
Get efficiency of the charging station.
const std::string deviceName() const
return the name for this type of device
double myActualBatteryCapacity
Parameter, The actual vehicles's Battery Capacity in kWh, [myActualBatteryCapacity <= myMaximumBatter...
Recuperation efficiency (constant)
bool myChargingInTransit
Parameter, Flag: Vehicles it's charging in transit (by default is false)
int myVehicleStopped
Parameter, How many timestep the vehicle is stopped.
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.
void increaseVehicleStoppedTimer()
Increase myVehicleStopped.
Helper methods for energy-based electricity consumption computation based on the battery device.
double myPowerMax
Parameter, The Maximum Power when accelerating, [myPowerMax >= 0].
Structure representing possible vehicle parameter.
virtual MSLane * getLane() const =0
Returns the lane the vehicle is on.
void increaseChargingStartTime()
Increase Charging Start time.
virtual double getSlope() const =0
Returns the slope of the road at vehicle's position.
A storage for options typed value containers)
Battery device for electric vehicles.
#define DEFAULT_MAX_CAPACITY
void resetVehicleStoppedTimer()
Reset myVehicleStopped.
double getConsum() const
Get consum.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
MSDevice_Battery(SUMOVehicle &holder, const std::string &id, const double actualBatteryCapacity, const double maximumBatteryCapacity, const double powerMax, const double stoppingTreshold, const std::map< int, double > ¶m)
Constructor.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
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.
double myStoppingTreshold
Parameter, stopping vehicle treshold [myStoppingTreshold >= 0].
Internal moment of inertia.
void resetChargingStartTime()
Reset charging start time.
double myMaximumBatteryCapacity
Parameter, The total vehicles's Battery Capacity in kWh, [myMaximumBatteryCapacity >= 0].
const SUMOVTypeParameter & getParameter() const
bool myChargingStopped
Parameter, Flag: Vehicles it's charging stopped (by default is false)
void setPowerMax(const double new_Pmax)
Set maximum power when accelerating.
double myChargingStartTime
Parameter, Moment, wich the vehicle has beging to charging.
std::map< int, double > myParam
Parameter collection.
bool isChargingInTransit() const
Get true if Vehicle it's charging, false if not.
double myLastAngle
Parameter, Vehicle's last angle.
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_Example-options.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
void addChargeValueForOutput(double WCharged, MSDevice_Battery *battery)
add charge value for output
MSChargingStation * myActChargingStation
Parameter, Pointer to current charging station in which vehicle is placed (by default is NULL)
void setMaximumBatteryCapacity(const double maximumBatteryCapacity)
Set total vehicle's Battery Capacity in kWh.
bool isChargingStopped() const
Get true if Vehicle is charging, false if not.
double getMaximumPower() const
Get the maximum power when accelerating.
virtual double getPositionOnLane() const =0
Get the vehicle's position along the lane.
Recuperation efficiency (by deceleration)
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
double getChargeDelay() const
Get Charge Delay.
double getChargingStartTime() const
Get charging start time.
const std::string & getID() const
Returns the id.
int getVehicleStopped() const
Get number of timestep that vehicle is stopped.
bool getChargeInTransit() const
Get chargeInTransit.
#define DEFAULT_CHARGE_RATIO
double getDouble(const std::string &key, const double defaultValue) const
Returns the value for a given key converted to a double.
virtual double getSpeed() const =0
Returns the vehicle's current speed.
void setParameter(const std::string &key, const std::string &value)
try to set the given parameter for this device. Throw exception for unsupported key
Abstract in-vehicle device.