Bugfixes and performance optimizations

This commit is contained in:
Tim Schubert 2020-08-18 01:02:39 +02:00
parent 0f49ceb4aa
commit dd55b495c4
7 changed files with 19 additions and 17 deletions

View file

@ -179,22 +179,23 @@ MockChannel::Deliver (
if (srcMob != 0 && dstMob != 0)
{
// performance optimization
if (srcMob->GetDistanceFrom (dstMob) > 3.0e6)
{
return false;
}
Ptr<PropagationLossModel> pLoss = GetPropagationLoss ();
if (pLoss != 0)
{
// check if signal reaches destination
rxPower = pLoss->CalcRxPower (txPower, srcMob, dstMob);
if (rxPower == 0.0)
if (rxPower == -1000.0)
{
return false;
}
}
delay += GetPropagationDelay (srcMob, dstMob, txTime);
}
else
{
return false;
}
Simulator::ScheduleWithContext (dst->GetNode ()->GetId (),
delay,