|
INET Framework for OMNeT++/OMNEST
|
#include <SimpleEpEnergyManagement.h>
◆ ~SimpleEpEnergyManagement()
| inet::power::SimpleEpEnergyManagement::~SimpleEpEnergyManagement |
( |
| ) |
|
|
virtual |
◆ executeNodeOperation()
| void inet::power::SimpleEpEnergyManagement::executeNodeOperation |
( |
J |
estimatedEnergyCapacity | ) |
|
|
protectedvirtual |
70 EV_WARN <<
"Capacity reached node shutdown threshold" << endl;
72 ModuleStopOperation *operation =
new ModuleStopOperation();
77 EV_INFO <<
"Capacity reached node start threshold" << endl;
79 ModuleStartOperation *operation =
new ModuleStartOperation();
Referenced by handleMessage(), and receiveSignal().
◆ getEnergyStorage()
| virtual IEnergyStorage* inet::power::SimpleEpEnergyManagement::getEnergyStorage |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ getEstimatedEnergyCapacity()
| J inet::power::SimpleEpEnergyManagement::getEstimatedEnergyCapacity |
( |
| ) |
const |
|
overridevirtual |
◆ handleMessage()
| void inet::power::SimpleEpEnergyManagement::handleMessage |
( |
cMessage * |
message | ) |
|
|
overrideprotectedvirtual |
48 throw cRuntimeError(
"Unknown message");
◆ initialize()
| void inet::power::SimpleEpEnergyManagement::initialize |
( |
int |
stage | ) |
|
|
overrideprotectedvirtual |
31 auto energyStorageModule = check_and_cast<cModule *>(
energyStorage);
36 throw cRuntimeError(
"Cannot find node status");
◆ receiveSignal()
| void inet::power::SimpleEpEnergyManagement::receiveSignal |
( |
cComponent * |
source, |
|
|
simsignal_t |
signal, |
|
|
double |
value, |
|
|
cObject * |
details |
|
) |
| |
|
overridevirtual |
◆ refreshDisplay()
| void inet::power::SimpleEpEnergyManagement::refreshDisplay |
( |
| ) |
const |
|
overrideprotectedvirtual |
61 throw cRuntimeError(
"Invalid state");
62 if (text.length() != 0)
64 getDisplayString().setTagArg(
"t", 0, text.c_str());
◆ scheduleLifecycleOperationTimer()
| void inet::power::SimpleEpEnergyManagement::scheduleLifecycleOperationTimer |
( |
| ) |
|
|
protectedvirtual |
90 if (totalPower >
W(0)) {
95 else if (totalPower <
W(0)) {
102 if (totalPower !=
W(0)) {
104 simtime_t remainingTime =
unit((
targetCapacity - estimatedResidualCapacity) / totalPower /
s(1)).get();
106 remainingTime.setRaw(remainingTime.raw() + 1);
108 if (remainingTime > 0)
Referenced by handleMessage(), and receiveSignal().
◆ energyStorage
| IEpEnergyStorage* inet::power::SimpleEpEnergyManagement::energyStorage = nullptr |
|
protected |
◆ lifecycleOperationTimer
| cMessage* inet::power::SimpleEpEnergyManagement::lifecycleOperationTimer = nullptr |
|
protected |
◆ networkNode
| cModule* inet::power::SimpleEpEnergyManagement::networkNode = nullptr |
|
protected |
◆ nodeShutdownCapacity
| J inet::power::SimpleEpEnergyManagement::nodeShutdownCapacity = J(NaN) |
|
protected |
◆ nodeStartCapacity
| J inet::power::SimpleEpEnergyManagement::nodeStartCapacity = J(NaN) |
|
protected |
◆ nodeStatus
| NodeStatus* inet::power::SimpleEpEnergyManagement::nodeStatus = nullptr |
|
protected |
◆ targetCapacity
| J inet::power::SimpleEpEnergyManagement::targetCapacity = J(NaN) |
|
protected |
The documentation for this class was generated from the following files:
cModule * findContainingNode(const cModule *from)
Find the node containing the given module.
Definition: ModuleAccess.cc:31
virtual void executeNodeOperation(J estimatedEnergyCapacity)
Definition: SimpleEpEnergyManagement.cc:67
cModule * networkNode
Definition: SimpleEpEnergyManagement.h:29
virtual J getEstimatedEnergyCapacity() const override
Returns the estimated energy capacity in the range [0, +infinity).
Definition: SimpleEpEnergyManagement.cc:113
compose< J, pow< s, -1 > > W
Definition: Units.h:939
IEpEnergyStorage * energyStorage
Definition: SimpleEpEnergyManagement.h:26
@ DOWN
Definition: NodeStatus.h:28
NodeStatus * nodeStatus
Definition: SimpleEpEnergyManagement.h:30
J nodeStartCapacity
Definition: SimpleEpEnergyManagement.h:25
virtual J getResidualEnergyCapacity() const =0
Returns the residual energy capacity in the range [0, nominalCapacity].
value< double, units::s > s
Definition: Units.h:1235
std::map< std::string, std::string > StringMap
Definition: LifecycleOperation.h:28
virtual void scheduleLifecycleOperationTimer()
Definition: SimpleEpEnergyManagement.cc:85
virtual W getTotalPowerConsumption() const =0
Returns the total power consumption in the range [0, +infinity).
#define NaN
Definition: INETMath.h:91
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
virtual bool initiateOperation(LifecycleOperation *operation, IDoneCallback *completionCallback=nullptr)
Initiate an operation.
Definition: LifecycleController.cc:46
pow< internal::none, 0 > unit
Definition: Units.h:72
compose< N, m > J
Definition: Units.h:938
cMessage * lifecycleOperationTimer
Definition: SimpleEpEnergyManagement.h:31
@ UP
Definition: NodeStatus.h:28
#define Enter_Method(...)
Definition: SelfDoc.h:71
J targetCapacity
Definition: SimpleEpEnergyManagement.h:32
virtual W getTotalPowerGeneration() const =0
Returns the total power generation in the range [0, +infinity).
const value_type & get() const
Definition: Units.h:108
static simsignal_t powerGenerationChangedSignal
The signal that is used to publish power generation changes.
Definition: IEpEnergySink.h:29
static simsignal_t powerConsumptionChangedSignal
The signal that is used to publish power consumption changes.
Definition: IEpEnergySource.h:32
J nodeShutdownCapacity
Definition: SimpleEpEnergyManagement.h:24
virtual State getState() const
Definition: NodeStatus.h:35