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-2016 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 
40 
41 // ===========================================================================
42 // class declarations
43 // ===========================================================================
44 class SUMOVehicle;
45 
46 
47 // ===========================================================================
48 // class definitions
49 // ===========================================================================
54 class MSDevice_Battery : public MSDevice {
55 public:
59  static void insertOptions(OptionsCont& oc);
60 
71  static void buildVehicleDevices(SUMOVehicle& v, std::vector<MSDevice*>& into);
72 
73 public:
76 
79 
88  bool notifyMove(SUMOVehicle& veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed);
89 
100 
107  void generateOutput() const;
108 
109 private:
117  MSDevice_Battery(SUMOVehicle& holder, const std::string& id, const SUMOReal actualBatteryCapacity, const SUMOReal maximumBatteryCapacity, const SUMOReal powerMax, const SUMOReal mass, const SUMOReal frontSurfaceArea, const SUMOReal airDragCoefficient, const SUMOReal internalMomentOfInertia, const SUMOReal radialDragCoefficient, const SUMOReal rollDragCoefficient, const SUMOReal constantPowerIntake, const SUMOReal propulsionEfficiency, const SUMOReal recuperationEfficiency, const SUMOReal lastAngle, const SUMOReal lastEnergy);
118 
119 public:
122 
125 
127  SUMOReal getMaximumPower() const;
128 
130  SUMOReal getMass() const;
131 
134 
137 
140 
143 
146 
149 
152 
155 
157  SUMOReal getLastAngle() const;
158 
160  SUMOReal getLastEnergy() const;
161 
163  bool isChargingStopped() const;
164 
166  bool isChargingInTransit() const;
167 
170 
172  SUMOReal getConsum() const;
173 
175  std::string getChargingStationID() const;
176 
178  SUMOReal getEnergyCharged() const;
179 
181  int getVehicleStopped() const;
182 
185 
187  void setActualBatteryCapacity(const SUMOReal actualBatteryCapacity);
188 
190  void setMaximumBatteryCapacity(const SUMOReal maximumBatteryCapacity);
191 
193  void setPowerMax(const SUMOReal new_Pmax);
194 
196  void setMass(const SUMOReal mass);
197 
199  void setFrontSurfaceArea(const SUMOReal frontSurfaceArea);
200 
202  void setAirDragCoefficient(const SUMOReal new_C_Veh);
203 
205  void setInternalMomentOfInertia(const SUMOReal internalMomentOfInertia);
206 
208  void setRadialDragCoefficient(const SUMOReal radialDragCoefficient);
209 
211  void setRollDragCoefficient(const SUMOReal rollDragCoefficient);
212 
214  void setConstantPowerIntake(const SUMOReal constantPowerIntake);
215 
217  void setPropulsionEfficiency(const SUMOReal propulsionEfficiency);
218 
220  void setRecuperationEfficiency(const SUMOReal recuperationEfficiency);
221 
223  void setLastAngle(const SUMOReal lastAngle);
224 
226  void setLastEnergy(const SUMOReal lastEnergy);
227 
229  void resetChargingStartTime();
230 
233 
236 
239 
240 protected:
244 
248 
252 
256 
260 
264 
268 
272 
276 
280 
284 
288 
292 
296 
300 
304 
308 
312 
316 
319 
322 
323 private:
326 
329 };
330 
331 #endif
332 
SUMOReal getPropEnergy(SUMOVehicle &veh)
get propulsion energy
void setFrontSurfaceArea(const SUMOReal frontSurfaceArea)
Set vehicle&#39;s front surface Area.
SUMOReal myActualBatteryCapacity
Parameter, The actual vehicles&#39;s Battery Capacity in kWh [myActualBatteryCapacity <= myMaximumBatter...
SUMOReal getLastEnergy() const
Get vehicles&#39;s last Energy.
MSChargingStation * myActChargingStation
Parameter, Pointer to current charging station in which vehicle is placed by default is NULL...
void setLastEnergy(const SUMOReal lastEnergy)
Set vehicle&#39;s last Energy.
void setPowerMax(const SUMOReal new_Pmax)
Set maximum power when accelerating.
SUMOReal myFrontSurfaceArea
Parameter, Vehicle&#39;s front surface Area [myFrontSurfaceArea >= 0].
void setRollDragCoefficient(const SUMOReal rollDragCoefficient)
Set vehicle&#39;s roll friction coefficient.
SUMOReal getMaximumBatteryCapacity() const
Get the total vehicle&#39;s Battery Capacity in kWh.
void increaseVehicleStoppedTimer()
Increase myVehicleStopped.
SUMOReal getEnergyCharged() const
Get charged energy.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSDevice *> &into)
Build devices for the given vehicle, if needed.
SUMOReal myChargingStartTime
Parameter, Moment, wich the vehicle has beging to charging none.
void setActualBatteryCapacity(const SUMOReal actualBatteryCapacity)
Set actual vehicle&#39;s Battery Capacity in kWh.
int myVehicleStopped
Parameter, How many timestep the vehicle is stopped.
SUMOReal myLastAngle
Parameter, Vehicle&#39;s last angle none.
SUMOReal getFrontSurfaceArea() const
Get vehicle&#39;s front surface Area.
Notification
Definition of a vehicle state.
SUMOReal getLastAngle() const
Get vehicles&#39;s last angle.
SUMOReal getActualBatteryCapacity() const
Get the actual vehicle&#39;s Battery Capacity in kWh.
std::string getChargingStationID() const
Get current Charging Station ID.
SUMOReal getRecuperationEfficiency() const
Get vehicles&#39;s Recuparation efficiency.
SUMOReal getPropulsionEfficiency() const
Get vehicles&#39;s Propulsion efficiency.
bool notifyMove(SUMOVehicle &veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed)
Checks for waiting steps when the vehicle moves.
int getVehicleStopped() const
Get number of timestep that vehicle is stopped.
SUMOReal myAirDragCoefficient
Parameter, Vehicle&#39;s drag coefficient [myAirDragCoefficient >=0].
bool myChargingStopped
Parameter, Flag: Vehicles it&#39;s charging stopped by default is false.
SUMOReal getAirDragCoefficient() const
Get vehicle&#39;s drag coefficient.
SUMOReal myPropulsionEfficiency
Parameter, Vehicle&#39;s propulsion efficiency [1 >= myPropulsionEfficiency >= 0].
bool isChargingStopped() const
Get true if Vehicle is charging, false if not.
SUMOReal myPowerMax
Parameter, The Maximum Power when accelerating [myPowerMax >= 0].
SUMOReal getRollDragCoefficient() const
Get vehicles&#39;s roll friction coefficient.
SUMOReal myConsum
Parameter, Vehicle consum during a time step by default is 0.
void setRadialDragCoefficient(const SUMOReal radialDragCoefficient)
Set vehicle&#39;s radial friction coefficient.
void resetVehicleStoppedTimer()
Reset myVehicleStopped.
SUMOReal myLastEnergy
Parameter, Vehicle&#39;s last energy none.
void setPropulsionEfficiency(const SUMOReal propulsionEfficiency)
Set vehicle&#39;s Propulsion efficiency.
Representation of a vehicle.
Definition: SUMOVehicle.h:66
void setMass(const SUMOReal mass)
Set vehicle&#39;s myMass.
SUMOReal getConstantPowerIntake() const
Get vehicles&#39;s constant power intake.
SUMOReal myMaximumBatteryCapacity
Parameter, The total vehicles&#39;s Battery Capacity in kWh [myMaximumBatteryCapacity >= 0]...
void setLastAngle(const SUMOReal lastAngle)
Set vehicle&#39;s last Angle.
void resetChargingStartTime()
Reset charging start time.
SUMOReal getInternalMomentOfInertia() const
Get vehicles&#39;s internal moment of inertia.
void setRecuperationEfficiency(const SUMOReal recuperationEfficiency)
Set vehicle&#39;s Recuparation efficiency.
MSDevice_Battery & operator=(const MSDevice_Battery &)
Invalidated assignment operator.
bool myChargingInTransit
Parameter, Flag: Vehicles it&#39;s charging in transit by default is false.
SUMOReal myRecuperationEfficiency
Parameter, Vehicle&#39;s recuparation efficiency [1 >= myRecuperationEfficiency >= 0].
void setInternalMomentOfInertia(const SUMOReal internalMomentOfInertia)
Set vehicle&#39;s internal moment of inertia.
SUMOReal myInternalMomentOfInertia
Parameter, Vehicle&#39;s internal moment of inertia [myInternalMomentOfInertia >= 0].
Abstract in-vehicle device.
Definition: MSDevice.h:69
Battery device for electric vehicles.
void increaseChargingStartTime()
Increase Charging Start time.
SUMOReal myConstantPowerIntake
Parameter, Vehicle&#39;s constant power intake [myConstantPowerIntake >= 0].
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_Example-options.
A storage for options typed value containers)
Definition: OptionsCont.h:99
SUMOReal getConsum() const
Get consum.
void setMaximumBatteryCapacity(const SUMOReal maximumBatteryCapacity)
Set total vehicle&#39;s Battery Capacity in kWh.
bool notifyEnter(SUMOVehicle &veh, MSMoveReminder::Notification reason)
Saves departure info on insertion.
SUMOReal myRollDragCoefficient
Parameter, Vehicle&#39;s roll friction coefficient [myRollDragCoefficient >= 0].
SUMOReal myRadialDragCoefficient
Parameter, Vehicle&#39;s radial friction coefficient [myRadialDragCoefficient >=0].
SUMOReal getChargingStartTime() const
Get charging start time.
void generateOutput() const
Called on writing tripinfo output.
bool isChargingInTransit() const
Get true if Vehicle it&#39;s charging, false if not.
#define SUMOReal
Definition: config.h:213
SUMOReal myMass
Parameter, Vehicle&#39;s myMass [myMass >= 0].
MSDevice_Battery(SUMOVehicle &holder, const std::string &id, const SUMOReal actualBatteryCapacity, const SUMOReal maximumBatteryCapacity, const SUMOReal powerMax, const SUMOReal mass, const SUMOReal frontSurfaceArea, const SUMOReal airDragCoefficient, const SUMOReal internalMomentOfInertia, const SUMOReal radialDragCoefficient, const SUMOReal rollDragCoefficient, const SUMOReal constantPowerIntake, const SUMOReal propulsionEfficiency, const SUMOReal recuperationEfficiency, const SUMOReal lastAngle, const SUMOReal lastEnergy)
Constructor.
SUMOReal getMaximumPower() const
Get the maximum power when accelerating.
void setConstantPowerIntake(const SUMOReal constantPowerIntake)
Set vehicle&#39;s constant power intake.
void setAirDragCoefficient(const SUMOReal new_C_Veh)
Set vehicle&#39;s drag coefficient.
SUMOReal getRadialDragCoefficient() const
Get vehicles&#39;s radial friction coefficient.
SUMOReal getMass() const
Get vehicle&#39;s mass.
SUMOReal myEnergyCharged
Parameter, Energy charged in each timestep.
~MSDevice_Battery()
Destructor.