This commit is contained in:
Tim Schubert 2020-08-27 21:30:28 +02:00
parent 998b7fe2f2
commit d9a0dd6a71
4 changed files with 12 additions and 106 deletions

View file

@ -92,7 +92,7 @@ int main (int argc, char *argv[])
cmd.AddValue("islEnable", "Enable inter-satellite links", islEnable); cmd.AddValue("islEnable", "Enable inter-satellite links", islEnable);
cmd.AddValue("traceDrops", "Enable tracing of PHY and MAC drops", traceDrops); cmd.AddValue("traceDrops", "Enable tracing of PHY and MAC drops", traceDrops);
cmd.AddValue("latGws", "Latitudal rows of gateways", latGws); cmd.AddValue("latGws", "Latitudal rows of gateways", latGws);
cmd.AddValue("latGws", "Longitudinal rows of gateways", lonGws); cmd.AddValue("lonGws", "Longitudinal rows of gateways", lonGws);
cmd.Parse (argc, argv); cmd.Parse (argc, argv);
std::streambuf *coutbuf = std::cout.rdbuf(); std::streambuf *coutbuf = std::cout.rdbuf();
@ -128,8 +128,9 @@ int main (int argc, char *argv[])
// Install internet stack on nodes // Install internet stack on nodes
AodvHelper aodv; AodvHelper aodv;
aodv.Set ("EnableHello", BooleanValue (false)); aodv.Set ("EnableHello", BooleanValue (false));
aodv.Set ("RreqRateLimit", UintegerValue (1)); aodv.Set ("NetDiameter", UintegerValue (1000));
aodv.Set ("RerrRateLimit", UintegerValue (1)); aodv.Set ("RreqRateLimit", UintegerValue (10));
aodv.Set ("RerrRateLimit", UintegerValue (10));
stack.SetRoutingHelper (aodv); stack.SetRoutingHelper (aodv);
} }
@ -143,6 +144,7 @@ int main (int argc, char *argv[])
if (islEnable) if (islEnable)
{ {
std::cerr << "ISL enabled" << std::endl;
IslHelper islCh; IslHelper islCh;
NetDeviceContainer islNet = islCh.Install (satellites); NetDeviceContainer islNet = islCh.Install (satellites);
ipv4.SetBase ("10.2.0.0", "255.255.0.0"); ipv4.SetBase ("10.2.0.0", "255.255.0.0");

View file

@ -15,7 +15,7 @@ NS_OBJECT_ENSURE_REGISTERED (LeoPolarPositionAllocator);
NS_LOG_COMPONENT_DEFINE ("LeoPolarPositionAllocator"); NS_LOG_COMPONENT_DEFINE ("LeoPolarPositionAllocator");
LeoPolarPositionAllocator::LeoPolarPositionAllocator () LeoPolarPositionAllocator::LeoPolarPositionAllocator ()
: m_latStart (0), m_lonStart (0), m_latStop (0), m_lonStop (0), m_latNum (1), m_lonNum (1), m_lat (0), m_lon (0) : m_latNum (1), m_lonNum (1), m_lat (0), m_lon (0)
{} {}
LeoPolarPositionAllocator::~LeoPolarPositionAllocator () LeoPolarPositionAllocator::~LeoPolarPositionAllocator ()
@ -28,35 +28,11 @@ LeoPolarPositionAllocator::GetTypeId (void)
.SetParent<PositionAllocator> () .SetParent<PositionAllocator> ()
.SetGroupName ("Leo") .SetGroupName ("Leo")
.AddConstructor<LeoPolarPositionAllocator> () .AddConstructor<LeoPolarPositionAllocator> ()
.AddAttribute ("LatStart",
"Start at this latitude",
DoubleValue (-90),
MakeDoubleAccessor (&LeoPolarPositionAllocator::SetLatStart,
&LeoPolarPositionAllocator::GetLatStart),
MakeDoubleChecker<double> ())
.AddAttribute ("LatStop",
"Stop at this longitude",
DoubleValue (90),
MakeDoubleAccessor (&LeoPolarPositionAllocator::SetLatStop,
&LeoPolarPositionAllocator::GetLatStop),
MakeDoubleChecker<double> ())
.AddAttribute ("LatNum", .AddAttribute ("LatNum",
"The number nodes along one latitude", "The number nodes along one latitude",
UintegerValue (10), UintegerValue (10),
MakeUintegerAccessor (&LeoPolarPositionAllocator::m_latNum), MakeUintegerAccessor (&LeoPolarPositionAllocator::m_latNum),
MakeUintegerChecker<uint32_t> ()) MakeUintegerChecker<uint32_t> ())
.AddAttribute ("LongStart",
"Start at this longitude",
DoubleValue (-180),
MakeDoubleAccessor (&LeoPolarPositionAllocator::SetLonStart,
&LeoPolarPositionAllocator::GetLonStart),
MakeDoubleChecker<double> ())
.AddAttribute ("LongStop",
"Stop at this longitude",
DoubleValue (180),
MakeDoubleAccessor (&LeoPolarPositionAllocator::SetLonStop,
&LeoPolarPositionAllocator::GetLonStop),
MakeDoubleChecker<double> ())
.AddAttribute ("LonNum", .AddAttribute ("LonNum",
"The number nodes along one longitude", "The number nodes along one longitude",
UintegerValue (10), UintegerValue (10),
@ -79,11 +55,11 @@ LeoPolarPositionAllocator::GetNext () const
{ {
NS_LOG_FUNCTION (this); NS_LOG_FUNCTION (this);
double lat = m_lat * (M_PI / m_latNum) - (M_PI / 2); double lat = m_lat * (M_PI / m_latNum);
double lon = m_lon * (2 * M_PI / m_lonNum) - M_PI; double lon = m_lon * (2 * M_PI / m_lonNum);
Vector3D next = Vector3D (LEO_GND_RAD_EARTH * cos (lat) * cos (lon), Vector3D next = Vector3D (LEO_GND_RAD_EARTH * sin (lat) * cos (lon),
LEO_GND_RAD_EARTH * cos (lat) * sin (lon), LEO_GND_RAD_EARTH * sin (lat) * sin (lon),
LEO_GND_RAD_EARTH * sin (lat)); LEO_GND_RAD_EARTH * cos (lat));
m_lat ++; m_lat ++;
if (m_lat > m_latNum) if (m_lat > m_latNum)
@ -97,60 +73,4 @@ LeoPolarPositionAllocator::GetNext () const
return next; return next;
} }
double
LeoPolarPositionAllocator::GetLatStart () const
{
NS_LOG_FUNCTION (this);
return m_latStart * (180.0 / M_PI);
}
double
LeoPolarPositionAllocator::GetLonStart () const
{
NS_LOG_FUNCTION (this);
return m_lonStart * (180.0 / M_PI);
}
double
LeoPolarPositionAllocator::GetLatStop () const
{
NS_LOG_FUNCTION (this);
return m_latStop * (180.0 / M_PI);
}
double
LeoPolarPositionAllocator::GetLonStop () const
{
NS_LOG_FUNCTION (this);
return m_lonStop * (180.0 / M_PI);
}
void
LeoPolarPositionAllocator::SetLatStart (double lat)
{
NS_LOG_FUNCTION (this << lat);
m_latStart = (lat / 180.0) * M_PI;
}
void
LeoPolarPositionAllocator::SetLonStart (double lon)
{
NS_LOG_FUNCTION (this << lon);
m_lonStart = (lon / 180.0) * M_PI;
}
void
LeoPolarPositionAllocator::SetLatStop (double lat)
{
NS_LOG_FUNCTION (this << lat);
m_latStop = (lat / 180.0) * M_PI;
}
void
LeoPolarPositionAllocator::SetLonStop (double lon)
{
NS_LOG_FUNCTION (this << lon);
m_lonStop = (lon / 180.0) * M_PI;
}
}; };

View file

@ -27,28 +27,12 @@ public:
virtual Vector GetNext (void) const; virtual Vector GetNext (void) const;
virtual int64_t AssignStreams (int64_t stream); virtual int64_t AssignStreams (int64_t stream);
double GetLatStart () const;
double GetLonStart () const;
double GetLatStop () const;
double GetLonStop () const;
private: private:
double m_latStart;
double m_lonStart;
double m_latStop;
double m_lonStop;
uint32_t m_latNum; uint32_t m_latNum;
uint32_t m_lonNum; uint32_t m_lonNum;
mutable uint32_t m_lat; mutable uint32_t m_lat;
mutable uint32_t m_lon; mutable uint32_t m_lon;
void SetLatStart (double lat);
void SetLonStart (double lon);
void SetLatStop (double lat);
void SetLonStop (double lon);
}; };
}; };

View file

@ -23,7 +23,7 @@ LeoPropagationLossModel::GetTypeId (void)
.AddConstructor<LeoPropagationLossModel> () .AddConstructor<LeoPropagationLossModel> ()
.AddAttribute ("MaxDistance", .AddAttribute ("MaxDistance",
"Cut-off distance for signal propagation", "Cut-off distance for signal propagation",
DoubleValue (3000.0), DoubleValue (2500.0),
MakeDoubleAccessor (&LeoPropagationLossModel::SetCutoffDistance, MakeDoubleAccessor (&LeoPropagationLossModel::SetCutoffDistance,
&LeoPropagationLossModel::GetCutoffDistance), &LeoPropagationLossModel::GetCutoffDistance),
MakeDoubleChecker<double> ()) MakeDoubleChecker<double> ())