20 #include <ns3/core-module.h>
22 #include <ns3/spectrum-module.h>
50 virtual void DoRun (
void);
66 if (
Now ().GetSeconds () > m_stop)
75 m_dutyCycle (dutyCycle),
89 Ptr<SpectrumValue> txPsd = MicrowaveOvenSpectrumValueHelper::CreatePowerSpectralDensityMwo1 ();
92 channelHelper.
SetChannel (
"ns3::SingleModelSpectrumChannel");
108 Simulator::Schedule (
Seconds (1.0), &WaveformGenerator::Start, wave);
109 Simulator::Schedule (
Seconds (
m_stop), &WaveformGenerator::Stop, wave);
111 Simulator::Stop (
Seconds (3.0));
116 Simulator::Destroy ();
132 :
TestSuite (
"waveform-generator", SYSTEM)
134 NS_LOG_INFO (
"creating WaveformGeneratorTestSuite");
This class can be used to hold variables of floating point type such as 'double' or 'float'.
holds a vector of ns3::NetDevice pointers
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
This class implements a device which does not communicate, in the sense that it does not interact wit...
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Connect a TraceSource to a Callback without a context.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
void SetChannel(std::string type, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue())
Ptr< SpectrumChannel > Create(void) const
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
AttributeValue implementation for Time.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
#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.
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...