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

WHOI micro-modem energy model. More...

#include <acoustic-modem-energy-model.h>

+ Inheritance diagram for ns3::AcousticModemEnergyModel:

Public Types

typedef Callback< void > AcousticModemEnergyDepletionCallback
 
- Public Types inherited from ns3::DeviceEnergyModel
typedef Callback< void, int > ChangeStateCallback
 

Public Member Functions

virtual void ChangeState (int newState)
 Changes state of the AcousticModemEnergyModel. More...
 
int GetCurrentState (void) const
 
double GetIdlePowerW (void) const
 
virtual Ptr< NodeGetNode (void) const
 Gets pointer to node. More...
 
double GetRxPowerW (void) const
 
double GetSleepPowerW (void) const
 
virtual double GetTotalEnergyConsumption (void) const
 
double GetTxPowerW (void) const
 
virtual void HandleEnergyDepletion (void)
 Handles energy depletion. More...
 
void SetEnergyDepletionCallback (AcousticModemEnergyDepletionCallback callback)
 
virtual void SetEnergySource (Ptr< EnergySource > source)
 Sets pointer to EnergySouce installed on node. More...
 
void SetIdlePowerW (double idlePowerW)
 
virtual void SetNode (Ptr< Node > node)
 Sets pointer to node. More...
 
void SetRxPowerW (double rxPowerW)
 
void SetSleepPowerW (double sleepPowerW)
 
void SetTxPowerW (double txPowerW)
 
- Public Member Functions inherited from ns3::DeviceEnergyModel
double GetCurrentA (void) const
 
- Public Member Functions inherited from ns3::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 Initialize (void)
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 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
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)
 
- Static Public Member Functions inherited from ns3::DeviceEnergyModel
static TypeId GetTypeId (void)
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId (void)
 
- Static Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
static void Cleanup (void)
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId (void)
 

Private Member Functions

void DoDispose (void)
 
virtual double DoGetCurrentA (void) const
 
bool IsStateTransitionValid (const int destState)
 
void SetMicroModemState (const int state)
 

Private Attributes

int m_currentState
 
AcousticModemEnergyDepletionCallback m_energyDepletionCallback
 
double m_idlePowerW
 
Time m_lastUpdateTime
 
Ptr< Nodem_node
 
double m_rxPowerW
 
double m_sleepPowerW
 
Ptr< EnergySourcem_source
 
TracedValue< double > m_totalEnergyConsumption
 
double m_txPowerW
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 
virtual void DoInitialize (void)
 
virtual void NotifyNewAggregate (void)
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 
virtual void NotifyConstructionCompleted (void)
 

Detailed Description

WHOI micro-modem energy model.

Basing on the Device Energy Model interface, has been implemented a specific energy model for the WHOI micro modem. The class follows pretty closely the RadioEnergyModel class as the transducer behaviour is pretty close to the one of a wifi radio, with identical states (rx, tx, idle, sleep).

The power consumption values implemented into the model are as follows [1]:

Modem State Power Consumption TX 50 W RX 158 mW Idle 158 mW Sleep 5.8 mW

References: [1] Freitag et al., The whoi micro-modem: an acoustic communications and navigation system for multiple platforms, in In Proc. IEEE OCEANS05 Conf, 2005. URL: http://ieeexplore.ieee.org/iel5/10918/34367/01639901.pdf

Doxygen introspection did not find any typical Config paths.

Attributes

  • TxPowerW: The modem Tx power in Watts
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 50
    • Flags: construct write read
  • RxPowerW: The modem Rx power in Watts
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 0.158
    • Flags: construct write read
  • IdlePowerW: The modem Idle power in Watts
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 0.158
    • Flags: construct write read
  • SleepPowerW: The modem Sleep power in Watts
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 0.0058
    • Flags: construct write read

TraceSources

  • TotalEnergyConsumption: Total energy consumption of the modem device.

Definition at line 52 of file acoustic-modem-energy-model.h.

Member Typedef Documentation

Callback type for energy depletion handling.

Definition at line 58 of file acoustic-modem-energy-model.h.

Member Function Documentation

void ns3::AcousticModemEnergyModel::ChangeState ( int  newState)
virtual
void ns3::AcousticModemEnergyModel::DoDispose ( void  )
privatevirtual

This method is called by Object::Dispose or by the object's destructor, whichever comes first.

Subclasses are expected to implement their real destruction code in an overriden version of this method and chain up to their parent's implementation once they are done. i.e., for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose method.

It is safe to call GetObject from within this method.

Reimplemented from ns3::Object.

Definition at line 259 of file acoustic-modem-energy-model.cc.

References NS_LOG_FUNCTION.

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

Implements DeviceEnergyModel::GetCurrentA.

Reimplemented from ns3::DeviceEnergyModel.

Definition at line 268 of file acoustic-modem-energy-model.cc.

References NS_ASSERT, NS_FATAL_ERROR, and NS_LOG_FUNCTION.

int ns3::AcousticModemEnergyModel::GetCurrentState ( void  ) const
Returns
Current state.

Definition at line 173 of file acoustic-modem-energy-model.cc.

References NS_LOG_FUNCTION.

double ns3::AcousticModemEnergyModel::GetIdlePowerW ( void  ) const
Returns
The idle power of the modem in Watts

Definition at line 145 of file acoustic-modem-energy-model.cc.

References NS_LOG_FUNCTION.

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

Gets pointer to node.

Returns
Pointer to node.

Implements DeviceEnergyModel::GetNode.

Definition at line 96 of file acoustic-modem-energy-model.cc.

double ns3::AcousticModemEnergyModel::GetRxPowerW ( void  ) const
Returns
The receiving power of the modem in Watts

Definition at line 131 of file acoustic-modem-energy-model.cc.

References NS_LOG_FUNCTION.

double ns3::AcousticModemEnergyModel::GetSleepPowerW ( void  ) const
Returns
The sleep power of the modem in Watts

Definition at line 159 of file acoustic-modem-energy-model.cc.

References NS_LOG_FUNCTION.

double ns3::AcousticModemEnergyModel::GetTotalEnergyConsumption ( void  ) const
virtual
Returns
Total energy consumption of the modem

Implements DeviceEnergyModel::GetTotalEnergyConsumption.

Implements ns3::DeviceEnergyModel.

Definition at line 110 of file acoustic-modem-energy-model.cc.

References NS_LOG_FUNCTION.

double ns3::AcousticModemEnergyModel::GetTxPowerW ( void  ) const
Returns
The transmission power of the modem in Watts

Definition at line 117 of file acoustic-modem-energy-model.cc.

References NS_LOG_FUNCTION.

void ns3::AcousticModemEnergyModel::HandleEnergyDepletion ( void  )
virtual
bool ns3::AcousticModemEnergyModel::IsStateTransitionValid ( const int  destState)
private
Parameters
destStateModem state to switch to.
Returns
True if the transition is allowed.

This function checks if a given modem state transition is allowed.

Definition at line 297 of file acoustic-modem-energy-model.cc.

References NS_LOG_FUNCTION.

Referenced by SetMicroModemState().

void ns3::AcousticModemEnergyModel::SetEnergyDepletionCallback ( AcousticModemEnergyDepletionCallback  callback)
Parameters
callbackCallback function.

Sets callback for energy depletion handling.

Definition at line 180 of file acoustic-modem-energy-model.cc.

References NS_LOG_DEBUG, and NS_LOG_FUNCTION.

void ns3::AcousticModemEnergyModel::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 102 of file acoustic-modem-energy-model.cc.

References NS_ASSERT, and NS_LOG_FUNCTION.

void ns3::AcousticModemEnergyModel::SetIdlePowerW ( double  idlePowerW)

Set the idle power of the modem

Parameters
idlePowerWIdle power of the modem in watts

Definition at line 152 of file acoustic-modem-energy-model.cc.

References NS_LOG_FUNCTION.

void ns3::AcousticModemEnergyModel::SetMicroModemState ( const int  state)
private
Parameters
stateNew state the modem is currently in.

Sets current state. This function is private so that only the energy model can change its own state.

Definition at line 304 of file acoustic-modem-energy-model.cc.

References IsStateTransitionValid(), ns3::Simulator::Now(), NS_FATAL_ERROR, NS_LOG_DEBUG, and NS_LOG_FUNCTION.

Referenced by ChangeState().

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

Sets pointer to node.

Parameters
nodePointer to node.

Implements DeviceEnergyModel::SetNode.

Definition at line 88 of file acoustic-modem-energy-model.cc.

References NS_ASSERT, and NS_LOG_FUNCTION.

void ns3::AcousticModemEnergyModel::SetRxPowerW ( double  rxPowerW)

Set the receiving power of the modem

Parameters
rxPowerWReceiving power of the modem in watts

Definition at line 138 of file acoustic-modem-energy-model.cc.

References NS_LOG_FUNCTION.

void ns3::AcousticModemEnergyModel::SetSleepPowerW ( double  sleepPowerW)

Set the sleep power of the modem

Parameters
sleepPowerWSleep power of the modem in watts

Definition at line 166 of file acoustic-modem-energy-model.cc.

References NS_LOG_FUNCTION.

void ns3::AcousticModemEnergyModel::SetTxPowerW ( double  txPowerW)

Set the transmission power of the modem

Parameters
txPowerWTransmission power of the modem in watts

Definition at line 124 of file acoustic-modem-energy-model.cc.

References NS_LOG_FUNCTION.


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