21 #include <ns3/config-store-module.h>
22 #include <ns3/core-module.h>
23 #include <ns3/internet-module.h>
24 #include <ns3/network-module.h>
25 #include <ns3/satellite-module.h>
26 #include <ns3/traffic-module.h>
39 auto tracedPosition = DynamicCast<const SatTracedMobilityModel>(position);
40 NS_ASSERT_MSG(tracedPosition != NULL,
"Course changed for a non-mobile UT");
42 uint32_t beam = tracedPosition->GetBestBeamId();
57 NS_LOG_COMPONENT_DEFINE(
"sat-mobility-beam-tracer");
60 main(
int argc,
char* argv[])
62 std::string inputFileNameWithPath =
63 Singleton<SatEnvVariables>::Get()->LocateDirectory(
"contrib/satellite/examples") +
64 "/generic-input-attributes.xml";
65 std::string mobileUtTraceFile(
"");
67 Ptr<SimulationHelper> simulationHelper =
68 CreateObject<SimulationHelper>(
"sat-mobility-position-generator");
69 simulationHelper->DisableAllCapacityAssignmentCategories();
70 simulationHelper->EnableCrdsa();
74 cmd.AddValue(
"TraceFile",
"Path to the trace file to check beams from", mobileUtTraceFile);
75 simulationHelper->AddDefaultUiArguments(cmd, inputFileNameWithPath);
76 cmd.Parse(argc, argv);
77 simulationHelper->ReadInputAttributesFromFile(inputFileNameWithPath);
79 if (mobileUtTraceFile !=
"")
81 Ptr<SatHelper> satHelper = CreateObject<SatHelper>();
83 satHelper->GetBeamHelper()->GetGeoSatNodes().Get(0)->GetObject<
SatMobilityModel>();
84 Ptr<Node> node = satHelper->LoadMobileUtFromFile(0, mobileUtTraceFile);
89 Ptr<SimulationHelperConf> simulationConf = CreateObject<SimulationHelperConf>();
90 Simulator::Stop(simulationConf->m_simTime);
94 std::cout <<
"Visited beams are:";
97 std::cout <<
" " << beam;
99 std::cout << std::endl;
101 double minSpeed = 0.0, maxSpeed = 0.0, totalSpeed = 0.0;
102 uint32_t valuesCount = 0;
111 minSpeed = std::min(minSpeed, speed);
112 maxSpeed = std::max(maxSpeed, speed);
117 std::cout <<
"Speeding stats (m/s):\n\tmin: " << minSpeed <<
"\n\tmax: " << maxSpeed
118 <<
"\n\tmean: " << totalSpeed / valuesCount << std::endl;
Keep track of the current position and velocity of an object in satellite network.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
std::vector< double > relativeSpeeds
Ptr< SatMobilityModel > satMobility
std::set< uint32_t > visitedBeams
static void SatCourseChange(std::string context, Ptr< const SatMobilityModel > position)