mirror of
https://gitlab.ibr.cs.tu-bs.de/tschuber/ns-3-leo.git
synced 2025-06-09 10:31:43 +02:00
Add mobility model for circular orbits
This commit is contained in:
parent
0834c06e31
commit
0a9aa411ef
4 changed files with 326 additions and 0 deletions
35
test/leo-orbit-test-suite.cc
Normal file
35
test/leo-orbit-test-suite.cc
Normal file
|
@ -0,0 +1,35 @@
|
|||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
|
||||
#include "ns3/core-module.h"
|
||||
#include "ns3/node-container.h"
|
||||
#include "ns3/test.h"
|
||||
|
||||
#include "../model/leo-circular-orbit-mobility-model.h"
|
||||
|
||||
using namespace ns3;
|
||||
|
||||
class LeoOrbitSpeedTestCase : public TestCase
|
||||
{
|
||||
public:
|
||||
LeoOrbitSpeedTestCase () : TestCase ("Test speed for 0 altitude") {}
|
||||
virtual ~LeoOrbitSpeedTestCase () {}
|
||||
|
||||
private:
|
||||
virtual void DoRun (void)
|
||||
{
|
||||
Ptr<LeoCircularOrbitMobilityModel> mob = CreateObject<LeoCircularOrbitMobilityModel> ();
|
||||
mob->SetAttribute ("Altitude", DoubleValue (0.0));
|
||||
|
||||
NS_TEST_ASSERT_MSG_EQ ((uint64_t) mob->GetSpeed (), (uint64_t) 7909.79, "Unexpected velocity at earths surface");
|
||||
}
|
||||
};
|
||||
|
||||
class LeoOrbitTestSuite : TestSuite
|
||||
{
|
||||
public:
|
||||
LeoOrbitTestSuite() : TestSuite ("leo-orbit", UNIT) {
|
||||
AddTestCase (new LeoOrbitSpeedTestCase, TestCase::QUICK);
|
||||
}
|
||||
};
|
||||
|
||||
static LeoOrbitTestSuite leoOrbitTestSuite;
|
Loading…
Add table
Add a link
Reference in a new issue