9#ifndef RV_BATTERY_MODEL_H
10#define RV_BATTERY_MODEL_H
14#include "ns3/event-id.h"
15#include "ns3/nstime.h"
16#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.
Rakhmatov Vrudhula non-linear battery model.
double m_beta
beta value of RV model, in second^-1
double RvModelAFunction(Time t, Time sk, Time sk_1, double beta)
RV model A function.
static TypeId GetTypeId()
Get the type ID.
TracedValue< Time > m_lifetime
time of death of the battery
TracedValue< double > m_batteryLevel
Battery level is defined as: output of Discharge function / alpha value.
Time m_lastSampleTime
Last sample time.
double GetRemainingEnergy() override
EventId m_currentSampleEvent
Current sample event.
void DoDispose() override
Defined in ns3::Object.
double GetInitialEnergy() const override
double GetOpenCircuitVoltage() const
double GetSupplyVoltage() const override
std::vector< double > m_load
load profile
void UpdateEnergySource() override
Implements UpdateEnergySource.
double Discharge(double load, Time t)
Discharges the battery.
Time GetSamplingInterval() const
void SetNumOfTerms(int num)
Sets the number of terms of the infinite sum for estimating battery level.
void HandleEnergyDrainedEvent()
Handles the remaining energy going to zero event.
double m_alpha
alpha value of RV model, in Coulomb
double m_lowBatteryTh
low battery threshold, as a fraction of the initial energy
int m_numOfTerms
Number# of terms for infinite sum in battery level estimation.
void SetBeta(double beta)
Sets the beta value for the battery model.
double GetCutoffVoltage() const
double m_openCircuitVoltage
Open circuit voltage (in Volts)
std::vector< Time > m_timeStamps
time stamps of load profile
~RvBatteryModel() override
int GetNumOfTerms() const
void DoInitialize() override
Defined in ns3::Object.
void SetCutoffVoltage(double voltage)
Sets cutoff voltage of battery.
void SetAlpha(double alpha)
Sets the alpha value for the battery model.
double m_previousLoad
load value (total current) of previous sampling
double GetEnergyFraction() override
void SetSamplingInterval(Time interval)
double m_cutoffVoltage
Cutoff voltage (in Volts)
Time m_samplingInterval
Sampling interval.
void SetOpenCircuitVoltage(double voltage)
Sets open circuit voltage of battery.
Every class exported by the ns3 library is enclosed in the ns3 namespace.