mirror of
https://gitlab.ibr.cs.tu-bs.de/tschuber/ns-3-leo.git
synced 2025-06-08 10:03:58 +02:00
Make AODV work a bit on Telesat network
This commit is contained in:
parent
ee268592ad
commit
f7bd15f1a8
6 changed files with 32 additions and 47 deletions
|
@ -20,12 +20,6 @@ IslPropagationLossModel::GetTypeId (void)
|
|||
.SetParent<PropagationLossModel> ()
|
||||
.SetGroupName ("Leo")
|
||||
.AddConstructor<IslPropagationLossModel> ()
|
||||
.AddAttribute ("MaxDistance",
|
||||
"Cut-off distance for signal propagation",
|
||||
DoubleValue (2000.0),
|
||||
MakeDoubleAccessor (&IslPropagationLossModel::SetCutoffDistance,
|
||||
&IslPropagationLossModel::GetCutoffDistance),
|
||||
MakeDoubleChecker<double> ())
|
||||
;
|
||||
return tid;
|
||||
}
|
||||
|
@ -71,7 +65,7 @@ IslPropagationLossModel::DoCalcRxPower (double txPowerDbm,
|
|||
Ptr<MobilityModel> a,
|
||||
Ptr<MobilityModel> b) const
|
||||
{
|
||||
if (a->GetDistanceFrom (b) > m_cutoffDistance || !GetLos (a, b))
|
||||
if (!GetLos (a, b))
|
||||
{
|
||||
NS_LOG_DEBUG ("DROP;"<<a->GetPosition ()<<";"<<b->GetPosition ());
|
||||
return -1000.0;
|
||||
|
@ -88,15 +82,4 @@ IslPropagationLossModel::DoAssignStreams (int64_t stream)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
IslPropagationLossModel::SetCutoffDistance (double d)
|
||||
{
|
||||
m_cutoffDistance = d * 1000.0;
|
||||
}
|
||||
|
||||
double
|
||||
IslPropagationLossModel::GetCutoffDistance () const
|
||||
{
|
||||
return m_cutoffDistance / 1000.0;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -28,14 +28,6 @@ public:
|
|||
*/
|
||||
static bool GetLos (Ptr<MobilityModel> a, Ptr<MobilityModel> b);
|
||||
private:
|
||||
/**
|
||||
* Cutoff distance for signal
|
||||
*/
|
||||
double m_cutoffDistance;
|
||||
|
||||
void SetCutoffDistance (double d);
|
||||
double GetCutoffDistance () const;
|
||||
|
||||
/**
|
||||
* Returns the Rx Power taking into account only the particular
|
||||
* PropagationLossModel.
|
||||
|
|
|
@ -23,7 +23,7 @@ LeoPropagationLossModel::GetTypeId (void)
|
|||
.AddConstructor<LeoPropagationLossModel> ()
|
||||
.AddAttribute ("MaxDistance",
|
||||
"Cut-off distance for signal propagation",
|
||||
DoubleValue (4000.0),
|
||||
DoubleValue (2000.0),
|
||||
MakeDoubleAccessor (&LeoPropagationLossModel::SetCutoffDistance,
|
||||
&LeoPropagationLossModel::GetCutoffDistance),
|
||||
MakeDoubleChecker<double> ())
|
||||
|
@ -80,7 +80,7 @@ LeoPropagationLossModel::GetAngle (Ptr<MobilityModel> a, Ptr<MobilityModel> b)
|
|||
NS_LOG_DEBUG ("LEO space -> ground");
|
||||
}
|
||||
|
||||
double prod = (pa.x*-pb.x) + (pa.y*-pb.y) + (pa.z*-pb.z);
|
||||
double prod = abs ((pa.x*-pb.x) + (pa.y*-pb.y) + (pa.z*-pb.z));
|
||||
double norm = pa.GetLength () * pb.GetLength ();
|
||||
|
||||
return acos (prod / norm);
|
||||
|
@ -119,7 +119,7 @@ LeoPropagationLossModel::DoCalcRxPower (double txPowerDbm,
|
|||
|
||||
if (distance > m_cutoffDistance)
|
||||
{
|
||||
NS_LOG_DEBUG ("LEO DROP distance: a=" << a->GetPosition () << " b=" << b->GetPosition () << " m_cutOff="<<m_cutoffDistance<<" dist=" << distance);
|
||||
NS_LOG_DEBUG ("LEO DROP distance: a=" << a->GetPosition () << " b=" << b->GetPosition ()<<" dist=" << distance);
|
||||
|
||||
return -1000.0;
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ LeoPropagationLossModel::DoCalcRxPower (double txPowerDbm,
|
|||
double angle = GetAngle (a, b);
|
||||
if (angle > m_elevationAngle)
|
||||
{
|
||||
NS_LOG_DEBUG ("LEO DROP angle: a=" << a->GetPosition () << " b=" << b->GetPosition () << " m_cutOff="<<m_cutoffDistance<<" m_angle="<<m_elevationAngle<<" dist=" << distance << "angle=" << angle);
|
||||
NS_LOG_DEBUG ("LEO DROP angle: a=" << a->GetPosition () << " b=" << b->GetPosition () << " dist=" << distance << "angle=" << angle);
|
||||
return -1000.0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue