SUMO - Simulation of Urban MObility
MSDevice_Battery.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // The Battery parameters for the vehicle
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
11 // Copyright (C) 2013-2015 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #ifndef MSDevice_Battery_h
33 #define MSDevice_Battery_h
34 
36 #include <microsim/MSVehicle.h>
38 #include <utils/common/SUMOTime.h>
39 #include <iostream>
40 #include <sstream>
41 #include <string>
42 
43 
44 // ===========================================================================
45 // class declarations
46 // ===========================================================================
47 class SUMOVehicle;
48 
49 
50 // ===========================================================================
51 // class definitions
52 // ===========================================================================
60 class MSDevice_Battery : public MSDevice {
61 public:
65  static void insertOptions(OptionsCont& oc);
66 
67 
78  static void buildVehicleDevices(SUMOVehicle& v, std::vector<MSDevice*>& into);
79 
80 
81 public:
84 
87 
97  bool notifyMove(SUMOVehicle& veh, SUMOReal oldPos,
98  SUMOReal newPos, SUMOReal newSpeed);
99 
100 
110 
111 
123 
132  void generateOutput() const;
133 
134 
135 private:
143  MSDevice_Battery(SUMOVehicle& holder, const std::string& id, const SUMOReal new_ActBatKap, const SUMOReal new_MaxBatKap, const SUMOReal new_PowerMax, const SUMOReal new_Mass, const SUMOReal new_FrontSurfaceArea, const SUMOReal new_AirDragCoefficient, const SUMOReal new_InternalMomentOfInertia, const SUMOReal new_RadialDragCoefficient, const SUMOReal new_RollDragCoefficient, const SUMOReal new_ConstantPowerIntake, const SUMOReal new_PropulsionEfficiency, const SUMOReal new_RecuperationEfficiency, const SUMOReal new_LastAngle, const SUMOReal new_LastEnergy);
144 
145 
146 public:
147  // GET FUNCTIONS
148 
151 
154 
156  inline SUMOReal getMaximumPower() const;
157 
159  inline SUMOReal getMass() const;
160 
162  inline SUMOReal getFrontSurfaceArea() const;
163 
165  inline SUMOReal getAirDragCoefficient() const;
166 
168  inline SUMOReal getInternalMomentOfInertia() const;
169 
171  inline SUMOReal getRadialDragCoefficient() const;
172 
174  inline SUMOReal getRollDragCoefficient() const;
175 
177  inline SUMOReal getConstantPowerIntake() const;
178 
180  inline SUMOReal getPropulsionEfficiency() const;
181 
183  inline SUMOReal getRecuperationEfficiency() const;
184 
186  inline SUMOReal getLastAngle() const;
187 
189  inline SUMOReal getLastEnergy() const;
190 
192  bool isChargingStopped() const;
193 
195  bool isChargingInTransit() const;
196 
198  inline SUMOReal getChargingStartTime() const;
199 
201  SUMOReal getConsum() const;
202 
204  const std::string& getChargingStationID() const;
205 
207  SUMOReal getChrgEnergy() const;
208 
210  int getVehicleStopped() const;
211 
214 
215 
216  // SET FUNCTIONS
217 
219  inline void setActualBatteryCapacity(const SUMOReal new_ActBatKap);
220 
222  inline void setMaximumBatteryCapacity(const SUMOReal new_MaxBatKap);
223 
225  inline void setPowerMax(const SUMOReal new_Pmax);
226 
228  inline void setMass(const SUMOReal new_Mass);
229 
231  inline void setFrontSurfaceArea(const SUMOReal new_FrontSurfaceArea);
232 
234  inline void setAirDragCoefficient(const SUMOReal new_C_Veh);
235 
237  inline void setInternalMomentOfInertia(const SUMOReal new_InternalMomentOfInertia);
238 
240  inline void setRadialDragCoefficient(const SUMOReal new_RadialDragCoefficient);
241 
243  inline void setRollDragCoefficient(const SUMOReal new_RollDragCoefficient);
244 
246  inline void setConstantPowerIntake(const SUMOReal new_ConstantPowerIntake);
247 
249  inline void setPropulsionEfficiency(const SUMOReal new_PropulsionEfficiency);
250 
252  inline void setRecuperationEfficiency(const SUMOReal new_RecuperationEfficiency);
253 
255  inline void setLastAngle(const SUMOReal new_LastAngle);
256 
258  inline void setLastEnergy(const SUMOReal new_LastEnergy);
259 
261  inline void resetChargingStartTime();
262 
264  inline void increaseChargingStartTime();
265 
267  inline void resetVehicleStoppedTimer();
268 
270  inline void increaseVehicleStoppedTimer();
271 
272 private:
273 
277 
281 
285 
289 
293 
297 
301 
305 
309 
313 
317 
321 
325 
329 
333 
337 
341 
345 
348  std::string actChargingStation;
349 
352 
355 
356 
361  std::string SUMOReal_str(const SUMOReal& var);
362 
363 
366 
367 
370 };
371 
372 #endif
373 
bool isChargingStopped() const
Get parameter 15, true if Vehicle it's charging, false if not.
SUMOReal getPropEnergy(SUMOVehicle &veh)
get propulsion energy
void setFrontSurfaceArea(const SUMOReal new_FrontSurfaceArea)
Set parameter 05, vehicle's front surface Area.
SUMOReal getFrontSurfaceArea() const
Get parameter 05, vehicle's front surface Area.
SUMOReal getConsum() const
Get parameter 18, consum (Strange error with linker)
void setPowerMax(const SUMOReal new_Pmax)
Set parameter 03, The maximum power when accelerating.
SUMOReal ActBatKap
Parameter 01, The actual vehicles' Battery Capacity in kWh [ActBatKap <= MaxBatKap].
void increaseVehicleStoppedTimer()
Set parameter 21a, increase vehicleStopped.
SUMOReal ChargingStartTime
Parameter 17, Moment, wich the vehicle has beging to charging none.
Notification
Definition of a vehicle state.
SUMOReal energyCharged
Parameter 20, Energy charged in each timestep.
void setConstantPowerIntake(const SUMOReal new_ConstantPowerIntake)
Set parameter 10, vehicles' constant power intake.
SUMOReal getRadialDragCoefficient() const
Get parameter 08, vehicles' radial friction coefficient.
int getVehicleStopped() const
Get parameter 20, charging energy.
bool notifyMove(SUMOVehicle &veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed)
Checks for waiting steps when the vehicle moves // IMPLEMENTADA!!
SUMOReal getRollDragCoefficient() const
Get parameter 09, vehicles' roll friction coefficient.
SUMOReal MaxBatKap
Parameter 02, The total vehicles' Battery Capacity in kWh [MaxBatKap >= 0].
SUMOReal getAirDragCoefficient() const
Get parameter 06, vehicle's drag coefficient.
SUMOReal getMaximumPower() const
Get parameter 03, the maximum power when accelerating.
void setMaximumBatteryCapacity(const SUMOReal new_MaxBatKap)
Set parameter 02, The total vehicles' Battery Capacity in kWh.
SUMOReal getConstantPowerIntake() const
Get parameter 10, vehicles' constant power intake.
void resetVehicleStoppedTimer()
Set parameter 21a, reset vehicleStopped.
int vehicleStopped
Parameter 21, How many timestep the vehicle is stopped.
std::string SUMOReal_str(const SUMOReal &var)
convert from SUMOReal to String
Representation of a vehicle.
Definition: SUMOVehicle.h:65
SUMOReal PowerMax
Parameter 03, The Maximum Power when accelerating [PowerMax >= 0].
SUMOReal getLastAngle() const
Get parameter 13, vehicles' last angle.
SUMOReal RollDragCoefficient
Parameter 09, Vehicles' roll friction coefficient [RollDragCoefficient >= 0].
bool ItsChargingStopped
Parameter 15, Flag: Vehicles it's charging stopped by default is false.
void resetChargingStartTime()
Set parameter 17a, reset charging start time.
void setMass(const SUMOReal new_Mass)
Set parameter 04, vehicle's Mass.
SUMOReal getActualBatteryCapacity() const
Get parameter 01, the actual vehicles' Battery Capacity in kWh.
SUMOReal LastEnergy
Parameter 14, Vehicles' last energy none.
SUMOReal getPropulsionEfficiency() const
Get parameter 11, vehicles' Propulsion efficiency.
bool isChargingInTransit() const
Get parameter 16, true if Vehicle it's charging, false if not.
MSDevice_Battery & operator=(const MSDevice_Battery &)
Invalidated assignment operator.
SUMOReal LastAngle
Parameter 13, Vehicles' last angle none.
SUMOReal getChrgEnergy() const
Get parameter 20, charging energy.
SUMOReal getChargingStartTime() const
Get parameter 17, charging start time.
SUMOReal PropulsionEfficiency
Parameter 11, Vehicles' propulsion efficiency [1 >= PropulsionEfficiency >= 0].
bool ItsChargingInTransit
Parameter 16, Flag: Vehicles it's charging in transit by default is false.
MSDevice_Battery(SUMOVehicle &holder, const std::string &id, const SUMOReal new_ActBatKap, const SUMOReal new_MaxBatKap, const SUMOReal new_PowerMax, const SUMOReal new_Mass, const SUMOReal new_FrontSurfaceArea, const SUMOReal new_AirDragCoefficient, const SUMOReal new_InternalMomentOfInertia, const SUMOReal new_RadialDragCoefficient, const SUMOReal new_RollDragCoefficient, const SUMOReal new_ConstantPowerIntake, const SUMOReal new_PropulsionEfficiency, const SUMOReal new_RecuperationEfficiency, const SUMOReal new_LastAngle, const SUMOReal new_LastEnergy)
Constructor.
SUMOReal getRecuperationEfficiency() const
Get parameter 12, vehicles' Recuparation efficiency.
void setRadialDragCoefficient(const SUMOReal new_RadialDragCoefficient)
Set parameter 08, Vehicles' radial friction coefficient.
SUMOReal Consum
Parameter 18, Vehicle consum during a time step by default is 0.
Abstract in-vehicle device.
Definition: MSDevice.h:69
void setRollDragCoefficient(const SUMOReal new_RollDragCoefficient)
Set parameter 09, vehicles' roll friction coefficient.
void setRecuperationEfficiency(const SUMOReal new_RecuperationEfficiency)
Set parameter 12, vehicles' Recuparation efficiency.
The battery parametereter.
SUMOReal getLastEnergy() const
Get parameter 14, vehicles' last Energy.
SUMOReal InternalMomentOfInertia
Parameter 07, Vehicles' internal moment of inertia [InternalMomentOfInertia >= 0].
SUMOReal RadialDragCoefficient
Parameter 08, Vehicles' radial friction coefficient [RadialDragCoefficient >=0]. ...
SUMOReal Mass
Parameter 04, Vehicle's Mass [Mass >= 0].
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSDevice * > &into)
Build devices for the given vehicle, if needed.
void increaseChargingStartTime()
Set parameter 17b, increase Charging Start time.
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_Example-options.
void setPropulsionEfficiency(const SUMOReal new_PropulsionEfficiency)
Set parameter 11, vehicles' Propulsion efficiency.
void setInternalMomentOfInertia(const SUMOReal new_InternalMomentOfInertia)
Set parameter 07, vehicles' internal moment of inertia.
A storage for options typed value containers)
Definition: OptionsCont.h:108
std::string actChargingStation
Parameter 19, Vehicle consum during a time step by default is "".
bool notifyEnter(SUMOVehicle &veh, MSMoveReminder::Notification reason)
Saves departure info on insertion.
SUMOReal AirDragCoefficient
Parameter 06, Vehicle's drag coefficient [AirDragCoefficient >=0].
void setLastEnergy(const SUMOReal new_LastEnergy)
Set parameter 14, vehicles' last Energy.
#define SUMOReal
Definition: config.h:215
SUMOReal FrontSurfaceArea
Parameter 05, Vehicle's front surface Area [FrontSurfaceArea >= 0].
void setActualBatteryCapacity(const SUMOReal new_ActBatKap)
Set parameter 01, The actual vehicles' Battery Capacity in kWh.
SUMOReal ConstantPowerIntake
Parameter 10, Vehicles' constant power intake [ConstantPowerIntake >= 0].
SUMOReal getMaximumBatteryCapacity() const
Get parameter 02, the total vehicles' Battery Capacity in kWh.
SUMOReal RecuperationEfficiency
Parameter 12, Vehicles' recuparation efficiency [1 >= RecuperationEfficiency >= 0].
void setAirDragCoefficient(const SUMOReal new_C_Veh)
Set parameter 06, vehicle's drag coefficient.
void generateOutput() const
Called on writing tripinfo output.
SUMOReal getInternalMomentOfInertia() const
Get parameter 07, vehicles' internal moment of inertia.
void setLastAngle(const SUMOReal new_LastAngle)
Set parameter 13, vehicles' last Angle.
SUMOReal getMass() const
Get parameter 04, vehicle's Mass.
const std::string & getChargingStationID() const
Get parameter 19, Charging Station I.
~MSDevice_Battery()
Destructor.