20#ifndef LI_ION_ENERGY_SOURCE_H
21#define LI_ION_ENERGY_SOURCE_H
25#include "ns3/deprecated.h"
26#include "ns3/event-id.h"
27#include "ns3/nstime.h"
28#include "ns3/traced-value.h"
An identifier for simulation events.
Simulation virtual time values and global simulation resolution.
Trace classes with value semantics.
a unique identifier for an interface.
Energy source base class.
Model a generic Lithium Ion Battery basing on [1][2].
void UpdateEnergySource() override
Implements UpdateEnergySource.
void SetInitialEnergy(double initialEnergyJ)
double m_minVoltTh
minimum threshold voltage to consider the battery depleted
double m_qNom
cell capacity at the end of the nominal zone, in Ah
EventId m_energyUpdateEvent
energy update event
double m_eNom
nominal voltage of the cell, in Volts
double m_qExp
capacity value at the end of the exponential zone, in Ah
double m_drainedCapacity
capacity drained from the cell, in Ah
Time m_lastUpdateTime
last update time
TracedValue< double > m_remainingEnergyJ
remaining energy, in Joules
void DoInitialize() override
Initialize() implementation.
virtual void IncreaseRemainingEnergy(double energyJ)
double GetRemainingEnergy() override
void SetEnergyUpdateInterval(Time interval)
double GetInitialEnergy() const override
void SetInitialSupplyVoltage(double supplyVoltageV)
double GetEnergyFraction() override
virtual void DecreaseRemainingEnergy(double energyJ)
double GetVoltage(double current) const
Get the cell voltage in function of the discharge current.
double m_internalResistance
internal resistance of the cell, in Ohms
Time GetEnergyUpdateInterval() const
double m_lowBatteryTh
low battery threshold, as a fraction of the initial energy
Time m_energyUpdateInterval
energy update interval
~LiIonEnergySource() override
double m_typCurrent
typical discharge current used to fit the curves
void DoDispose() override
All child's implementation must call BreakDeviceEnergyModelRefCycle to ensure reference cycles to Dev...
double m_supplyVoltageV
actual voltage of the cell
double GetSupplyVoltage() const override
static TypeId GetTypeId()
Get the type ID.
void CalculateRemainingEnergy()
Calculates remaining energy.
double m_qRated
rated capacity of the cell, in Ah
void HandleEnergyDrainedEvent()
Handles the remaining energy going to zero event.
double m_eFull
initial voltage of the cell, in Volts
double m_eExp
cell voltage at the end of the exponential zone, in Volts
double m_initialEnergyJ
initial energy, in Joules
#define NS_DEPRECATED_3_40(msg)
Tag for things deprecated in version ns-3.40.
Every class exported by the ns3 library is enclosed in the ns3 namespace.