|
INET Framework for OMNeT++/OMNEST
|
This is a simple radio power consumer model.
More...
#include <StateBasedEpEnergyConsumer.h>
This is a simple radio power consumer model.
The power consumption is determined by the radio mode, the transmitter state and the receiver state using constant parameters.
◆ computePowerConsumption()
| W inet::physicallayer::StateBasedEpEnergyConsumer::computePowerConsumption |
( |
| ) |
const |
|
protectedvirtual |
83 switch (receptionState) {
91 auto part =
radio->getReceivedSignalPart();
108 throw cRuntimeError(
"Unknown received signal part");
115 throw cRuntimeError(
"Unknown radio reception state");
119 switch (transmissionState) {
124 auto part =
radio->getTransmittedSignalPart();
141 throw cRuntimeError(
"Unknown transmitted signal part");
148 throw cRuntimeError(
"Unknown radio transmission state");
◆ getEnergySource()
| virtual power::IEnergySource* inet::physicallayer::StateBasedEpEnergyConsumer::getEnergySource |
( |
| ) |
const |
|
inlineoverridevirtual |
Returns the energy source that provides energy for this energy consumer.
This function never returns nullptr.
Implements inet::power::IEnergyConsumer.
◆ getPowerConsumption()
| virtual W inet::physicallayer::StateBasedEpEnergyConsumer::getPowerConsumption |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ initialize()
| void inet::physicallayer::StateBasedEpEnergyConsumer::initialize |
( |
int |
stage | ) |
|
|
overrideprotectedvirtual |
22 cSimpleModule::initialize(stage);
38 cModule *radioModule = getParentModule();
44 radio = check_and_cast<IRadio *>(radioModule);
46 energySource.reference(
this,
"energySourceModule",
true);
◆ numInitStages()
| virtual int inet::physicallayer::StateBasedEpEnergyConsumer::numInitStages |
( |
| ) |
const |
|
inlineoverrideprotectedvirtual |
◆ receiveSignal()
| void inet::physicallayer::StateBasedEpEnergyConsumer::receiveSignal |
( |
cComponent * |
source, |
|
|
simsignal_t |
signal, |
|
|
intval_t |
value, |
|
|
cObject * |
details |
|
) |
| |
|
overridevirtual |
67 throw cRuntimeError(
"Unknown signal");
◆ energySource
◆ offPowerConsumption
| W inet::physicallayer::StateBasedEpEnergyConsumer::offPowerConsumption = W(NaN) |
|
protected |
◆ powerConsumption
| W inet::physicallayer::StateBasedEpEnergyConsumer::powerConsumption = W(NaN) |
|
protected |
◆ radio
| opp_component_ptr<IRadio> inet::physicallayer::StateBasedEpEnergyConsumer::radio |
|
protected |
◆ receiverBusyPowerConsumption
| W inet::physicallayer::StateBasedEpEnergyConsumer::receiverBusyPowerConsumption = W(NaN) |
|
protected |
◆ receiverIdlePowerConsumption
| W inet::physicallayer::StateBasedEpEnergyConsumer::receiverIdlePowerConsumption = W(NaN) |
|
protected |
◆ receiverReceivingDataPowerConsumption
| W inet::physicallayer::StateBasedEpEnergyConsumer::receiverReceivingDataPowerConsumption = W(NaN) |
|
protected |
◆ receiverReceivingHeaderPowerConsumption
| W inet::physicallayer::StateBasedEpEnergyConsumer::receiverReceivingHeaderPowerConsumption = W(NaN) |
|
protected |
◆ receiverReceivingPowerConsumption
| W inet::physicallayer::StateBasedEpEnergyConsumer::receiverReceivingPowerConsumption = W(NaN) |
|
protected |
◆ receiverReceivingPreamblePowerConsumption
| W inet::physicallayer::StateBasedEpEnergyConsumer::receiverReceivingPreamblePowerConsumption = W(NaN) |
|
protected |
◆ sleepPowerConsumption
| W inet::physicallayer::StateBasedEpEnergyConsumer::sleepPowerConsumption = W(NaN) |
|
protected |
◆ switchingPowerConsumption
| W inet::physicallayer::StateBasedEpEnergyConsumer::switchingPowerConsumption = W(NaN) |
|
protected |
◆ transmitterIdlePowerConsumption
| W inet::physicallayer::StateBasedEpEnergyConsumer::transmitterIdlePowerConsumption = W(NaN) |
|
protected |
◆ transmitterTransmittingDataPowerConsumption
| W inet::physicallayer::StateBasedEpEnergyConsumer::transmitterTransmittingDataPowerConsumption = W(NaN) |
|
protected |
◆ transmitterTransmittingHeaderPowerConsumption
| W inet::physicallayer::StateBasedEpEnergyConsumer::transmitterTransmittingHeaderPowerConsumption = W(NaN) |
|
protected |
◆ transmitterTransmittingPowerConsumption
| W inet::physicallayer::StateBasedEpEnergyConsumer::transmitterTransmittingPowerConsumption = W(NaN) |
|
protected |
◆ transmitterTransmittingPreamblePowerConsumption
| W inet::physicallayer::StateBasedEpEnergyConsumer::transmitterTransmittingPreamblePowerConsumption = W(NaN) |
|
protected |
The documentation for this class was generated from the following files:
@ SIGNAL_PART_WHOLE
Definition: IRadioSignal.h:26
W receiverIdlePowerConsumption
Definition: StateBasedEpEnergyConsumer.h:33
@ 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,...
@ 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
W switchingPowerConsumption
Definition: StateBasedEpEnergyConsumer.h:32
@ 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
static simsignal_t powerConsumptionChangedSignal
The signal that is used to publish power consumption changes.
Definition: IEpEnergyConsumer.h:32
compose< J, pow< s, -1 > > W
Definition: Units.h:939
@ RECEPTION_STATE_RECEIVING
The radio medium is busy, a signal strong enough to receive is detected.
Definition: IRadio.h:149
W transmitterTransmittingDataPowerConsumption
Definition: StateBasedEpEnergyConsumer.h:43
virtual W computePowerConsumption() const
Definition: StateBasedEpEnergyConsumer.cc:70
W receiverReceivingPreamblePowerConsumption
Definition: StateBasedEpEnergyConsumer.h:36
W transmitterIdlePowerConsumption
Definition: StateBasedEpEnergyConsumer.h:39
@ 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
ReceptionState
This enumeration specifies the reception state of the radio.
Definition: IRadio.h:124
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
@ SIGNAL_PART_HEADER
Definition: IRadioSignal.h:28
@ SIGNAL_PART_PREAMBLE
Definition: IRadioSignal.h:27
W sleepPowerConsumption
Definition: StateBasedEpEnergyConsumer.h:31
@ RADIO_MODE_RECEIVER
The radio is prepared for frame reception, frame transmission is not possible, power consumption is l...
Definition: IRadio.h:97
W receiverReceivingPowerConsumption
Definition: StateBasedEpEnergyConsumer.h:35
W powerConsumption
Definition: StateBasedEpEnergyConsumer.h:50
W receiverReceivingHeaderPowerConsumption
Definition: StateBasedEpEnergyConsumer.h:37
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
ModuleRefByPar< power::IEpEnergySource > energySource
Definition: StateBasedEpEnergyConsumer.h:47
#define NUM_INIT_STAGES
Definition: InitStageRegistry.h:73
@ SIGNAL_PART_DATA
Definition: IRadioSignal.h:29
W offPowerConsumption
Definition: StateBasedEpEnergyConsumer.h:30
@ RECEPTION_STATE_BUSY
The radio medium is busy, a signal is detected but it is not strong enough to receive.
Definition: IRadio.h:143
W transmitterTransmittingPowerConsumption
Definition: StateBasedEpEnergyConsumer.h:40
#define Enter_Method(...)
Definition: SelfDoc.h:71
TransmissionState
This enumeration specifies the transmission state of the radio.
Definition: IRadio.h:155
opp_component_ptr< IRadio > radio
Definition: StateBasedEpEnergyConsumer.h:46
const value_type & get() const
Definition: Units.h:108
W receiverReceivingDataPowerConsumption
Definition: StateBasedEpEnergyConsumer.h:38
W transmitterTransmittingHeaderPowerConsumption
Definition: StateBasedEpEnergyConsumer.h:42
W receiverBusyPowerConsumption
Definition: StateBasedEpEnergyConsumer.h:34
RadioMode
This enumeration specifies the requested operational mode of the radio.
Definition: IRadio.h:79
W transmitterTransmittingPreamblePowerConsumption
Definition: StateBasedEpEnergyConsumer.h:41
@ TRANSMISSION_STATE_UNDEFINED
The transmission state is undefined or meaningless.
Definition: IRadio.h:160
@ TRANSMISSION_STATE_IDLE
The radio is not transmitting a signal on the radio medium.
Definition: IRadio.h:166
static simsignal_t receptionStateChangedSignal
This signal is emitted when the radio reception state of the radio is changed.
Definition: IRadio.h:54
static simsignal_t radioModeChangedSignal
This signal is emitted when the radio mode of the radio is changed.
Definition: IRadio.h:42