#include <basic-energy-source.h>
Inheritance diagram for ns3::BasicEnergySource:
Collaboration diagram for ns3::BasicEnergySource:Public Member Functions | |
| BasicEnergySource () | |
| virtual | ~BasicEnergySource () |
| virtual double | GetEnergyFraction (void) |
| Time | GetEnergyUpdateInterval (void) const |
| virtual double | GetInitialEnergy (void) const |
| virtual double | GetRemainingEnergy (void) |
| virtual double | GetSupplyVoltage (void) const |
| void | SetEnergyUpdateInterval (Time interval) |
| void | SetInitialEnergy (double initialEnergyJ) |
| void | SetSupplyVoltage (double supplyVoltageV) |
| virtual void | UpdateEnergySource (void) |
Public Member Functions inherited from ns3::EnergySource | |
| EnergySource () | |
| virtual | ~EnergySource () |
| void | AppendDeviceEnergyModel (Ptr< DeviceEnergyModel > deviceEnergyModelPtr) |
| void | DisposeDeviceModels (void) |
| DeviceEnergyModelContainer | FindDeviceEnergyModels (TypeId tid) |
| DeviceEnergyModelContainer | FindDeviceEnergyModels (std::string name) |
| Ptr< Node > | GetNode (void) const |
| void | SetNode (Ptr< Node > node) |
| Sets pointer to node containing this EnergySource. | |
| void | StartDeviceModels (void) |
Public Member Functions inherited from ns3::Object | |
| Object () | |
| virtual | ~Object () |
| void | AggregateObject (Ptr< Object > other) |
| void | Dispose (void) |
| AggregateIterator | GetAggregateIterator (void) const |
| virtual TypeId | GetInstanceTypeId (void) const |
| template<typename T > | |
| Ptr< T > | GetObject (void) const |
| template<typename T > | |
| Ptr< T > | GetObject (TypeId tid) const |
| void | Start (void) |
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
| SimpleRefCount () | |
| SimpleRefCount (const SimpleRefCount &o) | |
| uint32_t | GetReferenceCount (void) const |
| SimpleRefCount & | operator= (const SimpleRefCount &o) |
| void | Ref (void) const |
| void | Unref (void) const |
Public Member Functions inherited from ns3::ObjectBase | |
| virtual | ~ObjectBase () |
| void | GetAttribute (std::string name, AttributeValue &value) const |
| bool | GetAttributeFailSafe (std::string name, AttributeValue &attribute) const |
| void | SetAttribute (std::string name, const AttributeValue &value) |
| bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
| bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
| bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
| bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
| bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Static Public Member Functions | |
| static TypeId | GetTypeId (void) |
| This method returns the TypeId associated to ns3::BasicEnergySource. | |
Private Member Functions | |
| void | CalculateRemainingEnergy (void) |
| void | DoDispose (void) |
| Defined in ns3::Object. | |
| void | DoStart (void) |
| Defined in ns3::Object. | |
| void | HandleEnergyDrainedEvent (void) |
Private Attributes | |
| EventId | m_energyUpdateEvent |
| Time | m_energyUpdateInterval |
| double | m_initialEnergyJ |
| Time | m_lastUpdateTime |
| TracedValue< double > | m_remainingEnergyJ |
| double | m_supplyVoltageV |
Additional Inherited Members | |
Protected Member Functions inherited from ns3::EnergySource | |
| void | BreakDeviceEnergyModelRefCycle (void) |
| double | CalculateTotalCurrent (void) |
| void | NotifyEnergyDrained (void) |
BasicEnergySource decreases/increases remaining energy stored in itself in linearly.
Definition at line 37 of file basic-energy-source.h.
| ns3::BasicEnergySource::BasicEnergySource | ( | ) |
Definition at line 65 of file basic-energy-source.cc.
References m_lastUpdateTime, and ns3::Seconds().
Here is the call graph for this function:
|
virtual |
Definition at line 70 of file basic-energy-source.cc.
|
private |
Calculates remaining energy. This function uses the total current from all device models to calculate the amount of energy to decrease. The energy to decrease is given by: energy to decrease = total current * supply voltage * time duration This function subtracts the calculated energy to decrease from remaining energy.
Definition at line 190 of file basic-energy-source.cc.
References ns3::EnergySource::CalculateTotalCurrent(), ns3::Time::GetSeconds(), m_lastUpdateTime, m_remainingEnergyJ, m_supplyVoltageV, ns3::Now(), NS_ASSERT, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by UpdateEnergySource().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Defined in ns3::Object.
Definition at line 174 of file basic-energy-source.cc.
References ns3::EnergySource::BreakDeviceEnergyModelRefCycle(), and NS_LOG_FUNCTION.
Here is the call graph for this function:
|
private |
Defined in ns3::Object.
Definition at line 167 of file basic-energy-source.cc.
References NS_LOG_FUNCTION, and UpdateEnergySource().
Here is the call graph for this function:
|
virtual |
Implements GetEnergyFraction.
Implements ns3::EnergySource.
Definition at line 125 of file basic-energy-source.cc.
References m_initialEnergyJ, m_remainingEnergyJ, NS_LOG_FUNCTION, and UpdateEnergySource().
Here is the call graph for this function:| Time ns3::BasicEnergySource::GetEnergyUpdateInterval | ( | void | ) | const |
Definition at line 98 of file basic-energy-source.cc.
References m_energyUpdateInterval.
Referenced by GetTypeId().
Here is the caller graph for this function:
|
virtual |
Implements GetInitialEnergy.
Implements ns3::EnergySource.
Definition at line 110 of file basic-energy-source.cc.
References m_initialEnergyJ.
Referenced by GetTypeId().
Here is the caller graph for this function:
|
virtual |
Implements GetRemainingEnergy.
Implements ns3::EnergySource.
Definition at line 116 of file basic-energy-source.cc.
References m_remainingEnergyJ, NS_LOG_FUNCTION, and UpdateEnergySource().
Here is the call graph for this function:
|
virtual |
Implements GetSupplyVoltage.
Implements ns3::EnergySource.
Definition at line 104 of file basic-energy-source.cc.
References m_supplyVoltageV.
Referenced by GetTypeId().
Here is the caller graph for this function:
|
static |
This method returns the TypeId associated to ns3::BasicEnergySource.
Attributes defined for this type:
TraceSources defined for this type:
Reimplemented from ns3::EnergySource.
Definition at line 35 of file basic-energy-source.cc.
References GetEnergyUpdateInterval(), GetInitialEnergy(), GetSupplyVoltage(), m_remainingEnergyJ, ns3::MakeTraceSourceAccessor(), ns3::Seconds(), SetEnergyUpdateInterval(), SetInitialEnergy(), ns3::TypeId::SetParent(), and SetSupplyVoltage().
Here is the call graph for this function:
|
private |
Handles the remaining energy going to zero event. This function notifies all the energy models aggregated to the node about the energy being depleted. Each energy model is then responsible for its own handler.
Definition at line 181 of file basic-energy-source.cc.
References m_remainingEnergyJ, ns3::EnergySource::NotifyEnergyDrained(), NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by UpdateEnergySource().
Here is the call graph for this function:
Here is the caller graph for this function:| void ns3::BasicEnergySource::SetEnergyUpdateInterval | ( | Time | interval | ) |
| interval | Energy update interval. |
This function sets the interval between each energy update.
Definition at line 91 of file basic-energy-source.cc.
References m_energyUpdateInterval, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
Here is the caller graph for this function:| void ns3::BasicEnergySource::SetInitialEnergy | ( | double | initialEnergyJ | ) |
| initialEnergyJ | Initial energy, in Joules |
Sets initial energy stored in the energy source. Note that initial energy is assumed to be set before simulation starts and is set only once per simulation.
Definition at line 75 of file basic-energy-source.cc.
References m_initialEnergyJ, m_remainingEnergyJ, NS_ASSERT, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
Here is the caller graph for this function:| void ns3::BasicEnergySource::SetSupplyVoltage | ( | double | supplyVoltageV | ) |
| supplyVoltageV | Supply voltage at the energy source, in Volts. |
Sets supply voltage of the energy source.
Definition at line 84 of file basic-energy-source.cc.
References m_supplyVoltageV, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
Here is the caller graph for this function:
|
virtual |
Implements UpdateEnergySource.
Implements ns3::EnergySource.
Definition at line 134 of file basic-energy-source.cc.
References CalculateRemainingEnergy(), ns3::EventId::Cancel(), HandleEnergyDrainedEvent(), ns3::Simulator::IsFinished(), m_energyUpdateEvent, m_energyUpdateInterval, m_lastUpdateTime, m_remainingEnergyJ, ns3::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::Simulator::Schedule().
Referenced by DoStart(), GetEnergyFraction(), and GetRemainingEnergy().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 134 of file basic-energy-source.h.
Referenced by UpdateEnergySource().
|
private |
Definition at line 136 of file basic-energy-source.h.
Referenced by GetEnergyUpdateInterval(), SetEnergyUpdateInterval(), and UpdateEnergySource().
|
private |
Definition at line 131 of file basic-energy-source.h.
Referenced by GetEnergyFraction(), GetInitialEnergy(), and SetInitialEnergy().
|
private |
Definition at line 135 of file basic-energy-source.h.
Referenced by BasicEnergySource(), CalculateRemainingEnergy(), and UpdateEnergySource().
|
private |
Definition at line 133 of file basic-energy-source.h.
Referenced by CalculateRemainingEnergy(), GetEnergyFraction(), GetRemainingEnergy(), GetTypeId(), HandleEnergyDrainedEvent(), SetInitialEnergy(), and UpdateEnergySource().
|
private |
Definition at line 132 of file basic-energy-source.h.
Referenced by CalculateRemainingEnergy(), GetSupplyVoltage(), and SetSupplyVoltage().