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);
133 if (chargingStationID !=
"") {
214 const double powerMax,
const double stoppingTreshold,
const std::map<int, double>& param) :
221 myLastAngle(std::numeric_limits<double>::infinity()),
229 if (maximumBatteryCapacity < 0) {
235 if (actualBatteryCapacity > maximumBatteryCapacity) {
248 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 ...
bool notifyMove(SUMOTrafficObject &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) ...
double getStoppingTreshold() const
Get stopping treshold.
double getMaximumBatteryCapacity() const
Get the total vehicle's Battery Capacity in kWh.
std::map< int, double > myParam
Parameter collection.
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle's type.
virtual const std::string & getID() const =0
Get the vehicle's ID.
double myActualBatteryCapacity
Parameter, The actual vehicles's Battery Capacity in kWh, [myActualBatteryCapacity <= myMaximumBatter...
MSStoppingPlace * getStoppingPlace(const std::string &id, const SumoXMLTag category) const
Returns the named stopping place of the given category.
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.
void increaseVehicleStoppedTimer()
Increase myVehicleStopped.
#define DEFAULT_MAX_CAPACITY
double getChargingStartTime() const
Get charging start time.
double getActualBatteryCapacity() const
Get the actual vehicle's Battery Capacity in kWh.
Structure representing possible vehicle parameter.
virtual double getAcceleration() const =0
Returns the vehicle's acceleration.
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())
virtual bool isVehicle() const =0
Get the vehicle's ID.
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).
std::string getChargingStationID() const
Get current Charging Station ID.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
const std::string & getID() const
Returns the id.
int getVehicleStopped() const
Get number of timestep that vehicle is stopped.
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.
bool isChargingStopped() const
Get true if Vehicle is charging, false if not.
Helper methods for energy-based electricity consumption computation based on the battery device...
void setMaximumBatteryCapacity(const double maximumBatteryCapacity)
Set total vehicle's Battery Capacity in kWh.
bool getChargeInTransit() const
Get chargeInTransit.
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.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Representation of a vehicle.
#define DEFAULT_CHARGE_RATIO
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter ...
Recuperation efficiency (constant)
double getDefaultParam(int paramKey) const
void resetChargingStartTime()
Reset charging start time.
std::string getParameter(const std::string &key) const
try to retrieve the given parameter from this device. Throw exception for unsupported key ...
void setChargingVehicle(bool value)
enable or disable charging vehicle
double getChargeDelay() const
Get Charge Delay.
virtual double getSlope() const =0
Returns the slope of the road at vehicle's position.
double getEnergyCharged() const
Get charged energy.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice *> &into)
Build devices for the given vehicle, if needed.
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.
double myMaximumBatteryCapacity
Parameter, The total vehicles's Battery Capacity in kWh, [myMaximumBatteryCapacity >= 0]...
const std::string deviceName() const
return the name for this type of device
void setStoppingTreshold(const double stoppingTreshold)
Set vehicle's stopping treshold.
bool myChargingInTransit
Parameter, Flag: Vehicles it's charging in transit (by default is false)
const SUMOVTypeParameter & getParameter() const
double myConsum
Parameter, Vehicle consum during a time step (by default is 0.)
double getDouble(const std::string &key, const double defaultValue) const
Returns the value for a given key converted to a double.
double getEfficency() const
Get efficiency of the charging station.
virtual double getAngle() const =0
Get the vehicle's angle.
Battery device for electric vehicles.
double getMaximumPower() const
Get the maximum power when accelerating.
Representation of a vehicle or person.
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].
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 getChargingPower() const
Get charging station's charging power.
A storage for options typed value containers)
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
Abstract in-vehicle device.
Recuperation efficiency (by deceleration)
virtual double getPositionOnLane() const =0
Get the vehicle's position along the lane.
bool isChargingInTransit() const
Get true if Vehicle it's charging, false if not.
double myEnergyCharged
Parameter, Energy charged in each timestep.
double getConsum() const
Get consum.
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.
static const HelpersEnergy & getEnergyHelper()
get energy helper
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.
~MSDevice_Battery()
Destructor.