i assume that you mean something like this :
void MakeInterferences(NetDeviceContainer waveformGenerator0)
{
//Data
Simulator::Schedule (MicroSeconds(102), &WaveformGenerator::Start, waveformGenerator0.Get (0)->GetObject<NonCommunicatingNetDevice> ()->GetPhy ()->GetObject<WaveformGenerator> ());
Simulator::Schedule (MicroSeconds(102+226), &WaveformGenerator::Stop, waveformGenerator0.Get (0)->GetObject<NonCommunicatingNetDevice> ()->GetPhy ()->GetObject<WaveformGenerator> ());
if(Simulator::Now().GetSeconds()< 10.0)
{
Simulator::Schedule (MicroSeconds(102+226+1000), &MakeInterferences, waveformGenerator0);
}
}
void CreateWaveformGenerator(NodeContainer ofdmNodes, Ptr<SpectrumChannel> channel)
{
WifiSpectrumValue5MhzFactory sf;
double txPower = 0.1; // Watts
WaveformGeneratorHelper waveformGeneratorHelper;
Ptr<SpectrumValue> txPsd = sf.CreateTxPowerSpectralDensity (txPower, 6);
waveformGeneratorHelper.SetTxPowerSpectralDensity (txPsd);
waveformGeneratorHelper.SetChannel (channel);
waveformGeneratorHelper.SetPhyAttribute ("Period", TimeValue (Seconds (1)));
waveformGeneratorHelper.SetPhyAttribute ("DutyCycle", DoubleValue (0.00022637));
NetDeviceContainer waveformGenerator0 = waveformGeneratorHelper.Install (ofdmNodes.Get(0));
MakeInterferences(waveformGenerator0);
}
I'll turn down the number of events a little bit so the simulation work much smoother.
anyway thank so much for help , i appreciate it a lot.
Cheers D.T.