mirror of
https://gitlab.ibr.cs.tu-bs.de/tschuber/ns-3-leo.git
synced 2025-06-08 18:13:57 +02:00
Fix wrong velocity and latitude
This commit is contained in:
parent
4cad8458ab
commit
d145337d6c
3 changed files with 5 additions and 5 deletions
|
@ -21,7 +21,7 @@ LeoCircularOrbitMobilityModel::GetTypeId ()
|
||||||
.SetGroupName ("Leo")
|
.SetGroupName ("Leo")
|
||||||
.AddConstructor<LeoCircularOrbitMobilityModel> ()
|
.AddConstructor<LeoCircularOrbitMobilityModel> ()
|
||||||
.AddAttribute ("Altitude",
|
.AddAttribute ("Altitude",
|
||||||
"A height from the earth's surface in meters",
|
"A height from the earth's surface in kilometers",
|
||||||
DoubleValue (1000.0),
|
DoubleValue (1000.0),
|
||||||
MakeDoubleAccessor (&LeoCircularOrbitMobilityModel::SetAltitude,
|
MakeDoubleAccessor (&LeoCircularOrbitMobilityModel::SetAltitude,
|
||||||
&LeoCircularOrbitMobilityModel::GetAltitude),
|
&LeoCircularOrbitMobilityModel::GetAltitude),
|
||||||
|
@ -76,7 +76,7 @@ DotProduct (const Vector3D &l, const Vector3D &r)
|
||||||
double
|
double
|
||||||
LeoCircularOrbitMobilityModel::GetSpeed () const
|
LeoCircularOrbitMobilityModel::GetSpeed () const
|
||||||
{
|
{
|
||||||
return sqrt (LEO_EARTH_GM / m_orbitHeight);
|
return sqrt (LEO_EARTH_GM_KM_E10 / m_orbitHeight) * 1e5;
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector
|
Vector
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include "ns3/nstime.h"
|
#include "ns3/nstime.h"
|
||||||
|
|
||||||
#define LEO_EARTH_RAD_M 6371009.0
|
#define LEO_EARTH_RAD_M 6371009.0
|
||||||
#define LEO_EARTH_GM 3.98600436e14
|
#define LEO_EARTH_GM_KM_E10 39.8600436
|
||||||
|
|
||||||
namespace ns3 {
|
namespace ns3 {
|
||||||
|
|
||||||
|
|
|
@ -50,11 +50,11 @@ LeoCircularOrbitAllocator::GetNext () const
|
||||||
2 * M_PI * (m_lastSatellite / (double) m_numSatellites),
|
2 * M_PI * (m_lastSatellite / (double) m_numSatellites),
|
||||||
0);
|
0);
|
||||||
|
|
||||||
m_lastSatellite = (m_lastSatellite + 1) % m_numSatellites;
|
if (m_lastSatellite + 1 == m_numSatellites)
|
||||||
if (m_lastSatellite >= m_numSatellites)
|
|
||||||
{
|
{
|
||||||
m_lastOrbit = (m_lastOrbit + 1) % m_numOrbits;
|
m_lastOrbit = (m_lastOrbit + 1) % m_numOrbits;
|
||||||
}
|
}
|
||||||
|
m_lastSatellite = (m_lastSatellite + 1) % m_numSatellites;
|
||||||
|
|
||||||
return next;
|
return next;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue