mirror of
https://gitlab.ibr.cs.tu-bs.de/tschuber/ns-3-leo.git
synced 2025-06-08 10:03:58 +02:00
Fix position allocator
This commit is contained in:
parent
166a920fca
commit
95bc153b1b
5 changed files with 66 additions and 16 deletions
|
@ -19,24 +19,44 @@ void CourseChange (std::string context, Ptr<const MobilityModel> position)
|
|||
outfile << Simulator::Now () << ":" << node->GetId () << ":" << pos.x << ":" << pos.y << ":" << pos.z << ":" << position->GetVelocity ().GetLength() << std::endl;
|
||||
}
|
||||
|
||||
|
||||
class Orbit {
|
||||
public:
|
||||
Orbit (double a, double i, double p, double s) : alt (a), inc (i), planes (p), sats (s) {}
|
||||
double alt;
|
||||
double inc;
|
||||
uint16_t planes;
|
||||
uint16_t sats;
|
||||
};
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
for (double incl: { 70.0, 100.0 })
|
||||
std::vector<Orbit> orbits = {
|
||||
Orbit (1.150, 53.0, 32, 50),
|
||||
Orbit (1.110, 53.8, 32, 50),
|
||||
Orbit (1.130, 74.0, 8, 50),
|
||||
Orbit (1.275, 81, 5, 75),
|
||||
Orbit (1.325, 70, 6, 75),
|
||||
};
|
||||
NodeContainer satellites;
|
||||
for (Orbit orb: orbits)
|
||||
{
|
||||
NodeContainer c;
|
||||
c.Create (600);
|
||||
c.Create (orb.sats*orb.planes);
|
||||
|
||||
MobilityHelper mobility;
|
||||
mobility.SetPositionAllocator ("ns3::LeoCircularOrbitPostionAllocator",
|
||||
"NumOrbits", IntegerValue (6),
|
||||
"NumSatellites", IntegerValue (100));
|
||||
"NumOrbits", IntegerValue (orb.planes),
|
||||
"NumSatellites", IntegerValue (orb.sats));
|
||||
mobility.SetMobilityModel ("ns3::LeoCircularOrbitMobilityModel",
|
||||
"Altitude", DoubleValue (1200.0),
|
||||
"Inclination", DoubleValue (incl),
|
||||
"Altitude", DoubleValue (orb.alt),
|
||||
"Inclination", DoubleValue (orb.inc),
|
||||
"Precision", TimeValue (Minutes (1)));
|
||||
mobility.Install (c);
|
||||
satellites.Add (c);
|
||||
}
|
||||
|
||||
|
||||
Config::Connect ("/NodeList/*/$ns3::MobilityModel/CourseChange",
|
||||
MakeCallback (&CourseChange));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue