From 339dcce59da34c837eaf97819cc827e1f3f25443 Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Fri, 12 Jan 2024 15:26:25 -0800 Subject: [PATCH] spectrum: (fixes #356) Remove assert when positions overlap --- ...hree-gpp-spectrum-propagation-loss-model.cc | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/spectrum/model/three-gpp-spectrum-propagation-loss-model.cc b/src/spectrum/model/three-gpp-spectrum-propagation-loss-model.cc index 021543b78..2ecfc84eb 100644 --- a/src/spectrum/model/three-gpp-spectrum-propagation-loss-model.cc +++ b/src/spectrum/model/three-gpp-spectrum-propagation-loss-model.cc @@ -489,19 +489,17 @@ ThreeGppSpectrumPropagationLossModel::DoCalcRxPowerSpectralDensity( Ptr aPhasedArrayModel, Ptr bPhasedArrayModel) const { - NS_LOG_FUNCTION(this); + NS_LOG_FUNCTION(this << spectrumSignalParams << a << b << aPhasedArrayModel + << bPhasedArrayModel); + + if (a->GetPosition() == b->GetPosition()) + { + return spectrumSignalParams->Copy(); + } uint32_t aId = a->GetObject()->GetId(); // id of the node a uint32_t bId = b->GetObject()->GetId(); // id of the node b - - NS_ASSERT(aId != bId); - NS_ASSERT_MSG(a->GetDistanceFrom(b) > 0.0, - "The position of a and b devices cannot be the same"); - - // retrieve the antenna of device a NS_ASSERT_MSG(aPhasedArrayModel, "Antenna not found for node " << aId); - NS_LOG_DEBUG("a node " << a->GetObject() << " antenna " << aPhasedArrayModel); - - // retrieve the antenna of the device b + NS_LOG_DEBUG("a node " << aId << " antenna " << aPhasedArrayModel); NS_ASSERT_MSG(bPhasedArrayModel, "Antenna not found for node " << bId); NS_LOG_DEBUG("b node " << bId << " antenna " << bPhasedArrayModel);