44 #define DEFAULT_MAX_CAPACITY 35000 45 #define DEFAULT_CHARGE_RATIO 0.5 66 std::map<int, double> param;
71 double actualBatteryCapacity = 0;
93 actualBatteryCapacity, maximumBatteryCapacity, powerMax, stoppingTreshold, param);
96 into.push_back(device);
135 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
virtual MSLane * getLane() const =0
Returns the lane the vehicle is on.
virtual double getAngle() const =0
Get the vehicle's angle.
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.
virtual double getSlope() const =0
Returns the slope of the road at vehicle's position.
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.
MSChargingStation * getChargingStation(const std::string &id) const
Returns the named charging station.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
virtual double getPositionOnLane() const =0
Get the vehicle's position along the lane.
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.
const std::string & getParameter(const std::string &key, const std::string &defaultValue) const
Returns the value for a given key.
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.
virtual double getAcceleration() const =0
Returns the vehicle's acceleration.
Helper methods for energy-based electricity consumption computation based on the battery device...
std::string getChargingStationID() const
Get current Charging Station ID.
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.
virtual double getSpeed() const =0
Returns the vehicle's current speed.
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 getChargingStationID(const MSLane *lane, const double pos) const
Returns the charging station close to the given position.
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.
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle's type.
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.
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].
void increaseChargingStartTime()
Increase Charging Start time.
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
virtual const std::string & getID() const =0
Get the vehicle's ID.
virtual const SUMOVehicleParameter & getParameter() const =0
Returns the vehicle's parameter (including departure definition)
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].
static const HelpersEnergy & getEnergyHelper()
~MSDevice_Battery()
Destructor.