|
INET Framework for OMNeT++/OMNEST
|
This is a simple radio energy consumer model.
More...
#include <StateBasedCcEnergyConsumer.h>
This is a simple radio energy consumer model.
The current consumption is determined by the radio mode, the transmitter state and the receiver state using constant parameters.
◆ computeCurrentConsumption()
| A inet::physicallayer::StateBasedCcEnergyConsumer::computeCurrentConsumption |
( |
| ) |
const |
|
protectedvirtual |
116 throw cRuntimeError(
"Unknown received signal part");
119 throw cRuntimeError(
"Unknown radio reception state");
138 throw cRuntimeError(
"Unknown transmitted signal part");
141 throw cRuntimeError(
"Unknown radio transmission state");
◆ getCurrentConsumption()
| virtual A inet::physicallayer::StateBasedCcEnergyConsumer::getCurrentConsumption |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ getEnergySource()
| virtual power::IEnergySource* inet::physicallayer::StateBasedCcEnergyConsumer::getEnergySource |
( |
| ) |
const |
|
inlineoverridevirtual |
Returns the energy source that provides energy for this energy consumer.
This function never returns nullptr.
Implements inet::power::IEnergyConsumer.
◆ initialize()
| void inet::physicallayer::StateBasedCcEnergyConsumer::initialize |
( |
int |
stage | ) |
|
|
overrideprotectedvirtual |
22 cSimpleModule::initialize(stage);
40 cModule *radioModule = getParentModule();
46 radio = check_and_cast<IRadio *>(radioModule);
47 const char *energySourceModule = par(
"energySourceModule");
48 energySource = check_and_cast<ICcEnergySource *>(getModuleByPath(energySourceModule));
◆ numInitStages()
| virtual int inet::physicallayer::StateBasedCcEnergyConsumer::numInitStages |
( |
| ) |
const |
|
inlineoverrideprotectedvirtual |
◆ receiveSignal() [1/2]
| void inet::physicallayer::StateBasedCcEnergyConsumer::receiveSignal |
( |
cComponent * |
source, |
|
|
simsignal_t |
signal, |
|
|
double |
value, |
|
|
cObject * |
details |
|
) |
| |
|
overridevirtual |
83 throw cRuntimeError(
"Unknown signal");
◆ receiveSignal() [2/2]
| void inet::physicallayer::StateBasedCcEnergyConsumer::receiveSignal |
( |
cComponent * |
source, |
|
|
simsignal_t |
signal, |
|
|
intval_t |
value, |
|
|
cObject * |
details |
|
) |
| |
|
overridevirtual |
71 throw cRuntimeError(
"Unknown signal");
◆ currentConsumption
| A inet::physicallayer::StateBasedCcEnergyConsumer::currentConsumption = A(NaN) |
|
protected |
◆ energySource
◆ maxSupplyVoltage
| V inet::physicallayer::StateBasedCcEnergyConsumer::maxSupplyVoltage = V(NaN) |
|
protected |
◆ minSupplyVoltage
| V inet::physicallayer::StateBasedCcEnergyConsumer::minSupplyVoltage = V(NaN) |
|
protected |
◆ offCurrentConsumption
| A inet::physicallayer::StateBasedCcEnergyConsumer::offCurrentConsumption = A(NaN) |
|
protected |
◆ radio
| IRadio* inet::physicallayer::StateBasedCcEnergyConsumer::radio = nullptr |
|
protected |
◆ receiverBusyCurrentConsumption
| A inet::physicallayer::StateBasedCcEnergyConsumer::receiverBusyCurrentConsumption = A(NaN) |
|
protected |
◆ receiverIdleCurrentConsumption
| A inet::physicallayer::StateBasedCcEnergyConsumer::receiverIdleCurrentConsumption = A(NaN) |
|
protected |
◆ receiverReceivingCurrentConsumption
| A inet::physicallayer::StateBasedCcEnergyConsumer::receiverReceivingCurrentConsumption = A(NaN) |
|
protected |
◆ receiverReceivingDataCurrentConsumption
| A inet::physicallayer::StateBasedCcEnergyConsumer::receiverReceivingDataCurrentConsumption = A(NaN) |
|
protected |
◆ receiverReceivingHeaderCurrentConsumption
| A inet::physicallayer::StateBasedCcEnergyConsumer::receiverReceivingHeaderCurrentConsumption = A(NaN) |
|
protected |
◆ receiverReceivingPreambleCurrentConsumption
| A inet::physicallayer::StateBasedCcEnergyConsumer::receiverReceivingPreambleCurrentConsumption = A(NaN) |
|
protected |
◆ sleepCurrentConsumption
| A inet::physicallayer::StateBasedCcEnergyConsumer::sleepCurrentConsumption = A(NaN) |
|
protected |
◆ switchingCurrentConsumption
| A inet::physicallayer::StateBasedCcEnergyConsumer::switchingCurrentConsumption = A(NaN) |
|
protected |
◆ transmitterIdleCurrentConsumption
| A inet::physicallayer::StateBasedCcEnergyConsumer::transmitterIdleCurrentConsumption = A(NaN) |
|
protected |
◆ transmitterTransmittingCurrentConsumption
| A inet::physicallayer::StateBasedCcEnergyConsumer::transmitterTransmittingCurrentConsumption = A(NaN) |
|
protected |
◆ transmitterTransmittingDataCurrentConsumption
| A inet::physicallayer::StateBasedCcEnergyConsumer::transmitterTransmittingDataCurrentConsumption = A(NaN) |
|
protected |
◆ transmitterTransmittingHeaderCurrentConsumption
| A inet::physicallayer::StateBasedCcEnergyConsumer::transmitterTransmittingHeaderCurrentConsumption = A(NaN) |
|
protected |
◆ transmitterTransmittingPreambleCurrentConsumption
| A inet::physicallayer::StateBasedCcEnergyConsumer::transmitterTransmittingPreambleCurrentConsumption = A(NaN) |
|
protected |
The documentation for this class was generated from the following files:
virtual void setRadioMode(RadioMode radioMode)=0
Changes the current radio mode.
V minSupplyVoltage
Definition: StateBasedCcEnergyConsumer.h:29
@ SIGNAL_PART_WHOLE
Definition: IRadioSignal.h:26
@ RECEPTION_STATE_IDLE
The radio medium is free, no signal is detected.
Definition: IRadio.h:136
@ RADIO_MODE_TRANSCEIVER
The radio is prepared for simultaneous frame reception and transmission, power consumption is low whe...
Definition: IRadio.h:111
INET_API InitStage INITSTAGE_POWER
Initialization of the power model: energy storage, energy consumer, energy generator,...
power::ICcEnergySource * energySource
Definition: StateBasedCcEnergyConsumer.h:48
@ SIGNAL_PART_NONE
Definition: IRadioSignal.h:25
@ RADIO_MODE_OFF
The radio is turned off, frame reception or transmission is not possible, power consumption is zero,...
Definition: IRadio.h:84
@ RADIO_MODE_SWITCHING
The radio is switching from one mode to another, frame reception or transmission is not possible,...
Definition: IRadio.h:117
@ RADIO_MODE_SLEEP
The radio is sleeping, frame reception or transmission is not possible, power consumption is minimal,...
Definition: IRadio.h:90
virtual void addEnergyConsumer(const IEnergyConsumer *energyConsumer)=0
Adds a new energy consumer to the energy source.
compose< W, pow< A, -1 > > V
Definition: Units.h:942
@ RECEPTION_STATE_RECEIVING
The radio medium is busy, a signal strong enough to receive is detected.
Definition: IRadio.h:149
A receiverBusyCurrentConsumption
Definition: StateBasedCcEnergyConsumer.h:35
static simsignal_t currentConsumptionChangedSignal
The signal that is used to publish current consumption changes.
Definition: ICcEnergyConsumer.h:29
A sleepCurrentConsumption
Definition: StateBasedCcEnergyConsumer.h:32
@ RECEPTION_STATE_UNDEFINED
The radio medium state is unknown, reception state is meaningless, signal detection is not possible.
Definition: IRadio.h:130
static simsignal_t transmissionStateChangedSignal
This signal is emitted when the radio transmission state of the radio is changed.
Definition: IRadio.h:60
@ RADIO_MODE_TRANSMITTER
The radio is prepared for frame transmission, frame reception is not possible, power consumption is l...
Definition: IRadio.h:104
virtual TransmissionState getTransmissionState() const =0
Returns the current radio transmission state.
ReceptionState
This enumeration specifies the reception state of the radio.
Definition: IRadio.h:124
A transmitterTransmittingCurrentConsumption
Definition: StateBasedCcEnergyConsumer.h:41
value< double, units::A > A
Definition: Units.h:1238
static simsignal_t receivedSignalPartChangedSignal
This signal is emitted when the received part is changed by the radio.
Definition: IRadio.h:66
static simsignal_t transmittedSignalPartChangedSignal
This signal is emitted when the transmitted part is changed by the radio.
Definition: IRadio.h:72
A switchingCurrentConsumption
Definition: StateBasedCcEnergyConsumer.h:33
@ SIGNAL_PART_HEADER
Definition: IRadioSignal.h:28
A offCurrentConsumption
Definition: StateBasedCcEnergyConsumer.h:31
A receiverReceivingPreambleCurrentConsumption
Definition: StateBasedCcEnergyConsumer.h:37
@ SIGNAL_PART_PREAMBLE
Definition: IRadioSignal.h:27
virtual RadioMode getRadioMode() const =0
Returns the current radio mode, This is the same mode as the one emitted with the last radioModeChang...
A transmitterTransmittingHeaderCurrentConsumption
Definition: StateBasedCcEnergyConsumer.h:43
@ RADIO_MODE_RECEIVER
The radio is prepared for frame reception, frame transmission is not possible, power consumption is l...
Definition: IRadio.h:97
virtual IRadioSignal::SignalPart getReceivedSignalPart() const =0
Returns the signal part of the ongoing reception that the receiver is currently receiving or -1 if no...
virtual A computeCurrentConsumption() const
Definition: StateBasedCcEnergyConsumer.cc:86
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
@ TRANSMISSION_STATE_TRANSMITTING
The radio medium is busy, the radio is currently transmitting a signal.
Definition: IRadio.h:171
#define NUM_INIT_STAGES
Definition: InitStageRegistry.h:73
@ SIGNAL_PART_DATA
Definition: IRadioSignal.h:29
virtual IRadioSignal::SignalPart getTransmittedSignalPart() const =0
Returns the signal part of the ongoing transmission that the transmitter is currently transmitting or...
@ RECEPTION_STATE_BUSY
The radio medium is busy, a signal is detected but it is not strong enough to receive.
Definition: IRadio.h:143
V maxSupplyVoltage
Definition: StateBasedCcEnergyConsumer.h:30
#define Enter_Method(...)
Definition: SelfDoc.h:71
TransmissionState
This enumeration specifies the transmission state of the radio.
Definition: IRadio.h:155
const value_type & get() const
Definition: Units.h:108
A receiverReceivingDataCurrentConsumption
Definition: StateBasedCcEnergyConsumer.h:39
RadioMode
This enumeration specifies the requested operational mode of the radio.
Definition: IRadio.h:79
A receiverReceivingCurrentConsumption
Definition: StateBasedCcEnergyConsumer.h:36
IRadio * radio
Definition: StateBasedCcEnergyConsumer.h:47
A transmitterIdleCurrentConsumption
Definition: StateBasedCcEnergyConsumer.h:40
@ TRANSMISSION_STATE_UNDEFINED
The transmission state is undefined or meaningless.
Definition: IRadio.h:160
A transmitterTransmittingPreambleCurrentConsumption
Definition: StateBasedCcEnergyConsumer.h:42
@ TRANSMISSION_STATE_IDLE
The radio is not transmitting a signal on the radio medium.
Definition: IRadio.h:166
virtual V getOutputVoltage() const =0
Returns the output voltage in the ragne [0, +infinity).
A transmitterTransmittingDataCurrentConsumption
Definition: StateBasedCcEnergyConsumer.h:44
virtual ReceptionState getReceptionState() const =0
Returns the current radio reception state.
A currentConsumption
Definition: StateBasedCcEnergyConsumer.h:51
A receiverIdleCurrentConsumption
Definition: StateBasedCcEnergyConsumer.h:34
static simsignal_t currentConsumptionChangedSignal
The signal that is used to publish current consumption changes.
Definition: ICcEnergySource.h:29
static simsignal_t receptionStateChangedSignal
This signal is emitted when the radio reception state of the radio is changed.
Definition: IRadio.h:54
A receiverReceivingHeaderCurrentConsumption
Definition: StateBasedCcEnergyConsumer.h:38
static simsignal_t radioModeChangedSignal
This signal is emitted when the radio mode of the radio is changed.
Definition: IRadio.h:42