25 #ifndef ENERGY_SOURCE_H
26 #define ENERGY_SOURCE_H
32 #include "ns3/object.h"
34 #include "ns3/type-id.h"
84 class EnergyHarvester;
Holds a vector of ns3::DeviceEnergyModel pointers.
void AppendDeviceEnergyModel(Ptr< DeviceEnergyModel > deviceEnergyModelPtr)
void ConnectEnergyHarvester(Ptr< EnergyHarvester > energyHarvesterPtr)
void DisposeDeviceModels()
Calls Dispose () method of the device energy models.
virtual double GetInitialEnergy() const =0
double CalculateTotalCurrent()
virtual double GetEnergyFraction()=0
void NotifyEnergyRecharged()
This function notifies all DeviceEnergyModel of energy recharged event.
void InitializeDeviceModels()
Calls Start () method of the device energy models.
virtual double GetRemainingEnergy()=0
DeviceEnergyModelContainer m_models
List of device energy models installed on the same node.
Ptr< Node > m_node
Pointer to node containing this EnergySource.
void NotifyEnergyChanged()
This function notifies all DeviceEnergyModel of energy changed event.
void BreakDeviceEnergyModelRefCycle()
This function is called to break reference cycle between EnergySource and DeviceEnergyModel.
virtual void UpdateEnergySource()=0
This function goes through the list of DeviceEnergyModels to obtain total current draw at the energy ...
void NotifyEnergyDrained()
This function notifies all DeviceEnergyModel of energy depletion event.
std::vector< Ptr< EnergyHarvester > > m_harvesters
Vector of EnergyHarvester pointer connected to the same energy source.
Ptr< Node > GetNode() const
static TypeId GetTypeId()
Get the type ID.
DeviceEnergyModelContainer FindDeviceEnergyModels(TypeId tid)
void DoDispose() override
All child's implementation must call BreakDeviceEnergyModelRefCycle to ensure reference cycles to Dev...
void SetNode(Ptr< Node > node)
Sets pointer to node containing this EnergySource.
virtual double GetSupplyVoltage() const =0
A base class which provides memory management and object aggregation.
a unique identifier for an interface.
Every class exported by the ns3 library is enclosed in the ns3 namespace.