43 #define DEFAULT_MAX_CAPACITY 35000 44 #define DEFAULT_CHARGE_RATIO 0.5 65 std::map<int, double> param;
70 double actualBatteryCapacity = 0;
92 actualBatteryCapacity, maximumBatteryCapacity, powerMax, stoppingTreshold, param);
95 into.push_back(device);
134 if (chargingStationID !=
"") {
215 const double powerMax,
const double stoppingTreshold,
const std::map<int, double>& param) :
222 myLastAngle(std::numeric_limits<double>::infinity()),
230 if (maximumBatteryCapacity < 0) {
236 if (actualBatteryCapacity > maximumBatteryCapacity) {
249 if (stoppingTreshold < 0) {
282 if (actualBatteryCapacity < 0) {
314 if (stoppingTreshold < 0) {
void addChargeValueForOutput(double WCharged, MSDevice_Battery *battery)
add charge value for output
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 getConsum() const
Get consum.
bool isChargingStopped() const
Get true if Vehicle is charging, false if not.
bool notifyMove(SUMOVehicle &veh, double oldPos, double newPos, double newSpeed)
Checks for waiting steps when the vehicle moves.
Internal moment of inertia.
MSChargingStation * myActChargingStation
Parameter, Pointer to current charging station in which vehicle is placed (by default is NULL) ...
std::map< int, double > myParam
Parameter collection.
double getMaximumPower() const
Get the maximum power when accelerating.
double myActualBatteryCapacity
Parameter, The actual vehicles's Battery Capacity in kWh, [myActualBatteryCapacity <= myMaximumBatter...
void increaseVehicleStoppedTimer()
Increase myVehicleStopped.
#define DEFAULT_MAX_CAPACITY
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.
Structure representing possible vehicle parameter.
double getActualBatteryCapacity() const
Get the actual vehicle's Battery Capacity in kWh.
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.
void checkParam(const SumoXMLAttr paramKey, const double lower=0., const double upper=std::numeric_limits< double >::infinity())
int myVehicleStopped
Parameter, How many timestep the vehicle is stopped.
virtual MSLane * getLane() const =0
Returns the lane the vehicle is on.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
virtual double getSlope() const =0
Returns the slope of the road at vehicle's position.
double getDouble(const std::string &key, const double defaultValue) const
Returns the value for a given key converted to a double.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
int getVehicleStopped() const
Get number of timestep that vehicle is stopped.
double getStoppingTreshold() const
Get stopping treshold.
bool myChargingStopped
Parameter, Flag: Vehicles it's charging stopped (by default is false)
void setPowerMax(const double new_Pmax)
Set maximum power when accelerating.
#define WRITE_WARNING(msg)
static OptionsCont & getOptions()
Retrieves the options.
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.
Helper methods for energy-based electricity consumption computation based on the battery device...
std::string getChargingStationID() const
Get current Charging Station ID.
MSStoppingPlace * getStoppingPlace(const std::string &id, const SumoXMLTag category) const
Returns the named stopping place of the given category.
void setMaximumBatteryCapacity(const double maximumBatteryCapacity)
Set total vehicle's Battery Capacity in kWh.
double getMaximumBatteryCapacity() const
Get the total vehicle's Battery Capacity in kWh.
const std::string & getID() const
Returns the id.
void setActualBatteryCapacity(const double actualBatteryCapacity)
Set actual vehicle's Battery Capacity in kWh.
void resetVehicleStoppedTimer()
Reset myVehicleStopped.
double myChargingStartTime
Parameter, Moment, wich the vehicle has beging to charging.
const SUMOVTypeParameter & getParameter() const
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Representation of a vehicle.
#define DEFAULT_CHARGE_RATIO
double getChargingStartTime() const
Get charging start time.
const std::string deviceName() const
return the name for this type of device
bool getChargeInTransit() const
Get chargeInTransit.
double getDefaultParam(int paramKey) const
void resetChargingStartTime()
Reset charging start time.
void setChargingVehicle(bool value)
enable or disable charging vehicle
std::string getParameter(const std::string &key) const
try to retrieve the given parameter from this device. Throw exception for unsupported key ...
static void insertDefaultAssignmentOptions(const std::string &deviceName, const std::string &optionsTopic, OptionsCont &oc)
Adds common command options that allow to assign devices to vehicles.
double getEnergyCharged() const
Get charged energy.
bool isChargingInTransit() const
Get true if Vehicle it's charging, false if not.
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
double myMaximumBatteryCapacity
Parameter, The total vehicles's Battery Capacity in kWh, [myMaximumBatteryCapacity >= 0]...
void setStoppingTreshold(const double stoppingTreshold)
Set vehicle's stopping treshold.
bool myChargingInTransit
Parameter, Flag: Vehicles it's charging in transit (by default is false)
double myConsum
Parameter, Vehicle consum during a time step (by default is 0.)
Abstract in-vehicle device.
static bool equippedByDefaultAssignmentOptions(const OptionsCont &oc, const std::string &deviceName, SUMOVehicle &v)
Determines whether a vehicle should get a certain device.
virtual double getAngle() const =0
Get the vehicle's angle.
Battery device for electric vehicles.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSDevice * > &into)
Build devices for the given vehicle, if needed.
double myStoppingTreshold
Parameter, stopping vehicle treshold [myStoppingTreshold >= 0].
virtual double getPositionOnLane() const =0
Get the vehicle's position along the lane.
void increaseChargingStartTime()
Increase Charging Start time.
virtual const SUMOVehicleParameter & getParameter() const =0
Returns the vehicle's parameter (including departure definition)
double myLastAngle
Parameter, Vehicle's last angle.
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_Example-options.
double getChargeDelay() const
Get Charge Delay.
double getChargingPower() const
Get charging station's charging power.
A storage for options typed value containers)
static double _2double(const E *const data)
converts a char-type array into the double value described by it
double getEfficency() const
Get efficiency of the charging station.
double myEnergyCharged
Parameter, Energy charged in each timestep.
static double angleDiff(const double angle1, const double angle2)
Returns the difference of the second angle to the first angle in radiants.
double myPowerMax
Parameter, The Maximum Power when accelerating, [myPowerMax >= 0].
virtual double getSpeed() const =0
Returns the vehicle's current speed.
virtual const std::string & getID() const =0
Get the vehicle's ID.
static const HelpersEnergy & getEnergyHelper()
~MSDevice_Battery()
Destructor.
virtual double getAcceleration() const =0
Returns the vehicle's acceleration.
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle's type.