From 83c5bc3b2efa5ec103d633f98e4fd077988523f7 Mon Sep 17 00:00:00 2001 From: Tim Schubert Date: Mon, 27 Jul 2020 13:10:01 +0200 Subject: [PATCH] Use hard cutoff as first step to proper propagation loss --- model/isl-propagation-loss-model.cc | 16 +++++++++++----- model/leo-propagation-loss-model.cc | 7 +++++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/model/isl-propagation-loss-model.cc b/model/isl-propagation-loss-model.cc index f9c6bc0..86b8cb7 100644 --- a/model/isl-propagation-loss-model.cc +++ b/model/isl-propagation-loss-model.cc @@ -23,6 +23,7 @@ */ #include "ns3/log.h" +#include "ns3/mobility-model.h" #include "isl-propagation-loss-model.h" @@ -53,13 +54,18 @@ IslPropagationLossModel::~IslPropagationLossModel () double IslPropagationLossModel::DoCalcRxPower (double txPowerDbm, - Ptr a, - Ptr b) const + Ptr a, + Ptr b) const { - //Vector aPos = a->GetPosition (); - //Vector bPos = b->GetPosition (); - // TODO perform line-earth intersection (ray tracing) + // TODO perform line-earth intersection (ray tracing or based on earth + // curvature + distance) + + // primitivec cut-of at 1000 km + if (a->GetDistanceFrom (b) > 1000000.0) + { + return 0; + } double rxc = 0;//-m_variable->GetValue (); NS_LOG_DEBUG ("attenuation coefficient="<GetDistanceFrom (b) > 1000000.0) + { + return 0; + } double rxc = 0;//-m_variable->GetValue (); //NS_LOG_DEBUG ("attenuation coefficient="<