23 #ifndef SIMULATION_HELPER_H
24 #define SIMULATION_HELPER_H
31 #include <ns3/command-line.h>
32 #include <ns3/random-variable-stream.h>
33 #include <ns3/satellite-enums.h>
34 #include <ns3/satellite-stats-helper-container.h>
110 void SetBeams(
const std::string& beamList);
129 const std::set<uint32_t>&
GetBeams();
290 double carrierSpacing,
291 bool isRandomAccess =
false);
337 double constantIf = 0.0);
390 const std::string& mobileUtsFolder =
"");
489 "CreateSatScenario not called before calling GetSatelliteHelper");
553 NS_ASSERT_MSG(
m_utUserCount !=
nullptr,
"User count per UT not set");
584 std::map<uint32_t, Ptr<RandomVariableStream>>
m_utCount;
SatLinkDir_t
Link direction used for packet tracing.
PreDefinedScenario_t
Values for pre-defined scenarios to be used by helper when building satellite network topology base.
ErrorModel
Error model enum.
InterferenceModel
Interference model enum.
Ptr< RandomVariableStream > m_utCount
Ptr< RandomVariableStream > m_utUserCount
std::string m_enabledBeams
bool m_activateStatistics
Ptr< RandomVariableStream > m_utMobileUserCount
SimulationHelper::CrTxConf_t m_crTxConf
std::string m_mobileUtsFolder
TypeId GetInstanceTypeId(void) const
Derived from Object.
SimulationHelperConf()
Default constructor.
static TypeId GetTypeId(void)
Derived from Object.
bool m_activateProgressLogging
virtual ~SimulationHelperConf()
Destructor.
A helper to make it easier to create example simulation cases.
uint32_t GetNextUtCount(uint32_t beamId=0) const
Get next UT count from internal random variable stream.
void EnableCrdsa()
Enable CRDSA random access.
Ptr< SatCnoHelper > m_cnoHelper
void ProgressCb()
Callback that prints simulation progress to stdout.
std::string m_simulationName
void SetErrorModel(SatPhyRxCarrierConf::ErrorModel em, double errorRate=0.0)
Set simulation error model.
Ptr< SatTrafficHelper > m_trafficHelper
void SetupOutputPath()
Check if output path has been set.
void SetUserCountPerMobileUt(uint32_t count)
Set user count per mobile UT.
void EnableAcm(SatEnums::SatLinkDir_t dir)
Enable ACM for a simulation direction.
Time & GetSimTime()
Get simulation time.
void DoDispose(void)
Disposing.
void SetSimulationTime(Time time)
Set simulation time.
void ParseScenarioFolder()
parse scenario folder to load all variables that can be
SimulationHelper()
Default constructor, which is not used.
void ConfigureFrequencyBands()
Configure the default setting for the forward and return link frequencies.
std::string m_inputFileUtListPositions
virtual ~SimulationHelper()
Destructor.
void DisableAcm(SatEnums::SatLinkDir_t dir)
Disable ACM for a simulation direction.
void ConfigureAttributesFromFile(std::string filePath, bool overrideManualConfiguration=true)
Configure this instance after reading input attributes from XML file.
std::map< uint32_t, Ptr< RandomVariableStream > > m_utCount
Ptr< SatCnoHelper > GetCnoHelper()
Get the C/N0 helper to customize C/N0 on some nodes.
void DisableProgressLogs()
Disables simulation progress logs.
void SetIdealPhyParameterization()
Set ideal channel/physical layer parameterization.
void DisableFca()
Disable free capacity allocation.
Ptr< SatHelper > m_satHelper
Ptr< SatHelper > CreateSatScenario(SatHelper::PreDefinedScenario_t scenario=SatHelper::NONE, const std::string &mobileUtsFolder="")
Create the satellite scenario.
void CreateDefaultRtnLinkStats()
Create stats collectors if needed and set default statistics settings for both RTN link.
Ptr< SatGroupHelper > m_groupHelper
Ptr< SatListPositionAllocator > m_commonUtPositions
void RunSimulation()
Run the simulation.
void SetSimulationTime(double seconds)
Set simulation time in seconds.
void EnableFca()
Enable free capacity allocation.
std::string StoreAttributesToFile(std::string fileName, bool outputAttributes=false)
Store all used attributes.
void SetCrTxConf(CrTxConf_t crTxConf)
void SetGwUserCount(uint32_t gwUserCount)
Set the number of GW users in the scenario.
void EnableOnlyConstantRate(uint32_t rcIndex, double rateKbps)
Enable only CRA for a given RC index.
EventId m_progressReportEvent
void EnableExternalFadingInputTrace()
Enable external fading input.
void EnableOutputTraces()
Enable all output traces.
void ConfigureLinkBudget()
Configure all link budget related attributes.
void EnableSlottedAloha()
Enable slotted ALOHA random access.
void DisableAllCapacityAssignmentCategories()
Disable all capacity allocation categories: CRA/VBDC/RBDC.
void EnableArq(SatEnums::SatLinkDir_t dir)
Enable ARQ.
void ConfigureFrame(uint32_t superFrameId, double bw, double carrierBw, double rollOff, double carrierSpacing, bool isRandomAccess=false)
Configure a frame for a certain superframe id.
void EnableOnlyRbdc(uint32_t rcIndex)
Enable only RBDC for a given RC index.
void EnableOnlyVbdc(uint32_t rcIndex)
Enable only VBDC for a given RC index.
void SetUtPositionAllocatorForBeam(uint32_t beamId, Ptr< SatListPositionAllocator > posAllocator)
Set a list position allocator for UTs of a specific beam.
void SetUtCountPerBeam(uint32_t count)
Set UT count per beam.
Time m_progressUpdateInterval
bool m_progressLoggingEnabled
Ptr< SatHelper > GetSatelliteHelper()
If lower layer API access is required, use this to access SatHelper.
Ptr< SatTrafficHelper > GetTrafficHelper()
Get the traffic helper to create more complex traffics.
TypeId GetInstanceTypeId(void) const
Derived from Object.
void ReadInputAttributesFromFile(std::string filePath)
Read input attributes from XML file.
void CreateDefaultFwdLinkStats()
Create stats collectors if needed and set default statistics settings for both FWD link.
void DisableRandomAccess()
Disable random access.
void EnablePeriodicalControlSlots(Time periodicity)
Enable periodical control slots.
Ptr< SatStatsHelperContainer > GetStatisticsContainer()
Get the statistics container of this helper.
void EnableRandomAccess()
Enable random access.
void EnableUtListPositionsFromInputFile(std::string inputFile, bool checkBeams=true)
Enable reading UT list positions from input file.
std::set< uint32_t > m_enabledBeams
void SetUserCountPerUt(uint32_t count)
Set user count per UT.
void CreateDefaultStats()
Create stats collectors and set default statistics settings for both FWD and RTN links.
std::string m_simulationTag
std::set< uint32_t > GetBeamSet(void) const
void SetOutputPath(std::string path)
Force a output file path to this simulation instead of default satellite/data/sims/.
uint32_t GetNextUtUserCount() const
Get next UT user count from internal random variable stream.
Ptr< SatGroupHelper > GetGroupHelper()
Get the group helper.
void SetInterferenceModel(SatPhyRxCarrierConf::InterferenceModel ifModel, double constantIf=0.0)
Set simulation interference model.
void LoadScenario(std::string name)
Load a scenario from data submodule.
void SetBeams(const std::string &beamList)
Ptr< RandomVariableStream > m_utMobileUserCount
const std::set< uint32_t > & GetBeams()
Get enabled beams in integer format.
bool HasSinkInstalled(Ptr< Node > node, uint16_t port)
Check if node has a PacketSink installed at certain port.
std::map< uint32_t, Ptr< SatListPositionAllocator > > m_utPositionsByBeam
void EnableProgressLogs()
Enables simulation progress logging.
bool m_inputFileUtPositionsCheckBeams
std::string m_scenarioPath
bool IsBeamEnabled(uint32_t beamId) const
Check if a beam is enabled.
void SetCommonUtPositionAllocator(Ptr< SatListPositionAllocator > posAllocator)
Set common UT position allocator for all beams.
void ConfigureFwdLinkBeamHopping()
Configure the beam hopping functionality for the FWD link.
void AddDefaultUiArguments(CommandLine &cmd)
Add default command line arguments for the simulation.
Ptr< SatStatsHelperContainer > m_statContainer
void SetOutputTag(std::string tag)
Set simulation output tag, which is the basename of the directory where output files are stored.
Ptr< RandomVariableStream > m_utUserCount
bool m_randomAccessConfigured
uint32_t m_numberOfConfiguredFrames
static TypeId GetTypeId(void)
Derived from Object.
std::string m_enabledBeamsStr
void SetDefaultValues()
Set default values shared by all examples using SimulationHelper.
void SetBeamSet(std::set< uint32_t > beamSet)
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.