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

#include <MediumLimitCache.h>

Inheritance diagram for inet::physicallayer::MediumLimitCache:
inet::physicallayer::IMediumLimitCache inet::physicallayer::IPrintableObject

Public Member Functions

 MediumLimitCache ()
 
virtual std::ostream & printToStream (std::ostream &stream, int level) const override
 Prints this object to the provided output stream. More...
 
virtual void addRadio (const IRadio *radio) override
 Notifies the cache when a radio is added to the medium. More...
 
virtual void removeRadio (const IRadio *radio) override
 Notifies the cache when a radio is removed from the medium. More...
 
Query limits
virtual Coord getMinConstraintArea () const override
 Returns the minimum possible position among the radios, the coordinate values are in the range (-infinity, +infinity) or NaN if unspecified. More...
 
virtual Coord getMaxConstraintArea () const override
 Returns the maximum possible position among the radios, the coordinate values are in the range (-infinity, +infinity) or NaN if unspecified. More...
 
virtual mps getMaxSpeed () const override
 Returns the maximum possible speed among the radios, the value is in the range [0, +infinity) or NaN if unspecified. More...
 
virtual W getMaxTransmissionPower () const override
 Returns the maximum possible transmission power among the radios, the value is in the range [0, +infinity) or NaN if unspecified. More...
 
virtual W getMinInterferencePower () const override
 Returns the minimum possible interference power among the radios, the value is in the range [0, +infinity) or NaN if unspecified. More...
 
virtual W getMinReceptionPower () const override
 Returns the minimum possible reception power among the radios, the value is in the range [0, +infinity) or NaN if unspecified. More...
 
virtual double getMaxAntennaGain () const override
 Returns the maximum possible antenna gain among the radios, the value is in the range [1, +infinity) or NaN if unspecified. More...
 
virtual const simtime_t & getMinInterferenceTime () const override
 Returns the minimum required signal interference time among the radios, the value is in the range [0, +infinity) or NaN if unspecified. More...
 
virtual const simtime_t & getMaxTransmissionDuration () const override
 Returns the maximum possible transmission durations among the radios, the value is in the range [0, +infinity) or NaN if unspecified. More...
 
virtual m getMaxCommunicationRange () const override
 Returns the maximum possible communication range among the radios, the value is in the range [0, +infinity) or NaN if unspecified. More...
 
virtual m getMaxInterferenceRange () const override
 Returns the maximum possible interference range among the radios, the value is in the range [0, +infinity) or NaN if unspecified. More...
 
virtual m getMaxCommunicationRange (const IRadio *radio) const override
 Returns the maximum possible communication range for a given radio, the value is in the range [0, +infinity) or NaN if unspecified. More...
 
virtual m getMaxInterferenceRange (const IRadio *radio) const override
 Returns the maximum possible interference range for a given radio, the value is in the range [0, +infinity) or NaN if unspecified. More...
 
- 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 Member Functions

virtual int numInitStages () const override
 
virtual void initialize (int stage) override
 
Compute limits
virtual Coord computeMinConstraintArea () const
 
virtual Coord computeMaxConstreaintArea () const
 
virtual mps computeMaxSpeed () const
 
virtual W computeMaxTransmissionPower () const
 
virtual W computeMinInterferencePower () const
 
virtual W computeMinReceptionPower () const
 
virtual double computeMaxAntennaGain () const
 
virtual const simtime_t computeMinInterferenceTime () const
 
virtual const simtime_t computeMaxTransmissionDuration () const
 
virtual m computeMaxRange (W maxTransmissionPower, W minReceptionPower) const
 
virtual m computeMaxCommunicationRange () const
 
virtual m computeMaxInterferenceRange () const
 
virtual void updateLimits ()
 

Protected Attributes

const IRadioMediumradioMedium
 The corresponding radio medium is never nullptr. More...
 
std::vector< const IRadio * > radios
 The list of communicating radios on the medium. More...
 
Various radio medium limits.
Coord minConstraintArea
 The constraint area minimum among the radios is in the range [-infinity, +infinity] or NaN if unspecified. More...
 
Coord maxConstraintArea
 The constraint area maximum among the radios is in the range [-infinity, +infinity] or NaN if unspecified. More...
 
mps maxSpeed
 The maximum speed among the radios is in the range [0, +infinity) or NaN if unspecified. More...
 
W maxTransmissionPower
 The maximum transmission power among the radio transmitters is in the range [0, +infinity) or NaN if unspecified. More...
 
W minInterferencePower
 The minimum interference power among the radio receivers is in the range [0, +infinity) or NaN if unspecified. More...
 
W minReceptionPower
 The minimum reception power among the radio receivers is in the range [0, +infinity) or NaN if unspecified. More...
 
double maxAntennaGain
 The maximum gain among the radio antennas is in the range [1, +infinity). More...
 
simtime_t minInterferenceTime
 The minimum overlapping in time needed to consider two transmissions interfering. More...
 
simtime_t maxTransmissionDuration
 The maximum transmission duration of a radio signal. More...
 
m maxCommunicationRange
 The maximum communication range where a transmission can still be potentially successfully received is in the range [0, +infinity) or NaN if unspecified. More...
 
m maxInterferenceRange
 The maximum interference range where a transmission is still considered to some effect on other transmissions is in the range [0, +infinity) or NaN if unspecified. More...
 

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::MediumLimitCache::MediumLimitCache ( )
63  :
64  radioMedium(nullptr),
67  maxSpeed(mps(NaN)),
76 {
77 }
W maxTransmissionPower
The maximum transmission power among the radio transmitters is in the range [0, +infinity) or NaN if ...
Definition: MediumLimitCache.h:61
W minReceptionPower
The minimum reception power among the radio receivers is in the range [0, +infinity) or NaN if unspec...
Definition: MediumLimitCache.h:71
m maxCommunicationRange
The maximum communication range where a transmission can still be potentially successfully received i...
Definition: MediumLimitCache.h:92
m maxInterferenceRange
The maximum interference range where a transmission is still considered to some effect on other trans...
Definition: MediumLimitCache.h:98
simtime_t maxTransmissionDuration
The maximum transmission duration of a radio signal.
Definition: MediumLimitCache.h:86
static const Coord NIL
Constant with all values set to 0.
Definition: Coord.h:40
W minInterferencePower
The minimum interference power among the radio receivers is in the range [0, +infinity) or NaN if uns...
Definition: MediumLimitCache.h:66
compose< J, pow< s,-1 > > W
Definition: Units.h:770
const IRadioMedium * radioMedium
The corresponding radio medium is never nullptr.
Definition: MediumLimitCache.h:34
simtime_t minInterferenceTime
The minimum overlapping in time needed to consider two transmissions interfering. ...
Definition: MediumLimitCache.h:81
#define NaN
Definition: INETMath.h:103
Coord maxConstraintArea
The constraint area maximum among the radios is in the range [-infinity, +infinity] or NaN if unspeci...
Definition: MediumLimitCache.h:51
double maxAntennaGain
The maximum gain among the radio antennas is in the range [1, +infinity).
Definition: MediumLimitCache.h:75
Coord minConstraintArea
The constraint area minimum among the radios is in the range [-infinity, +infinity] or NaN if unspeci...
Definition: MediumLimitCache.h:46
mps maxSpeed
The maximum speed among the radios is in the range [0, +infinity) or NaN if unspecified.
Definition: MediumLimitCache.h:56
compose< m, pow< s,-1 > > mps
Definition: Units.h:968
value< double, units::m > m
Definition: Units.h:1047

Member Function Documentation

void inet::physicallayer::MediumLimitCache::addRadio ( const IRadio radio)
overridevirtual

Notifies the cache when a radio is added to the medium.

Implements inet::physicallayer::IMediumLimitCache.

131 {
132  radios.push_back(radio);
133  updateLimits();
134 }
std::vector< const IRadio * > radios
The list of communicating radios on the medium.
Definition: MediumLimitCache.h:39
virtual void updateLimits()
Definition: MediumLimitCache.cc:115
double inet::physicallayer::MediumLimitCache::computeMaxAntennaGain ( ) const
protectedvirtual

Referenced by updateLimits().

183 {
184  double maxAntennaGain = math::dB2fraction(par("maxAntennaGain"));
185  for (const auto radio : radios) {
186  if (radio != nullptr)
187  maxAntennaGain = maxIgnoreNaN(maxAntennaGain, radio->getAntenna()->getMaxGain());
188  }
189  return maxAntennaGain;
190 }
std::vector< const IRadio * > radios
The list of communicating radios on the medium.
Definition: MediumLimitCache.h:39
double dB2fraction(double dB)
Converts a dB value to fraction.
Definition: INETMath.h:166
double maxAntennaGain
The maximum gain among the radio antennas is in the range [1, +infinity).
Definition: MediumLimitCache.h:75
T maxIgnoreNaN(T a, T b)
Definition: MediumLimitCache.cc:39
m inet::physicallayer::MediumLimitCache::computeMaxCommunicationRange ( ) const
protectedvirtual

Referenced by updateLimits().

201 {
202  return maxIgnoreNaN(m(par("maxCommunicationRange")), computeMaxRange(maxTransmissionPower, minReceptionPower));
203 }
W maxTransmissionPower
The maximum transmission power among the radio transmitters is in the range [0, +infinity) or NaN if ...
Definition: MediumLimitCache.h:61
W minReceptionPower
The minimum reception power among the radio receivers is in the range [0, +infinity) or NaN if unspec...
Definition: MediumLimitCache.h:71
virtual m computeMaxRange(W maxTransmissionPower, W minReceptionPower) const
Definition: MediumLimitCache.cc:192
T maxIgnoreNaN(T a, T b)
Definition: MediumLimitCache.cc:39
value< double, units::m > m
Definition: Units.h:1047
Coord inet::physicallayer::MediumLimitCache::computeMaxConstreaintArea ( ) const
protectedvirtual

Referenced by updateLimits().

233 {
235  for (const auto radio : radios) {
236  if (radio != nullptr) {
237  const IMobility *mobility = radio->getAntenna()->getMobility();
238  maxConstraintArea = maxConstraintArea.max(mobility->getConstraintAreaMax());
239  }
240  }
241  return maxConstraintArea;
242 }
static const Coord NIL
Constant with all values set to 0.
Definition: Coord.h:40
std::vector< const IRadio * > radios
The list of communicating radios on the medium.
Definition: MediumLimitCache.h:39
Coord maxConstraintArea
The constraint area maximum among the radios is in the range [-infinity, +infinity] or NaN if unspeci...
Definition: MediumLimitCache.h:51
Coord max(const Coord &a)
Returns the maximal coordinates.
Definition: Coord.h:275
m inet::physicallayer::MediumLimitCache::computeMaxInterferenceRange ( ) const
protectedvirtual

Referenced by updateLimits().

206 {
207  return maxIgnoreNaN(m(par("maxInterferenceRange")), computeMaxRange(maxTransmissionPower, minInterferencePower));
208 }
W maxTransmissionPower
The maximum transmission power among the radio transmitters is in the range [0, +infinity) or NaN if ...
Definition: MediumLimitCache.h:61
virtual m computeMaxRange(W maxTransmissionPower, W minReceptionPower) const
Definition: MediumLimitCache.cc:192
W minInterferencePower
The minimum interference power among the radio receivers is in the range [0, +infinity) or NaN if uns...
Definition: MediumLimitCache.h:66
T maxIgnoreNaN(T a, T b)
Definition: MediumLimitCache.cc:39
value< double, units::m > m
Definition: Units.h:1047
m inet::physicallayer::MediumLimitCache::computeMaxRange ( W  maxTransmissionPower,
W  minReceptionPower 
) const
protectedvirtual

Referenced by computeMaxCommunicationRange(), computeMaxInterferenceRange(), getMaxCommunicationRange(), and getMaxInterferenceRange().

193 {
194  // TODO: this is NaN by default
195  Hz carrierFrequency = Hz(par("carrierFrequency"));
197  return radioMedium->getPathLoss()->computeRange(radioMedium->getPropagation()->getPropagationSpeed(), carrierFrequency, loss);
198 }
W maxTransmissionPower
The maximum transmission power among the radio transmitters is in the range [0, +infinity) or NaN if ...
Definition: MediumLimitCache.h:61
pow< s,-1 > Hz
Definition: Units.h:766
W minReceptionPower
The minimum reception power among the radio receivers is in the range [0, +infinity) or NaN if unspec...
Definition: MediumLimitCache.h:71
virtual const IPropagation * getPropagation() const =0
Returns the radio signal propagation model of this radio medium.
const IRadioMedium * radioMedium
The corresponding radio medium is never nullptr.
Definition: MediumLimitCache.h:34
double maxAntennaGain
The maximum gain among the radio antennas is in the range [1, +infinity).
Definition: MediumLimitCache.h:75
virtual mps getPropagationSpeed() const =0
Returns the theoretical propagation speed of radio signals in the range (0, +infinity).
pow< internal::none, 0 > unit
Definition: Units.h:60
virtual m computeRange(mps propagationSpeed, Hz frequency, double loss) const =0
Returns the range for the given loss factor.
virtual const IPathLoss * getPathLoss() const =0
Returns the radio signal path loss model of this radio medium.
mps inet::physicallayer::MediumLimitCache::computeMaxSpeed ( ) const
protectedvirtual

Referenced by updateLimits().

143 {
144  mps maxSpeed = mps(par("maxSpeed"));
145  for (const auto radio : radios) {
146  if (radio != nullptr)
147  maxSpeed = maxIgnoreNaN(maxSpeed, mps(radio->getAntenna()->getMobility()->getMaxSpeed()));
148  }
149  return maxSpeed;
150 }
std::vector< const IRadio * > radios
The list of communicating radios on the medium.
Definition: MediumLimitCache.h:39
mps maxSpeed
The maximum speed among the radios is in the range [0, +infinity) or NaN if unspecified.
Definition: MediumLimitCache.h:56
T maxIgnoreNaN(T a, T b)
Definition: MediumLimitCache.cc:39
compose< m, pow< s,-1 > > mps
Definition: Units.h:968
const simtime_t inet::physicallayer::MediumLimitCache::computeMaxTransmissionDuration ( ) const
protectedvirtual

Referenced by updateLimits().

216 {
217  return par("maxTransmissionDuration").doubleValue();
218 }
W inet::physicallayer::MediumLimitCache::computeMaxTransmissionPower ( ) const
protectedvirtual

Referenced by updateLimits().

153 {
154  W maxTransmissionPower = W(par("maxTransmissionPower"));
155  for (const auto radio : radios) {
156  if (radio != nullptr)
157  maxTransmissionPower = maxIgnoreNaN(maxTransmissionPower, radio->getTransmitter()->getMaxPower());
158  }
159  return maxTransmissionPower;
160 }
W maxTransmissionPower
The maximum transmission power among the radio transmitters is in the range [0, +infinity) or NaN if ...
Definition: MediumLimitCache.h:61
compose< J, pow< s,-1 > > W
Definition: Units.h:770
std::vector< const IRadio * > radios
The list of communicating radios on the medium.
Definition: MediumLimitCache.h:39
T maxIgnoreNaN(T a, T b)
Definition: MediumLimitCache.cc:39
Coord inet::physicallayer::MediumLimitCache::computeMinConstraintArea ( ) const
protectedvirtual

Referenced by updateLimits().

221 {
223  for (const auto radio : radios) {
224  if (radio != nullptr) {
225  const IMobility *mobility = radio->getAntenna()->getMobility();
226  minConstraintArea = minConstraintArea.min(mobility->getConstraintAreaMin());
227  }
228  }
229  return minConstraintArea;
230 }
static const Coord NIL
Constant with all values set to 0.
Definition: Coord.h:40
std::vector< const IRadio * > radios
The list of communicating radios on the medium.
Definition: MediumLimitCache.h:39
Coord minConstraintArea
The constraint area minimum among the radios is in the range [-infinity, +infinity] or NaN if unspeci...
Definition: MediumLimitCache.h:46
Coord min(const Coord &a)
Returns the minimal coordinates.
Definition: Coord.h:265
W inet::physicallayer::MediumLimitCache::computeMinInterferencePower ( ) const
protectedvirtual

Referenced by updateLimits().

163 {
164  W minInterferencePower = mW(math::dBm2mW(par("minInterferencePower")));
165  for (const auto radio : radios) {
166  if (radio != nullptr)
167  minInterferencePower = minIgnoreNaN(minInterferencePower, radio->getReceiver()->getMinInterferencePower());
168  }
169  return minInterferencePower;
170 }
double dBm2mW(double dBm)
Converts a dBm value into milliwatts.
Definition: INETMath.h:176
W minInterferencePower
The minimum interference power among the radio receivers is in the range [0, +infinity) or NaN if uns...
Definition: MediumLimitCache.h:66
compose< J, pow< s,-1 > > W
Definition: Units.h:770
std::vector< const IRadio * > radios
The list of communicating radios on the medium.
Definition: MediumLimitCache.h:39
milli< W >::type mW
Definition: Units.h:903
T minIgnoreNaN(T a, T b)
Definition: MediumLimitCache.cc:27
const simtime_t inet::physicallayer::MediumLimitCache::computeMinInterferenceTime ( ) const
protectedvirtual

Referenced by updateLimits().

211 {
212  return par("minInterferenceTime").doubleValue();
213 }
W inet::physicallayer::MediumLimitCache::computeMinReceptionPower ( ) const
protectedvirtual

Referenced by updateLimits().

173 {
174  W minReceptionPower = mW(math::dBm2mW(par("minReceptionPower")));
175  for (const auto radio : radios) {
176  if (radio != nullptr)
177  minReceptionPower = minIgnoreNaN(minReceptionPower, radio->getReceiver()->getMinReceptionPower());
178  }
179  return minReceptionPower;
180 }
W minReceptionPower
The minimum reception power among the radio receivers is in the range [0, +infinity) or NaN if unspec...
Definition: MediumLimitCache.h:71
double dBm2mW(double dBm)
Converts a dBm value into milliwatts.
Definition: INETMath.h:176
compose< J, pow< s,-1 > > W
Definition: Units.h:770
std::vector< const IRadio * > radios
The list of communicating radios on the medium.
Definition: MediumLimitCache.h:39
milli< W >::type mW
Definition: Units.h:903
T minIgnoreNaN(T a, T b)
Definition: MediumLimitCache.cc:27
virtual double inet::physicallayer::MediumLimitCache::getMaxAntennaGain ( ) const
inlineoverridevirtual

Returns the maximum possible antenna gain among the radios, the value is in the range [1, +infinity) or NaN if unspecified.

Implements inet::physicallayer::IMediumLimitCache.

147 { return maxAntennaGain; }
double maxAntennaGain
The maximum gain among the radio antennas is in the range [1, +infinity).
Definition: MediumLimitCache.h:75
virtual m inet::physicallayer::MediumLimitCache::getMaxCommunicationRange ( ) const
inlineoverridevirtual

Returns the maximum possible communication range among the radios, the value is in the range [0, +infinity) or NaN if unspecified.

Implements inet::physicallayer::IMediumLimitCache.

152 { return maxCommunicationRange; }
m maxCommunicationRange
The maximum communication range where a transmission can still be potentially successfully received i...
Definition: MediumLimitCache.h:92
m inet::physicallayer::MediumLimitCache::getMaxCommunicationRange ( const IRadio radio) const
overridevirtual

Returns the maximum possible communication range for a given radio, the value is in the range [0, +infinity) or NaN if unspecified.

Implements inet::physicallayer::IMediumLimitCache.

253 {
254  m maxCommunicationRange = computeMaxRange(radio->getTransmitter()->getMaxPower(), minReceptionPower);
255  if (!std::isnan(maxCommunicationRange.get()))
256  return maxCommunicationRange;
257  return radio->getTransmitter()->getMaxCommunicationRange();
258 }
W minReceptionPower
The minimum reception power among the radio receivers is in the range [0, +infinity) or NaN if unspec...
Definition: MediumLimitCache.h:71
m maxCommunicationRange
The maximum communication range where a transmission can still be potentially successfully received i...
Definition: MediumLimitCache.h:92
virtual m computeMaxRange(W maxTransmissionPower, W minReceptionPower) const
Definition: MediumLimitCache.cc:192
value< double, units::m > m
Definition: Units.h:1047
virtual Coord inet::physicallayer::MediumLimitCache::getMaxConstraintArea ( ) const
inlineoverridevirtual

Returns the maximum possible position among the radios, the coordinate values are in the range (-infinity, +infinity) or NaN if unspecified.

Implements inet::physicallayer::IMediumLimitCache.

139 { return maxConstraintArea; }
Coord maxConstraintArea
The constraint area maximum among the radios is in the range [-infinity, +infinity] or NaN if unspeci...
Definition: MediumLimitCache.h:51
virtual m inet::physicallayer::MediumLimitCache::getMaxInterferenceRange ( ) const
inlineoverridevirtual

Returns the maximum possible interference range among the radios, the value is in the range [0, +infinity) or NaN if unspecified.

Implements inet::physicallayer::IMediumLimitCache.

153 { return maxInterferenceRange; }
m maxInterferenceRange
The maximum interference range where a transmission is still considered to some effect on other trans...
Definition: MediumLimitCache.h:98
m inet::physicallayer::MediumLimitCache::getMaxInterferenceRange ( const IRadio radio) const
overridevirtual

Returns the maximum possible interference range for a given radio, the value is in the range [0, +infinity) or NaN if unspecified.

Implements inet::physicallayer::IMediumLimitCache.

245 {
246  m maxInterferenceRange = computeMaxRange(radio->getTransmitter()->getMaxPower(), minInterferencePower);
247  if (!std::isnan(maxInterferenceRange.get()))
248  return maxInterferenceRange;
249  return radio->getTransmitter()->getMaxInterferenceRange();
250 }
m maxInterferenceRange
The maximum interference range where a transmission is still considered to some effect on other trans...
Definition: MediumLimitCache.h:98
virtual m computeMaxRange(W maxTransmissionPower, W minReceptionPower) const
Definition: MediumLimitCache.cc:192
W minInterferencePower
The minimum interference power among the radio receivers is in the range [0, +infinity) or NaN if uns...
Definition: MediumLimitCache.h:66
value< double, units::m > m
Definition: Units.h:1047
virtual mps inet::physicallayer::MediumLimitCache::getMaxSpeed ( ) const
inlineoverridevirtual

Returns the maximum possible speed among the radios, the value is in the range [0, +infinity) or NaN if unspecified.

Implements inet::physicallayer::IMediumLimitCache.

141 { return maxSpeed; }
mps maxSpeed
The maximum speed among the radios is in the range [0, +infinity) or NaN if unspecified.
Definition: MediumLimitCache.h:56
virtual const simtime_t& inet::physicallayer::MediumLimitCache::getMaxTransmissionDuration ( ) const
inlineoverridevirtual

Returns the maximum possible transmission durations among the radios, the value is in the range [0, +infinity) or NaN if unspecified.

Implements inet::physicallayer::IMediumLimitCache.

150 { return maxTransmissionDuration; }
simtime_t maxTransmissionDuration
The maximum transmission duration of a radio signal.
Definition: MediumLimitCache.h:86
virtual W inet::physicallayer::MediumLimitCache::getMaxTransmissionPower ( ) const
inlineoverridevirtual

Returns the maximum possible transmission power among the radios, the value is in the range [0, +infinity) or NaN if unspecified.

Implements inet::physicallayer::IMediumLimitCache.

143 { return maxTransmissionPower; }
W maxTransmissionPower
The maximum transmission power among the radio transmitters is in the range [0, +infinity) or NaN if ...
Definition: MediumLimitCache.h:61
virtual Coord inet::physicallayer::MediumLimitCache::getMinConstraintArea ( ) const
inlineoverridevirtual

Returns the minimum possible position among the radios, the coordinate values are in the range (-infinity, +infinity) or NaN if unspecified.

Implements inet::physicallayer::IMediumLimitCache.

138 { return minConstraintArea; }
Coord minConstraintArea
The constraint area minimum among the radios is in the range [-infinity, +infinity] or NaN if unspeci...
Definition: MediumLimitCache.h:46
virtual W inet::physicallayer::MediumLimitCache::getMinInterferencePower ( ) const
inlineoverridevirtual

Returns the minimum possible interference power among the radios, the value is in the range [0, +infinity) or NaN if unspecified.

Implements inet::physicallayer::IMediumLimitCache.

144 { return minInterferencePower; }
W minInterferencePower
The minimum interference power among the radio receivers is in the range [0, +infinity) or NaN if uns...
Definition: MediumLimitCache.h:66
virtual const simtime_t& inet::physicallayer::MediumLimitCache::getMinInterferenceTime ( ) const
inlineoverridevirtual

Returns the minimum required signal interference time among the radios, the value is in the range [0, +infinity) or NaN if unspecified.

Implements inet::physicallayer::IMediumLimitCache.

149 { return minInterferenceTime; }
simtime_t minInterferenceTime
The minimum overlapping in time needed to consider two transmissions interfering. ...
Definition: MediumLimitCache.h:81
virtual W inet::physicallayer::MediumLimitCache::getMinReceptionPower ( ) const
inlineoverridevirtual

Returns the minimum possible reception power among the radios, the value is in the range [0, +infinity) or NaN if unspecified.

Implements inet::physicallayer::IMediumLimitCache.

145 { return minReceptionPower; }
W minReceptionPower
The minimum reception power among the radio receivers is in the range [0, +infinity) or NaN if unspec...
Definition: MediumLimitCache.h:71
void inet::physicallayer::MediumLimitCache::initialize ( int  stage)
overrideprotectedvirtual
80 {
81  if (stage == INITSTAGE_LOCAL) {
82  radioMedium = check_and_cast<IRadioMedium *>(getParentModule());
83  WATCH(minConstraintArea);
84  WATCH(maxConstraintArea);
85  WATCH(maxSpeed);
86  WATCH(maxTransmissionPower);
87  WATCH(minInterferencePower);
88  WATCH(minReceptionPower);
89  WATCH(maxAntennaGain);
90  WATCH(minInterferenceTime);
92  WATCH(maxCommunicationRange);
93  WATCH(maxInterferenceRange);
94  }
95 }
W maxTransmissionPower
The maximum transmission power among the radio transmitters is in the range [0, +infinity) or NaN if ...
Definition: MediumLimitCache.h:61
W minReceptionPower
The minimum reception power among the radio receivers is in the range [0, +infinity) or NaN if unspec...
Definition: MediumLimitCache.h:71
m maxCommunicationRange
The maximum communication range where a transmission can still be potentially successfully received i...
Definition: MediumLimitCache.h:92
m maxInterferenceRange
The maximum interference range where a transmission is still considered to some effect on other trans...
Definition: MediumLimitCache.h:98
simtime_t maxTransmissionDuration
The maximum transmission duration of a radio signal.
Definition: MediumLimitCache.h:86
W minInterferencePower
The minimum interference power among the radio receivers is in the range [0, +infinity) or NaN if uns...
Definition: MediumLimitCache.h:66
const IRadioMedium * radioMedium
The corresponding radio medium is never nullptr.
Definition: MediumLimitCache.h:34
simtime_t minInterferenceTime
The minimum overlapping in time needed to consider two transmissions interfering. ...
Definition: MediumLimitCache.h:81
Local initializations.
Definition: InitStages.h:35
Coord maxConstraintArea
The constraint area maximum among the radios is in the range [-infinity, +infinity] or NaN if unspeci...
Definition: MediumLimitCache.h:51
double maxAntennaGain
The maximum gain among the radio antennas is in the range [1, +infinity).
Definition: MediumLimitCache.h:75
Coord minConstraintArea
The constraint area minimum among the radios is in the range [-infinity, +infinity] or NaN if unspeci...
Definition: MediumLimitCache.h:46
mps maxSpeed
The maximum speed among the radios is in the range [0, +infinity) or NaN if unspecified.
Definition: MediumLimitCache.h:56
virtual int inet::physicallayer::MediumLimitCache::numInitStages ( ) const
inlineoverrideprotectedvirtual
102 { return NUM_INIT_STAGES; }
The number of initialization stages.
Definition: InitStages.h:116
std::ostream & inet::physicallayer::MediumLimitCache::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::IPrintableObject.

98 {
99  stream << "RadioMediumLimits";
100  if (level <= PRINT_LEVEL_TRACE)
101  stream << ", minConstraintArea = " << minConstraintArea
102  << ", maxConstraintArea = " << maxConstraintArea
103  << ", maxSpeed = " << maxSpeed
104  << ", maxTransmissionPower = " << maxTransmissionPower
105  << ", minInterferencePower = " << minInterferencePower
106  << ", minReceptionPower = " << minReceptionPower
107  << ", maxAntennaGain = " << maxAntennaGain
108  << ", minInterferenceTime = " << minInterferenceTime
109  << ", maxTransmissionDuration = " << maxTransmissionDuration
110  << ", maxCommunicationRange = " << maxCommunicationRange
111  << ", maxInterferenceRange = " << maxInterferenceRange;
112  return stream;
113 }
W maxTransmissionPower
The maximum transmission power among the radio transmitters is in the range [0, +infinity) or NaN if ...
Definition: MediumLimitCache.h:61
W minReceptionPower
The minimum reception power among the radio receivers is in the range [0, +infinity) or NaN if unspec...
Definition: MediumLimitCache.h:71
m maxCommunicationRange
The maximum communication range where a transmission can still be potentially successfully received i...
Definition: MediumLimitCache.h:92
m maxInterferenceRange
The maximum interference range where a transmission is still considered to some effect on other trans...
Definition: MediumLimitCache.h:98
simtime_t maxTransmissionDuration
The maximum transmission duration of a radio signal.
Definition: MediumLimitCache.h:86
W minInterferencePower
The minimum interference power among the radio receivers is in the range [0, +infinity) or NaN if uns...
Definition: MediumLimitCache.h:66
simtime_t minInterferenceTime
The minimum overlapping in time needed to consider two transmissions interfering. ...
Definition: MediumLimitCache.h:81
Coord maxConstraintArea
The constraint area maximum among the radios is in the range [-infinity, +infinity] or NaN if unspeci...
Definition: MediumLimitCache.h:51
double maxAntennaGain
The maximum gain among the radio antennas is in the range [1, +infinity).
Definition: MediumLimitCache.h:75
Coord minConstraintArea
The constraint area minimum among the radios is in the range [-infinity, +infinity] or NaN if unspeci...
Definition: MediumLimitCache.h:46
mps maxSpeed
The maximum speed among the radios is in the range [0, +infinity) or NaN if unspecified.
Definition: MediumLimitCache.h:56
void inet::physicallayer::MediumLimitCache::removeRadio ( const IRadio radio)
overridevirtual

Notifies the cache when a radio is removed from the medium.

Implements inet::physicallayer::IMediumLimitCache.

137 {
138  radios.erase(std::remove(radios.begin(), radios.end(), radio), radios.end());
139  updateLimits();
140 }
void remove(std::vector< T > &v, const A &a)
Definition: stlutils.h:91
std::vector< const IRadio * > radios
The list of communicating radios on the medium.
Definition: MediumLimitCache.h:39
virtual void updateLimits()
Definition: MediumLimitCache.cc:115
void inet::physicallayer::MediumLimitCache::updateLimits ( )
protectedvirtual

Referenced by addRadio(), and removeRadio().

116 {
128 }
W maxTransmissionPower
The maximum transmission power among the radio transmitters is in the range [0, +infinity) or NaN if ...
Definition: MediumLimitCache.h:61
W minReceptionPower
The minimum reception power among the radio receivers is in the range [0, +infinity) or NaN if unspec...
Definition: MediumLimitCache.h:71
m maxCommunicationRange
The maximum communication range where a transmission can still be potentially successfully received i...
Definition: MediumLimitCache.h:92
m maxInterferenceRange
The maximum interference range where a transmission is still considered to some effect on other trans...
Definition: MediumLimitCache.h:98
simtime_t maxTransmissionDuration
The maximum transmission duration of a radio signal.
Definition: MediumLimitCache.h:86
virtual const simtime_t computeMinInterferenceTime() const
Definition: MediumLimitCache.cc:210
virtual W computeMinInterferencePower() const
Definition: MediumLimitCache.cc:162
virtual Coord computeMinConstraintArea() const
Definition: MediumLimitCache.cc:220
virtual m computeMaxCommunicationRange() const
Definition: MediumLimitCache.cc:200
W minInterferencePower
The minimum interference power among the radio receivers is in the range [0, +infinity) or NaN if uns...
Definition: MediumLimitCache.h:66
virtual double computeMaxAntennaGain() const
Definition: MediumLimitCache.cc:182
simtime_t minInterferenceTime
The minimum overlapping in time needed to consider two transmissions interfering. ...
Definition: MediumLimitCache.h:81
Coord maxConstraintArea
The constraint area maximum among the radios is in the range [-infinity, +infinity] or NaN if unspeci...
Definition: MediumLimitCache.h:51
double maxAntennaGain
The maximum gain among the radio antennas is in the range [1, +infinity).
Definition: MediumLimitCache.h:75
virtual W computeMinReceptionPower() const
Definition: MediumLimitCache.cc:172
Coord minConstraintArea
The constraint area minimum among the radios is in the range [-infinity, +infinity] or NaN if unspeci...
Definition: MediumLimitCache.h:46
virtual mps computeMaxSpeed() const
Definition: MediumLimitCache.cc:142
mps maxSpeed
The maximum speed among the radios is in the range [0, +infinity) or NaN if unspecified.
Definition: MediumLimitCache.h:56
virtual W computeMaxTransmissionPower() const
Definition: MediumLimitCache.cc:152
virtual Coord computeMaxConstreaintArea() const
Definition: MediumLimitCache.cc:232
virtual const simtime_t computeMaxTransmissionDuration() const
Definition: MediumLimitCache.cc:215
virtual m computeMaxInterferenceRange() const
Definition: MediumLimitCache.cc:205

Member Data Documentation

double inet::physicallayer::MediumLimitCache::maxAntennaGain
protected

The maximum gain among the radio antennas is in the range [1, +infinity).

Referenced by computeMaxAntennaGain(), computeMaxRange(), initialize(), printToStream(), and updateLimits().

m inet::physicallayer::MediumLimitCache::maxCommunicationRange
protected

The maximum communication range where a transmission can still be potentially successfully received is in the range [0, +infinity) or NaN if unspecified.

Referenced by getMaxCommunicationRange(), initialize(), printToStream(), and updateLimits().

Coord inet::physicallayer::MediumLimitCache::maxConstraintArea
protected

The constraint area maximum among the radios is in the range [-infinity, +infinity] or NaN if unspecified.

Referenced by computeMaxConstreaintArea(), initialize(), printToStream(), and updateLimits().

m inet::physicallayer::MediumLimitCache::maxInterferenceRange
protected

The maximum interference range where a transmission is still considered to some effect on other transmissions is in the range [0, +infinity) or NaN if unspecified.

Referenced by getMaxInterferenceRange(), initialize(), printToStream(), and updateLimits().

mps inet::physicallayer::MediumLimitCache::maxSpeed
protected

The maximum speed among the radios is in the range [0, +infinity) or NaN if unspecified.

Referenced by computeMaxSpeed(), initialize(), printToStream(), and updateLimits().

simtime_t inet::physicallayer::MediumLimitCache::maxTransmissionDuration
protected

The maximum transmission duration of a radio signal.

Referenced by initialize(), printToStream(), and updateLimits().

W inet::physicallayer::MediumLimitCache::maxTransmissionPower
protected

The maximum transmission power among the radio transmitters is in the range [0, +infinity) or NaN if unspecified.

Referenced by computeMaxCommunicationRange(), computeMaxInterferenceRange(), computeMaxTransmissionPower(), initialize(), printToStream(), and updateLimits().

Coord inet::physicallayer::MediumLimitCache::minConstraintArea
protected

The constraint area minimum among the radios is in the range [-infinity, +infinity] or NaN if unspecified.

Referenced by computeMinConstraintArea(), initialize(), printToStream(), and updateLimits().

W inet::physicallayer::MediumLimitCache::minInterferencePower
protected

The minimum interference power among the radio receivers is in the range [0, +infinity) or NaN if unspecified.

Referenced by computeMaxInterferenceRange(), computeMinInterferencePower(), getMaxInterferenceRange(), initialize(), printToStream(), and updateLimits().

simtime_t inet::physicallayer::MediumLimitCache::minInterferenceTime
protected

The minimum overlapping in time needed to consider two transmissions interfering.

Referenced by initialize(), printToStream(), and updateLimits().

W inet::physicallayer::MediumLimitCache::minReceptionPower
protected

The minimum reception power among the radio receivers is in the range [0, +infinity) or NaN if unspecified.

Referenced by computeMaxCommunicationRange(), computeMinReceptionPower(), getMaxCommunicationRange(), initialize(), printToStream(), and updateLimits().

const IRadioMedium* inet::physicallayer::MediumLimitCache::radioMedium
protected

The corresponding radio medium is never nullptr.

Referenced by computeMaxRange(), and initialize().

std::vector<const IRadio *> inet::physicallayer::MediumLimitCache::radios
protected

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