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

#include <EpEnergyStorageBase.h>

Inheritance diagram for 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 inet::power::IdealEpEnergyStorage inet::power::SimpleEpEnergyStorage

Public Member Functions

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 ()
 
- Public Member Functions inherited from inet::power::IEpEnergyStorage
virtual J getNominalEnergyCapacity () const =0
 Returns the nominal energy capacity in the range [0, +infinity]. More...
 
virtual J getResidualEnergyCapacity () const =0
 Returns the residual energy capacity in the range [0, nominalCapacity]. More...
 

Protected Member Functions

void initialize (int stage) override
 
virtual void updateTotalPowerConsumption () override
 
virtual void updateTotalPowerGeneration () 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
 

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...
 
- 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
 

Member Function Documentation

void inet::power::EpEnergyStorageBase::addEnergyConsumer ( const IEnergyConsumer energyConsumer)
overridevirtual

Adds a new energy consumer to the energy source.

The energyConsumer parameter must not be nullptr.

Reimplemented from inet::power::EpEnergySourceBase.

47 {
48  Enter_Method("addEnergyConsumer");
50 }
virtual void addEnergyConsumer(const IEnergyConsumer *energyConsumer) override
Adds a new energy consumer to the energy source.
Definition: EpEnergySourceBase.cc:37
void inet::power::EpEnergyStorageBase::addEnergyGenerator ( const IEnergyGenerator energyGenerator)
overridevirtual

Adds a new energy generator to the energy sink.

The energyGenerator parameter must not be nullptr.

Reimplemented from inet::power::EpEnergySinkBase.

59 {
60  Enter_Method("addEnergyGenerator");
61  EpEnergySinkBase::addEnergyGenerator(energyGenerator);
62 }
virtual void addEnergyGenerator(const IEnergyGenerator *energyGenerator) override
Adds a new energy generator to the energy sink.
Definition: EpEnergySinkBase.cc:37
void inet::power::EpEnergyStorageBase::initialize ( int  stage)
overrideprotected

Referenced by inet::power::SimpleEpEnergyStorage::initialize().

25 {
26  if (stage == INITSTAGE_LOCAL) {
29  WATCH(totalPowerConsumption);
30  WATCH(totalPowerGeneration);
31  }
32 }
virtual W computeTotalPowerGeneration() const
Definition: EpEnergySinkBase.cc:24
W totalPowerConsumption
Definition: EpEnergySourceBase.h:32
Local initializations.
Definition: InitStages.h:35
virtual W computeTotalPowerConsumption() const
Definition: EpEnergySourceBase.cc:24
W totalPowerGeneration
Definition: EpEnergySinkBase.h:32
void inet::power::EpEnergyStorageBase::receiveSignal ( cComponent *  source,
simsignal_t  signal,
double  value,
cObject *  details 
)
overridevirtual
71 {
72  Enter_Method("receiveSignal");
77 }
static simsignal_t powerConsumptionChangedSignal
The signal that is used to publish power consumption changes.
Definition: IEpEnergyConsumer.h:43
virtual void updateTotalPowerConsumption() override
Definition: EpEnergyStorageBase.cc:34
static simsignal_t powerGenerationChangedSignal
The signal that is used to publish power generation changes.
Definition: IEpEnergyGenerator.h:40
virtual void updateTotalPowerGeneration() override
Definition: EpEnergyStorageBase.cc:40
void inet::power::EpEnergyStorageBase::removeEnergyConsumer ( const IEnergyConsumer energyConsumer)
overridevirtual

Removes a previously added energy consumer from this energy source.

This functions throws an exception if the consumer is not found.

Reimplemented from inet::power::EpEnergySourceBase.

53 {
54  Enter_Method("removeEnergyConsumer");
56 }
virtual void removeEnergyConsumer(const IEnergyConsumer *energyConsumer) override
Removes a previously added energy consumer from this energy source.
Definition: EpEnergySourceBase.cc:45
void inet::power::EpEnergyStorageBase::removeEnergyGenerator ( const IEnergyGenerator energyGenerator)
overridevirtual

Removes a previously added energy generator from this energy sink.

This functions throws an exception if the generator is not found.

Reimplemented from inet::power::EpEnergySinkBase.

65 {
66  Enter_Method("removeEnergyGenerator");
68 }
virtual void removeEnergyGenerator(const IEnergyGenerator *energyGenerator) override
Removes a previously added energy generator from this energy sink.
Definition: EpEnergySinkBase.cc:45
void inet::power::EpEnergyStorageBase::updateTotalPowerConsumption ( )
overrideprotectedvirtual

Reimplemented from inet::power::EpEnergySourceBase.

Reimplemented in inet::power::SimpleEpEnergyStorage, and inet::power::IdealEpEnergyStorage.

Referenced by receiveSignal(), inet::power::IdealEpEnergyStorage::updateTotalPowerConsumption(), and inet::power::SimpleEpEnergyStorage::updateTotalPowerConsumption().

35 {
38 }
virtual void updateTotalPowerConsumption()
Definition: EpEnergySourceBase.cc:32
const value_type & get() const
Definition: Units.h:89
static simsignal_t powerConsumptionChangedSignal
The signal that is used to publish power consumption changes.
Definition: IEpEnergySource.h:43
W totalPowerConsumption
Definition: EpEnergySourceBase.h:32
void inet::power::EpEnergyStorageBase::updateTotalPowerGeneration ( )
overrideprotectedvirtual

Reimplemented from inet::power::EpEnergySinkBase.

Reimplemented in inet::power::SimpleEpEnergyStorage, and inet::power::IdealEpEnergyStorage.

Referenced by receiveSignal(), inet::power::IdealEpEnergyStorage::updateTotalPowerGeneration(), and inet::power::SimpleEpEnergyStorage::updateTotalPowerGeneration().

41 {
44 }
const value_type & get() const
Definition: Units.h:89
virtual void updateTotalPowerGeneration()
Definition: EpEnergySinkBase.cc:32
W totalPowerGeneration
Definition: EpEnergySinkBase.h:32
static simsignal_t powerGenerationChangedSignal
The signal that is used to publish power generation changes.
Definition: IEpEnergySink.h:40

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