#include <simple-device-energy-model.h>
Public Member Functions | |
SimpleDeviceEnergyModel () | |
virtual | ~SimpleDeviceEnergyModel () |
virtual void | ChangeState (int newState) |
virtual Ptr< Node > | GetNode (void) const |
Gets pointer to node. | |
virtual double | GetTotalEnergyConsumption (void) const |
virtual void | HandleEnergyDepletion (void) |
Handles energy depletion. | |
void | SetCurrentA (double current) |
virtual void | SetEnergySource (Ptr< EnergySource > source) |
Sets pointer to EnergySouce installed on node. | |
virtual void | SetNode (Ptr< Node > node) |
Sets pointer to node. | |
![]() | |
DeviceEnergyModel () | |
virtual | ~DeviceEnergyModel () |
double | GetCurrentA (void) const |
![]() | |
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) |
![]() | |
SimpleRefCount () | |
SimpleRefCount (const SimpleRefCount &o) | |
uint32_t | GetReferenceCount (void) const |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
void | Ref (void) const |
void | Unref (void) const |
![]() | |
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::SimpleDeviceEnergyModel. |
Private Member Functions | |
void | DoDispose (void) |
virtual double | DoGetCurrentA (void) const |
Private Attributes | |
double | m_actualCurrentA |
Time | m_lastUpdateTime |
Ptr< Node > | m_node |
Ptr< EnergySource > | m_source |
TracedValue< double > | m_totalEnergyConsumption |
Additional Inherited Members | |
![]() | |
typedef Callback< void, int > | ChangeStateCallback |
![]() | |
Object (const Object &o) | |
virtual void | DoDispose (void) |
virtual void | DoStart (void) |
virtual void | NotifyNewAggregate (void) |
A simple device energy model where current drain can be set by the user.
It is supposed to be used as a testing model for energy sources.
Definition at line 25 of file simple-device-energy-model.h.
ns3::SimpleDeviceEnergyModel::SimpleDeviceEnergyModel | ( | ) |
Definition at line 24 of file simple-device-energy-model.cc.
References m_actualCurrentA, m_lastUpdateTime, m_source, and ns3::Seconds().
|
virtual |
Definition at line 31 of file simple-device-energy-model.cc.
|
inlinevirtual |
newState | New state the device is in. |
Not implemented
Implements ns3::DeviceEnergyModel.
Definition at line 71 of file simple-device-energy-model.h.
|
private |
Definition at line 81 of file simple-device-energy-model.cc.
References m_source.
|
privatevirtual |
Implements DeviceEnergyModel::GetCurrentA.
Definition at line 87 of file simple-device-energy-model.cc.
References m_actualCurrentA.
Gets pointer to node.
Implements DeviceEnergyModel::GetNode.
Definition at line 50 of file simple-device-energy-model.cc.
References m_node.
|
virtual |
Implements DeviceEnergyModel::GetTotalEnergyConsumption.
Implements ns3::DeviceEnergyModel.
Definition at line 56 of file simple-device-energy-model.cc.
References m_totalEnergyConsumption.
|
static |
This method returns the TypeId associated to ns3::SimpleDeviceEnergyModel.
No Attributes defined for this type.
TraceSources defined for this type:
Reimplemented from ns3::DeviceEnergyModel.
Definition at line 12 of file simple-device-energy-model.cc.
References m_totalEnergyConsumption, ns3::MakeTraceSourceAccessor(), and ns3::TypeId::SetParent().
|
inlinevirtual |
Handles energy depletion.
Not implemented
Implements ns3::DeviceEnergyModel.
Definition at line 80 of file simple-device-energy-model.h.
void ns3::SimpleDeviceEnergyModel::SetCurrentA | ( | double | current | ) |
current | the current draw of device. |
Set the actual current draw of the device.
Definition at line 62 of file simple-device-energy-model.cc.
References ns3::Time::GetSeconds(), ns3::EnergySource::GetSupplyVoltage(), m_actualCurrentA, m_lastUpdateTime, m_source, m_totalEnergyConsumption, ns3::Now(), and ns3::EnergySource::UpdateEnergySource().
Referenced by main().
|
virtual |
Sets pointer to EnergySouce installed on node.
source | Pointer to EnergySource installed on node. |
Implements DeviceEnergyModel::SetEnergySource.
Implements ns3::DeviceEnergyModel.
Definition at line 36 of file simple-device-energy-model.cc.
Sets pointer to node.
node | Pointer to node. |
Implements DeviceEnergyModel::SetNode.
Definition at line 43 of file simple-device-energy-model.cc.
|
private |
Definition at line 101 of file simple-device-energy-model.h.
Referenced by DoGetCurrentA(), SetCurrentA(), and SimpleDeviceEnergyModel().
|
private |
Definition at line 100 of file simple-device-energy-model.h.
Referenced by SetCurrentA(), and SimpleDeviceEnergyModel().
Definition at line 103 of file simple-device-energy-model.h.
|
private |
Definition at line 102 of file simple-device-energy-model.h.
Referenced by DoDispose(), SetCurrentA(), SetEnergySource(), and SimpleDeviceEnergyModel().
|
private |
Definition at line 104 of file simple-device-energy-model.h.
Referenced by GetTotalEnergyConsumption(), GetTypeId(), and SetCurrentA().