|
INET Framework for OMNeT++/OMNEST
|
This class implements a simple total power integrating energy storage.
More...
#include <SimpleEpEnergyStorage.h>
|
| virtual | ~SimpleEpEnergyStorage () |
| |
| virtual J | getNominalEnergyCapacity () const override |
| | Returns the nominal energy capacity in the range [0, +infinity]. More...
|
| |
| virtual J | getResidualEnergyCapacity () const override |
| | Returns the residual energy capacity in the range [0, nominalCapacity]. More...
|
| |
| virtual void | addEnergyConsumer (const IEnergyConsumer *energyConsumer) override |
| | Adds a new energy consumer to the energy source. More...
|
| |
| virtual void | removeEnergyConsumer (const IEnergyConsumer *energyConsumer) override |
| | Removes a previously added energy consumer from this energy source. More...
|
| |
| virtual void | addEnergyGenerator (const IEnergyGenerator *energyGenerator) override |
| | Adds a new energy generator to the energy sink. More...
|
| |
| virtual void | removeEnergyGenerator (const IEnergyGenerator *energyGenerator) override |
| | Removes a previously added energy generator from this energy sink. More...
|
| |
| virtual void | receiveSignal (cComponent *source, simsignal_t signal, double value, cObject *details) override |
| |
| virtual W | getTotalPowerConsumption () const override |
| | Returns the total power consumption in the range [0, +infinity). More...
|
| |
| virtual int | getNumEnergyConsumers () const override |
| | Returns the number of energy consumers in the range [0, +infinity). More...
|
| |
| virtual const IEnergyConsumer * | getEnergyConsumer (int index) const override |
| | Returns the energy consumer for the provided index. More...
|
| |
| virtual | ~IEnergySource () |
| |
| virtual W | getTotalPowerGeneration () const override |
| | Returns the total power generation in the range [0, +infinity). More...
|
| |
| virtual int | getNumEnergyGenerators () const override |
| | Returns the number of energy generators in the range [0, +infinity). More...
|
| |
| virtual const IEnergyGenerator * | getEnergyGenerator (int index) const override |
| | Returns the energy generator for the provided index. More...
|
| |
| virtual | ~IEnergySink () |
| |
| | LifecycleController () |
| |
| virtual | ~LifecycleController () |
| |
| virtual bool | initiateOperation (LifecycleOperation *operation, IDoneCallback *completionCallback=nullptr) |
| | Initiate an operation. More...
|
| |
|
| static simsignal_t | powerConsumptionChangedSignal = cComponent::registerSignal("powerConsumptionChanged") |
| | The signal that is used to publish power consumption changes. More...
|
| |
| static simsignal_t | powerGenerationChangedSignal = cComponent::registerSignal("powerGenerationChanged") |
| | The signal that is used to publish power generation changes. More...
|
| |
| static simsignal_t | residualEnergyCapacityChangedSignal = cComponent::registerSignal("residualEnergyCapacityChanged") |
| | The signal that is used to publish residual energy capacity changes also including when the energy storage becomes completely depleted or charged. More...
|
| |
This class implements a simple total power integrating energy storage.
It maintains its residual capacity by repeatedly scheduling a single timer to the next capacity update. The next update happens when either the storage becomes completely depleted, completely charged, or the next capacity report is done. Besides, it immediately updates the capacity when the total absorbed or provided power changes, and it also reschedules the timer.
See the corresponding NED file for more details.
◆ ~SimpleEpEnergyStorage()
| inet::power::SimpleEpEnergyStorage::~SimpleEpEnergyStorage |
( |
| ) |
|
|
virtual |
22 cancelAndDelete(
timer);
◆ executeNodeOperation()
| void inet::power::SimpleEpEnergyStorage::executeNodeOperation |
( |
J |
newResidualCapacity | ) |
|
|
protectedvirtual |
101 EV_WARN <<
"Energy storage failed" << endl;
103 ModuleCrashOperation *operation =
new ModuleCrashOperation();
Referenced by setResidualCapacity().
◆ getNominalEnergyCapacity()
| virtual J inet::power::SimpleEpEnergyStorage::getNominalEnergyCapacity |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ getResidualEnergyCapacity()
| J inet::power::SimpleEpEnergyStorage::getResidualEnergyCapacity |
( |
| ) |
const |
|
overridevirtual |
◆ handleMessage()
| void inet::power::SimpleEpEnergyStorage::handleMessage |
( |
cMessage * |
message | ) |
|
|
overrideprotectedvirtual |
46 if (message ==
timer) {
52 throw cRuntimeError(
"Unknown message");
◆ initialize()
| void inet::power::SimpleEpEnergyStorage::initialize |
( |
int |
stage | ) |
|
|
overrideprotectedvirtual |
◆ refreshDisplay()
| void inet::power::SimpleEpEnergyStorage::refreshDisplay |
( |
| ) |
const |
|
overrideprotectedvirtual |
◆ resolveDirective()
| const char * inet::power::SimpleEpEnergyStorage::resolveDirective |
( |
char |
directive | ) |
const |
|
overrideprotectedvirtual |
◆ scheduleTimer()
| void inet::power::SimpleEpEnergyStorage::scheduleTimer |
( |
| ) |
|
|
protectedvirtual |
◆ setResidualCapacity()
| void inet::power::SimpleEpEnergyStorage::setResidualCapacity |
( |
J |
newResidualCapacity | ) |
|
|
protectedvirtual |
◆ updateDisplayString()
| void inet::power::SimpleEpEnergyStorage::updateDisplayString |
( |
| ) |
const |
|
protectedvirtual |
62 if (getEnvir()->isGUI()) {
64 getDisplayString().setTagArg(
"t", 0, text);
Referenced by refreshDisplay().
◆ updateResidualCapacity()
| void inet::power::SimpleEpEnergyStorage::updateResidualCapacity |
( |
| ) |
|
|
protectedvirtual |
◆ updateTotalPowerConsumption()
| void inet::power::SimpleEpEnergyStorage::updateTotalPowerConsumption |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ updateTotalPowerGeneration()
| void inet::power::SimpleEpEnergyStorage::updateTotalPowerGeneration |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ lastResidualCapacityUpdate
| simtime_t inet::power::SimpleEpEnergyStorage::lastResidualCapacityUpdate = -1 |
|
protected |
◆ networkNode
| cModule* inet::power::SimpleEpEnergyStorage::networkNode = nullptr |
|
protected |
◆ nodeStatus
| NodeStatus* inet::power::SimpleEpEnergyStorage::nodeStatus = nullptr |
|
protected |
◆ nominalCapacity
| J inet::power::SimpleEpEnergyStorage::nominalCapacity = J(NaN) |
|
protected |
◆ printCapacityStep
| J inet::power::SimpleEpEnergyStorage::printCapacityStep = J(NaN) |
|
protected |
◆ residualCapacity
| J inet::power::SimpleEpEnergyStorage::residualCapacity = J(NaN) |
|
protected |
◆ targetCapacity
| J inet::power::SimpleEpEnergyStorage::targetCapacity = J(NaN) |
|
protected |
◆ timer
| cMessage* inet::power::SimpleEpEnergyStorage::timer = nullptr |
|
protected |
The documentation for this class was generated from the following files:
cModule * networkNode
The containing node module.
Definition: SimpleEpEnergyStorage.h:69
cModule * findContainingNode(const cModule *from)
Find the node containing the given module.
Definition: ModuleAccess.cc:31
std::string str() const
Definition: Units.h:101
J nominalCapacity
The nominal capacity is in the range [0, +infinity).
Definition: SimpleEpEnergyStorage.h:38
J residualCapacity
The residual capacity is in the range [0, nominalCapacity].
Definition: SimpleEpEnergyStorage.h:43
NodeStatus * nodeStatus
The status of the node.
Definition: SimpleEpEnergyStorage.h:74
cMessage * timer
The timer that is scheduled to the earliest time when the energy storage will be depleted,...
Definition: SimpleEpEnergyStorage.h:59
compose< J, pow< s, -1 > > W
Definition: Units.h:939
W totalPowerConsumption
Definition: EpEnergySourceBase.h:22
static simsignal_t residualEnergyCapacityChangedSignal
The signal that is used to publish residual energy capacity changes also including when the energy st...
Definition: IEpEnergyStorage.h:32
virtual void executeNodeOperation(J newResidualCapacity)
Definition: SimpleEpEnergyStorage.cc:98
J targetCapacity
The capacity that will be set when the timer expires.
Definition: SimpleEpEnergyStorage.h:64
virtual void updateTotalPowerConsumption() override
Definition: EpEnergyStorageBase.cc:24
value< double, units::s > s
Definition: Units.h:1235
simtime_t lastResidualCapacityUpdate
The simulation time when the residual capacity was last updated.
Definition: SimpleEpEnergyStorage.h:53
virtual void initialize(int stage) override
Definition: EpEnergyStorageBase.cc:14
std::map< std::string, std::string > StringMap
Definition: LifecycleOperation.h:28
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
J printCapacityStep
Specifies the amount of capacity change which will be reported.
Definition: SimpleEpEnergyStorage.h:48
virtual bool initiateOperation(LifecycleOperation *operation, IDoneCallback *completionCallback=nullptr)
Initiate an operation.
Definition: LifecycleController.cc:46
int round(double d)
Returns an integer that corresponds to rounded double parameter.
Definition: INETMath.h:143
pow< internal::none, 0 > unit
Definition: Units.h:72
compose< N, m > J
Definition: Units.h:938
virtual void updateResidualCapacity()
Definition: SimpleEpEnergyStorage.cc:128
virtual J getNominalEnergyCapacity() const override
Returns the nominal energy capacity in the range [0, +infinity].
Definition: SimpleEpEnergyStorage.h:94
@ UP
Definition: NodeStatus.h:28
const value_type & get() const
Definition: Units.h:108
virtual J getResidualEnergyCapacity() const override
Returns the residual energy capacity in the range [0, nominalCapacity].
Definition: SimpleEpEnergyStorage.cc:109
virtual void setResidualCapacity(J newResidualCapacity)
Definition: SimpleEpEnergyStorage.cc:115
virtual void scheduleTimer()
Definition: SimpleEpEnergyStorage.cc:141
virtual void updateTotalPowerGeneration() override
Definition: EpEnergyStorageBase.cc:30
virtual void updateDisplayString() const
Definition: SimpleEpEnergyStorage.cc:60
virtual State getState() const
Definition: NodeStatus.h:35
W totalPowerGeneration
Definition: EpEnergySinkBase.h:22