21 #include <ns3/object.h>
22 #include <ns3/spectrum-interference.h>
23 #include <ns3/spectrum-error-model.h>
26 #include <ns3/simulator.h>
27 #include <ns3/packet.h>
43 virtual void DoRun (
void);
59 m_rxCorrectKnownOutcome (rxCorrect),
60 m_mySpectrumModel (s->GetSpectrumModel ())
80 (*n)[0] = 5.000000000000e-19;
81 (*n)[1] = 4.545454545455e-19;
83 (*i1)[0] = 5.000000000000e-18;
84 (*i2)[0] = 5.000000000000e-16;
85 (*i3)[0] = 1.581138830084e-16;
86 (*i4)[0] = 7.924465962306e-17;
87 (*i1)[1] = 1.437398936440e-18;
88 (*i2)[1] = 5.722388235428e-16;
89 (*i3)[1] = 7.204059965732e-17;
90 (*i4)[1] = 5.722388235428e-17;
94 si.
SetErrorModel (CreateObject<ShannonSpectrumErrorModel> ());
97 Time ts = Seconds (1);
98 Time ds = Seconds (1);
99 Time ti1 = Seconds (0);
100 Time di1 = Seconds (3);
101 Time ti2 = Seconds (0.7);
102 Time di2 = Seconds (1);
103 Time ti3 = Seconds (1.2);
104 Time di3 = Seconds (1);
105 Time ti4 = Seconds (1.5);
106 Time di4 = Seconds (0.1);
141 :
TestSuite (
"spectrum-interference", UNIT)
144 NS_LOG_INFO (
"creating SpectrumInterferenceTestSuite");
154 bands.push_back (bi);
159 bands.push_back (bi);
161 m = Create<SpectrumModel> (bands);
166 const double e = 1e-5;
171 (*s1)[0] = 1.255943215755e-15;
172 (*s1)[1] = 7.204059965732e-16;
173 b = 10067205.5632012;
183 (*s2)[0] = 2.505936168136e-17;
184 (*s2)[1] = 3.610582885110e-17;
185 b = 882401.591840728;
uint32_t m_rxCorrectKnownOutcome
keep track of time values and allow control of global simulation resolution
smart pointer class similar to boost::intrusive_ptr
static SpectrumInterferenceTestSuite spectrumInterferenceTestSuite
static void Run(void)
Run the simulation until one of:
void SetNoisePowerSpectralDensity(Ptr< const SpectrumValue > noisePsd)
SpectrumInterferenceTestCase(Ptr< SpectrumValue > s, uint32_t txBytes, bool rxCorrect, std::string name)
void AddSignal(Ptr< const SpectrumValue > spd, const Time duration)
notify that a new signal is being perceived in the medium.
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event to expire at the relative time "time" is reached.
void StartRx(Ptr< const Packet > p, Ptr< const SpectrumValue > rxPsd)
notify that the PHY is starting a RX attempt
std::vector< BandInfo > Bands
SpectrumInterferenceTestSuite()
double fc
center frequency
static void Destroy(void)
Every event scheduled by the Simulator::insertAtDestroy method is invoked.
double fl
lower limit of subband
Ptr< const SpectrumModel > m_mySpectrumModel
bool EndRx()
notify that the RX attempt has ended.
This class implements a gaussian interference model, i.e., all incoming signals are added to the tota...
void AddTestCase(TestCase *testCase) NS_DEPRECATED
Add an individual child TestCase case to this TestCase.
NS_LOG_COMPONENT_DEFINE("SpectrumInterferenceTest")
void SetErrorModel(Ptr< SpectrumErrorModel > e)
set the SpectrumErrorModel to be used.
virtual void DoRun(void)
Implementation to actually run this TestCase.
double fh
upper limit of subband
The building block of a SpectrumModel.
void RetrieveTestResult(SpectrumInterference *si)
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
virtual ~SpectrumInterferenceTestCase()