74 const BandListening *bandListening = check_and_cast<
const BandListening *>(listening);
75 const simtime_t startTime = listening->getStartTime();
76 const simtime_t endTime = listening->getEndTime();
77 Hz carrierFrequency = bandListening->getCarrierFrequency();
78 Hz bandwidth = bandListening->getBandwidth();
83 if (hasTimeDimension && hasFrequencyDimension) {
87 powerMapping->setValue(position, 0);
88 position.setTime(startTime);
89 powerMapping->setValue(position, 0);
90 position.setTime(endTime);
91 powerMapping->setValue(position, 0);
95 powerMapping->setValue(position, 0);
96 position.setTime(startTime);
97 powerMapping->setValue(position,
power.
get());
98 position.setTime(endTime);
99 powerMapping->setValue(position, 0);
103 powerMapping->setValue(position, 0);
104 position.setTime(startTime);
105 powerMapping->setValue(position, 0);
106 position.setTime(endTime);
107 powerMapping->setValue(position, 0);
109 else if (hasTimeDimension) {
111 powerMapping->setValue(position, 0);
112 position.setTime(startTime);
113 powerMapping->setValue(position,
power.
get());
114 position.setTime(endTime);
115 powerMapping->setValue(position, 0);
117 else if (hasFrequencyDimension) {
119 powerMapping->setValue(position, 0);
121 powerMapping->setValue(position,
power.
get());
123 powerMapping->setValue(position, 0);
126 throw cRuntimeError(
"Unknown dimensions");
127 return new DimensionalNoise(startTime, endTime, carrierFrequency, bandwidth, powerMapping);
static const mapped_type MappedZero
Zero value of a Argument value.
Definition: MappingBase.h:427
pow< s,-1 > Hz
Definition: Units.h:766
bool hasDimension(const DimensionSet::value_type &d) const
Returns true if the passed Dimension is inside this DimensionSet.
Definition: MappingBase.h:282
static const Dimension time
Shortcut to the time Dimension, same as 'Dimension("time")', but spares the parsing of a string...
Definition: MappingBase.h:64
const value_type & get() const
Definition: Units.h:89
static Mapping * createMapping(const DimensionSet &domain=DimensionSet(Dimension::time), Mapping::InterpolationMethod intpl=Mapping::LINEAR)
Returns an appropriate changeable Mapping with the specified domain and the specified interpolation m...
Definition: MappingUtils.cc:103
DimensionSet dimensions
Definition: IsotropicDimensionalBackgroundNoise.h:31
W power
Definition: IsotropicDimensionalBackgroundNoise.h:33
static const Dimension frequency
Shortcut to the frequency Dimension, same as 'Dimension("frequency")', but spares the parsing of a st...
Definition: MappingBase.h:68
Mapping::InterpolationMethod interpolationMode
Definition: IsotropicDimensionalBackgroundNoise.h:32