143 Config::SetDefault(
"ns3::SatEnvVariables::SimulationCampaignName",
144 StringValue(
"example-markov-fading-trace"));
145 Config::SetDefault(
"ns3::SatEnvVariables::SimulationTag", StringValue(
""));
146 Config::SetDefault(
"ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(
true));
149 Ptr<SatMarkovConf> markovConf = CreateObject<SatMarkovConf>();
157 Ptr<SatMarkovContainer> markovContainer =
158 CreateObject<SatMarkovContainer>(markovConf, elevationCb, velocityCb);
160 markovContainer->TraceConnect(
"FadingTrace",
161 "The trace for fading values",
167 for (uint32_t i = 0; i < 100000; i++)
169 Simulator::Schedule(MilliSeconds(1 * i),
176 Simulator::Schedule(MilliSeconds(0),
181 Simulator::Schedule(MilliSeconds(20000),
186 Simulator::Schedule(MilliSeconds(40000),
191 Simulator::Schedule(MilliSeconds(60000),
196 Simulator::Schedule(MilliSeconds(80000),
205 Gnuplot plot =
GetGnuplot(
"markov_fading_trace",
"Markov Fading Trace");
206 plot.AddDataset(dataset);
208 std::string plotFileName =
"markov_fading_trace.plt";
209 std::ofstream plotFile(plotFileName.c_str());
210 plot.GenerateOutput(plotFile);
213 std::cout <<
"Output file written: " << plotFileName << std::endl;
215 int result = system(
"gnuplot markov_fading_trace.plt");
220 <<
"Unable to open shell process for Gnuplot file conversion, conversion not done!"
225 std::cout <<
"Output file converted to: markov_fading_trace.png" << std::endl;
228 Simulator::Destroy();