A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::SimpleDeviceEnergyModel Class Reference

#include <simple-device-energy-model.h>

+ Inheritance diagram for ns3::SimpleDeviceEnergyModel:
+ Collaboration diagram for ns3::SimpleDeviceEnergyModel:

Public Member Functions

 SimpleDeviceEnergyModel ()
virtual ~SimpleDeviceEnergyModel ()
virtual void ChangeState (int newState)
virtual Ptr< NodeGetNode (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.
- Public Member Functions inherited from ns3::DeviceEnergyModel
 DeviceEnergyModel ()
virtual ~DeviceEnergyModel ()
double GetCurrentA (void) const
- 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
SimpleRefCountoperator= (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::SimpleDeviceEnergyModel.

Private Member Functions

void DoDispose (void)
virtual double DoGetCurrentA (void) const

Private Attributes

double m_actualCurrentA
Time m_lastUpdateTime
Ptr< Nodem_node
Ptr< EnergySourcem_source
TracedValue< double > m_totalEnergyConsumption

Additional Inherited Members

- Public Types inherited from ns3::DeviceEnergyModel
typedef Callback< void, int > ChangeStateCallback
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
virtual void DoDispose (void)
virtual void DoStart (void)
virtual void NotifyNewAggregate (void)

Detailed Description

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.

Constructor & Destructor Documentation

ns3::SimpleDeviceEnergyModel::SimpleDeviceEnergyModel ( )

Definition at line 24 of file simple-device-energy-model.cc.

References m_actualCurrentA, m_lastUpdateTime, m_source, and ns3::Seconds().

+ Here is the call graph for this function:

ns3::SimpleDeviceEnergyModel::~SimpleDeviceEnergyModel ( )
virtual

Definition at line 31 of file simple-device-energy-model.cc.

Member Function Documentation

virtual void ns3::SimpleDeviceEnergyModel::ChangeState ( int  newState)
inlinevirtual
Parameters
newStateNew state the device is in.

Not implemented

Implements ns3::DeviceEnergyModel.

Definition at line 71 of file simple-device-energy-model.h.

void ns3::SimpleDeviceEnergyModel::DoDispose ( void  )
private

Definition at line 81 of file simple-device-energy-model.cc.

References m_source.

double ns3::SimpleDeviceEnergyModel::DoGetCurrentA ( void  ) const
privatevirtual
Returns
Current draw of device, at current state.

Implements DeviceEnergyModel::GetCurrentA.

Definition at line 87 of file simple-device-energy-model.cc.

References m_actualCurrentA.

Ptr< Node > ns3::SimpleDeviceEnergyModel::GetNode ( void  ) const
virtual

Gets pointer to node.

Returns
Pointer to node.

Implements DeviceEnergyModel::GetNode.

Definition at line 50 of file simple-device-energy-model.cc.

References m_node.

double ns3::SimpleDeviceEnergyModel::GetTotalEnergyConsumption ( void  ) const
virtual
Returns
Total energy consumption of the vehicle.

Implements DeviceEnergyModel::GetTotalEnergyConsumption.

Implements ns3::DeviceEnergyModel.

Definition at line 56 of file simple-device-energy-model.cc.

References m_totalEnergyConsumption.

TypeId ns3::SimpleDeviceEnergyModel::GetTypeId ( void  )
static

This method returns the TypeId associated to ns3::SimpleDeviceEnergyModel.

No Attributes defined for this type.
TraceSources defined for this type:

  • TotalEnergyConsumption: Total energy consumption of the radio device.

Reimplemented from ns3::DeviceEnergyModel.

Definition at line 12 of file simple-device-energy-model.cc.

References m_totalEnergyConsumption, ns3::MakeTraceSourceAccessor(), and ns3::TypeId::SetParent().

+ Here is the call graph for this function:

virtual void ns3::SimpleDeviceEnergyModel::HandleEnergyDepletion ( void  )
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)
Parameters
currentthe 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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::SimpleDeviceEnergyModel::SetEnergySource ( Ptr< EnergySource source)
virtual

Sets pointer to EnergySouce installed on node.

Parameters
sourcePointer to EnergySource installed on node.

Implements DeviceEnergyModel::SetEnergySource.

Implements ns3::DeviceEnergyModel.

Definition at line 36 of file simple-device-energy-model.cc.

References m_source, and NS_ASSERT.

void ns3::SimpleDeviceEnergyModel::SetNode ( Ptr< Node node)
virtual

Sets pointer to node.

Parameters
nodePointer to node.

Implements DeviceEnergyModel::SetNode.

Definition at line 43 of file simple-device-energy-model.cc.

References m_node, and NS_ASSERT.

Member Data Documentation

double ns3::SimpleDeviceEnergyModel::m_actualCurrentA
private
Time ns3::SimpleDeviceEnergyModel::m_lastUpdateTime
private

Definition at line 100 of file simple-device-energy-model.h.

Referenced by SetCurrentA(), and SimpleDeviceEnergyModel().

Ptr<Node> ns3::SimpleDeviceEnergyModel::m_node
private

Definition at line 103 of file simple-device-energy-model.h.

Referenced by GetNode(), and SetNode().

Ptr<EnergySource> ns3::SimpleDeviceEnergyModel::m_source
private
TracedValue<double> ns3::SimpleDeviceEnergyModel::m_totalEnergyConsumption
private

Definition at line 104 of file simple-device-energy-model.h.

Referenced by GetTotalEnergyConsumption(), GetTypeId(), and SetCurrentA().


The documentation for this class was generated from the following files: