INET Framework for OMNeT++/OMNEST
inet::physicallayer::ScalarNoise Class Reference

#include <ScalarNoise.h>

Inheritance diagram for inet::physicallayer::ScalarNoise:
inet::physicallayer::NarrowbandNoiseBase inet::physicallayer::NoiseBase inet::physicallayer::INoise inet::physicallayer::IPrintableObject

Public Member Functions

 ScalarNoise (simtime_t startTime, simtime_t endTime, Hz carrierFrequency, Hz bandwidth, const std::map< simtime_t, W > *powerChanges)
 
virtual ~ScalarNoise ()
 
virtual std::ostream & printToStream (std::ostream &stream, int level) const override
 Prints this object to the provided output stream. More...
 
virtual const std::map< simtime_t, W > * getPowerChanges () const
 
virtual W computeMaxPower (simtime_t startTime, simtime_t endTime) const override
 
- Public Member Functions inherited from inet::physicallayer::NarrowbandNoiseBase
 NarrowbandNoiseBase (simtime_t startTime, simtime_t endTime, Hz carrierFrequency, Hz bandwidth)
 
virtual Hz getCarrierFrequency () const
 
virtual Hz getBandwidth () const
 
- Public Member Functions inherited from inet::physicallayer::NoiseBase
 NoiseBase (simtime_t startTime, simtime_t endTime)
 
virtual const simtime_t getStartTime () const override
 
virtual const simtime_t getEndTime () const override
 
- Public Member Functions inherited from inet::physicallayer::IPrintableObject
virtual ~IPrintableObject ()
 
virtual std::string getInfoStringRepresentation () const
 
virtual std::string getDetailStringRepresentation () const
 
virtual std::string getDebugStringRepresentation () const
 
virtual std::string getTraceStringRepresentation () const
 
virtual std::string getCompleteStringRepresentation () const
 

Protected Attributes

const std::map< simtime_t, W > * powerChanges
 
- Protected Attributes inherited from inet::physicallayer::NarrowbandNoiseBase
const Hz carrierFrequency
 
const Hz bandwidth
 
- Protected Attributes inherited from inet::physicallayer::NoiseBase
const simtime_t startTime
 
const simtime_t endTime
 

Additional Inherited Members

- Public Types inherited from inet::physicallayer::IPrintableObject
enum  PrintLevel {
  PRINT_LEVEL_TRACE, PRINT_LEVEL_DEBUG, PRINT_LEVEL_DETAIL, PRINT_LEVEL_INFO,
  PRINT_LEVEL_COMPLETE = INT_MIN
}
 

Constructor & Destructor Documentation

inet::physicallayer::ScalarNoise::ScalarNoise ( simtime_t  startTime,
simtime_t  endTime,
Hz  carrierFrequency,
Hz  bandwidth,
const std::map< simtime_t, W > *  powerChanges 
)
24  :
27 {
28 }
const Hz carrierFrequency
Definition: NarrowbandNoiseBase.h:30
const simtime_t endTime
Definition: NoiseBase.h:31
const simtime_t startTime
Definition: NoiseBase.h:30
const Hz bandwidth
Definition: NarrowbandNoiseBase.h:31
NarrowbandNoiseBase(simtime_t startTime, simtime_t endTime, Hz carrierFrequency, Hz bandwidth)
Definition: NarrowbandNoiseBase.cc:24
const std::map< simtime_t, W > * powerChanges
Definition: ScalarNoise.h:30
virtual inet::physicallayer::ScalarNoise::~ScalarNoise ( )
inlinevirtual
34 { delete powerChanges; }
const std::map< simtime_t, W > * powerChanges
Definition: ScalarNoise.h:30

Member Function Documentation

W inet::physicallayer::ScalarNoise::computeMaxPower ( simtime_t  startTime,
simtime_t  endTime 
) const
overridevirtual

Implements inet::physicallayer::NarrowbandNoiseBase.

39 {
40  W noisePower = W(0);
41  W maxNoisePower = W(0);
42  for (const auto & elem : *powerChanges) {
43  noisePower += elem.second;
44  if (noisePower > maxNoisePower && startTime <= elem.first && elem.first <= endTime)
45  maxNoisePower = noisePower;
46  }
47  return maxNoisePower;
48 }
const simtime_t endTime
Definition: NoiseBase.h:31
const simtime_t startTime
Definition: NoiseBase.h:30
compose< J, pow< s,-1 > > W
Definition: Units.h:770
const std::map< simtime_t, W > * powerChanges
Definition: ScalarNoise.h:30
virtual const std::map<simtime_t, W>* inet::physicallayer::ScalarNoise::getPowerChanges ( ) const
inlinevirtual

Referenced by inet::physicallayer::ScalarAnalogModelBase::computeNoise().

37 { return powerChanges; }
const std::map< simtime_t, W > * powerChanges
Definition: ScalarNoise.h:30
std::ostream & inet::physicallayer::ScalarNoise::printToStream ( std::ostream &  stream,
int  level 
) const
overridevirtual

Prints this object to the provided output stream.

Function calls to operator<< with pointers or references either const or not are all forwarded to this function.

Reimplemented from inet::physicallayer::NarrowbandNoiseBase.

31 {
32  stream << "ScalarNoise";
33  if (level <= PRINT_LEVEL_DETAIL)
34  stream << ", powerChanges = " << powerChanges ;
35  return NarrowbandNoiseBase::printToStream(stream, level);
36 }
virtual std::ostream & printToStream(std::ostream &stream, int level) const override
Prints this object to the provided output stream.
Definition: NarrowbandNoiseBase.cc:31
const std::map< simtime_t, W > * powerChanges
Definition: ScalarNoise.h:30

Member Data Documentation

const std::map<simtime_t, W>* inet::physicallayer::ScalarNoise::powerChanges
protected

Referenced by computeMaxPower(), and printToStream().


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