mirror of
https://gitlab.ibr.cs.tu-bs.de/tschuber/ns-3-leo.git
synced 2025-06-08 01:53:58 +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")
|
||||
.AddConstructor<LeoCircularOrbitMobilityModel> ()
|
||||
.AddAttribute ("Altitude",
|
||||
"A height from the earth's surface in meters",
|
||||
"A height from the earth's surface in kilometers",
|
||||
DoubleValue (1000.0),
|
||||
MakeDoubleAccessor (&LeoCircularOrbitMobilityModel::SetAltitude,
|
||||
&LeoCircularOrbitMobilityModel::GetAltitude),
|
||||
|
@ -76,7 +76,7 @@ DotProduct (const Vector3D &l, const Vector3D &r)
|
|||
double
|
||||
LeoCircularOrbitMobilityModel::GetSpeed () const
|
||||
{
|
||||
return sqrt (LEO_EARTH_GM / m_orbitHeight);
|
||||
return sqrt (LEO_EARTH_GM_KM_E10 / m_orbitHeight) * 1e5;
|
||||
}
|
||||
|
||||
Vector
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include "ns3/nstime.h"
|
||||
|
||||
#define LEO_EARTH_RAD_M 6371009.0
|
||||
#define LEO_EARTH_GM 3.98600436e14
|
||||
#define LEO_EARTH_GM_KM_E10 39.8600436
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
|
|
|
@ -50,11 +50,11 @@ LeoCircularOrbitAllocator::GetNext () const
|
|||
2 * M_PI * (m_lastSatellite / (double) m_numSatellites),
|
||||
0);
|
||||
|
||||
m_lastSatellite = (m_lastSatellite + 1) % m_numSatellites;
|
||||
if (m_lastSatellite >= m_numSatellites)
|
||||
if (m_lastSatellite + 1 == m_numSatellites)
|
||||
{
|
||||
m_lastOrbit = (m_lastOrbit + 1) % m_numOrbits;
|
||||
}
|
||||
m_lastSatellite = (m_lastSatellite + 1) % m_numSatellites;
|
||||
|
||||
return next;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue