INET Framework for OMNeT++/OMNEST
inet::power::IdealEpEnergyStorage Class Reference

This class implements an ideal energy storage. More...

#include <IdealEpEnergyStorage.h>

Inheritance diagram for inet::power::IdealEpEnergyStorage:
inet::power::EpEnergyStorageBase inet::power::EpEnergySourceBase inet::power::EpEnergySinkBase inet::power::IEpEnergyStorage inet::power::IEnergyStorage inet::power::IEpEnergySink inet::power::IEpEnergySource inet::power::IEpEnergySink inet::power::EnergySinkBase inet::power::IEpEnergySource inet::power::EnergySourceBase

Public Member Functions

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...
 
- Public Member Functions inherited from inet::power::EpEnergyStorageBase
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
 
- Public Member Functions inherited from inet::power::EpEnergySourceBase
virtual W getTotalPowerConsumption () const override
 Returns the total power consumption in the range [0, +infinity). More...
 
- Public Member Functions inherited from inet::power::EnergySourceBase
virtual int getNumEnergyConsumers () const override
 Returns the number of energy consumers in the range [0, +infinity). More...
 
virtual const IEnergyConsumergetEnergyConsumer (int index) const override
 Returns the energy consumer for the provided index. More...
 
- Public Member Functions inherited from inet::power::IEnergySource
virtual ~IEnergySource ()
 
- Public Member Functions inherited from inet::power::EpEnergySinkBase
virtual W getTotalPowerGeneration () const override
 Returns the total power generation in the range [0, +infinity). More...
 
- Public Member Functions inherited from inet::power::EnergySinkBase
virtual int getNumEnergyGenerators () const override
 Returns the number of energy generators in the range [0, +infinity). More...
 
virtual const IEnergyGeneratorgetEnergyGenerator (int index) const override
 Returns the energy generator for the provided index. More...
 
- Public Member Functions inherited from inet::power::IEnergySink
virtual ~IEnergySink ()
 

Protected Member Functions

virtual void initialize (int stage) override
 
virtual void updateTotalPowerConsumption () override
 
virtual void updateTotalPowerGeneration () override
 
virtual void updateEnergyBalance ()
 
- Protected Member Functions inherited from inet::power::EpEnergyStorageBase
void initialize (int stage) override
 
- Protected Member Functions inherited from inet::power::EpEnergySourceBase
virtual W computeTotalPowerConsumption () const
 
- Protected Member Functions inherited from inet::power::EpEnergySinkBase
virtual W computeTotalPowerGeneration () const
 

Protected Attributes

J energyBalance = J(NaN)
 
simtime_t lastEnergyBalanceUpdate = -1
 
- Protected Attributes inherited from inet::power::EpEnergySourceBase
W totalPowerConsumption = W(NaN)
 
- Protected Attributes inherited from inet::power::EnergySourceBase
std::vector< const IEnergyConsumer * > energyConsumers
 
- Protected Attributes inherited from inet::power::EpEnergySinkBase
W totalPowerGeneration = W(NaN)
 
- Protected Attributes inherited from inet::power::EnergySinkBase
std::vector< const IEnergyGenerator * > energyGenerators
 

Additional Inherited Members

- Static Public Attributes inherited from inet::power::IEpEnergySource
static simsignal_t powerConsumptionChangedSignal = cComponent::registerSignal("powerConsumptionChanged")
 The signal that is used to publish power consumption changes. More...
 
- Static Public Attributes inherited from inet::power::IEpEnergySink
static simsignal_t powerGenerationChangedSignal = cComponent::registerSignal("powerGenerationChanged")
 The signal that is used to publish power generation changes. More...
 
- Static Public Attributes inherited from inet::power::IEpEnergyStorage
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...
 

Detailed Description

This class implements an ideal energy storage.

See the corresponding NED file for more details.

Author
Levente Meszaros

Member Function Documentation

virtual J inet::power::IdealEpEnergyStorage::getNominalEnergyCapacity ( ) const
inlineoverridevirtual

Returns the nominal energy capacity in the range [0, +infinity].

It specifies the maximum amount of energy that the energy storage can contain.

Implements inet::power::IEpEnergyStorage.

48 { return J(INFINITY); }
#define INFINITY
Definition: Topology.h:29
compose< N, m > J
Definition: Units.h:769
virtual J inet::power::IdealEpEnergyStorage::getResidualEnergyCapacity ( ) const
inlineoverridevirtual

Returns the residual energy capacity in the range [0, nominalCapacity].

It specifies the amount of energy that the energy storage contains at the moment.

Implements inet::power::IEpEnergyStorage.

49 { return J(INFINITY); }
#define INFINITY
Definition: Topology.h:29
compose< N, m > J
Definition: Units.h:769
void inet::power::IdealEpEnergyStorage::initialize ( int  stage)
overrideprotectedvirtual
27 {
28  if (stage == INITSTAGE_LOCAL) {
29  energyBalance = J(0);
30  WATCH(energyBalance);
31  }
32 }
Local initializations.
Definition: InitStages.h:35
J energyBalance
Definition: IdealEpEnergyStorage.h:37
compose< N, m > J
Definition: Units.h:769
void inet::power::IdealEpEnergyStorage::updateEnergyBalance ( )
protectedvirtual

Referenced by updateTotalPowerConsumption(), and updateTotalPowerGeneration().

47 {
48  simtime_t currentSimulationTime = simTime();
49  if (currentSimulationTime != lastEnergyBalanceUpdate) {
50  energyBalance += s((currentSimulationTime - lastEnergyBalanceUpdate).dbl()) * (totalPowerGeneration - totalPowerConsumption);
51  lastEnergyBalanceUpdate = currentSimulationTime;
53  }
54 }
const value_type & get() const
Definition: Units.h:89
W totalPowerConsumption
Definition: EpEnergySourceBase.h:32
simtime_t lastEnergyBalanceUpdate
Definition: IdealEpEnergyStorage.h:38
J energyBalance
Definition: IdealEpEnergyStorage.h:37
W totalPowerGeneration
Definition: EpEnergySinkBase.h:32
static simsignal_t residualEnergyCapacityChangedSignal
The signal that is used to publish residual energy capacity changes also including when the energy st...
Definition: IEpEnergyStorage.h:43
value< double, units::s > s
Definition: Units.h:1049
void inet::power::IdealEpEnergyStorage::updateTotalPowerConsumption ( )
overrideprotectedvirtual

Reimplemented from inet::power::EpEnergyStorageBase.

35 {
38 }
virtual void updateTotalPowerConsumption() override
Definition: EpEnergyStorageBase.cc:34
virtual void updateEnergyBalance()
Definition: IdealEpEnergyStorage.cc:46
void inet::power::IdealEpEnergyStorage::updateTotalPowerGeneration ( )
overrideprotectedvirtual

Reimplemented from inet::power::EpEnergyStorageBase.

41 {
44 }
virtual void updateEnergyBalance()
Definition: IdealEpEnergyStorage.cc:46
virtual void updateTotalPowerGeneration() override
Definition: EpEnergyStorageBase.cc:40

Member Data Documentation

J inet::power::IdealEpEnergyStorage::energyBalance = J(NaN)
protected

Referenced by initialize(), and updateEnergyBalance().

simtime_t inet::power::IdealEpEnergyStorage::lastEnergyBalanceUpdate = -1
protected

Referenced by updateEnergyBalance().


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