25 #include "ns3/core-module.h" 
   26 #include "ns3/yans-error-rate-model.h" 
   27 #include "ns3/nist-error-rate-model.h" 
   28 #include "ns3/gnuplot.h" 
   36 int main (
int argc, 
char *argv[])
 
   38   uint32_t FrameSize = 2000; 
 
   39   std::ofstream yansfile (
"yans-frame-success-rate-ac.plt");
 
   40   std::ofstream nistfile (
"nist-frame-success-rate-ac.plt");
 
   41   std::vector <std::string> modes;
 
   43   modes.push_back (
"VhtMcs0");
 
   44   modes.push_back (
"VhtMcs1");
 
   45   modes.push_back (
"VhtMcs2");
 
   46   modes.push_back (
"VhtMcs3");
 
   47   modes.push_back (
"VhtMcs4");
 
   48   modes.push_back (
"VhtMcs5");
 
   49   modes.push_back (
"VhtMcs6");
 
   50   modes.push_back (
"VhtMcs7");
 
   51   modes.push_back (
"VhtMcs8");
 
   54   cmd.
AddValue (
"FrameSize", 
"The frame size", FrameSize);
 
   55   cmd.
Parse (argc, argv);
 
   64   for (uint32_t i = 0; i < modes.size (); i++)
 
   66       std::cout << modes[i] << std::endl;
 
   69       txVector.SetMode (modes[i]);
 
   71       for (
double snr = -5.0; snr <= 30.0; snr += 0.1)
 
   79           yansdataset.Add (snr, ps);
 
   80           ps = nist->GetChunkSuccessRate (
WifiMode (modes[i]), txVector, std::pow (10.0,snr / 10.0), FrameSize * 8);
 
   86           nistdataset.Add (snr, ps);
 
   93   yansplot.
SetTerminal (
"postscript eps color enh \"Times-BoldItalic\"");
 
   94   yansplot.
SetLegend (
"SNR(dB)", 
"Frame Success Rate");
 
   95   yansplot.
SetExtra  (
"set xrange [-5:55]\n\ 
   97 set style line 1 linewidth 5\n\ 
   98 set style line 2 linewidth 5\n\ 
   99 set style line 3 linewidth 5\n\ 
  100 set style line 4 linewidth 5\n\ 
  101 set style line 5 linewidth 5\n\ 
  102 set style line 6 linewidth 5\n\ 
  103 set style line 7 linewidth 5\n\ 
  104 set style line 8 linewidth 5\n\ 
  105 set style line 9 linewidth 5\n\ 
  106 set style increment user"                                                                                                                                                                                                                                                                                                                                   );
 
  110   nistplot.
SetTerminal (
"postscript eps color enh \"Times-BoldItalic\"");
 
  111   nistplot.
SetLegend (
"SNR(dB)", 
"Frame Success Rate");
 
  112   nistplot.
SetExtra  (
"set xrange [-5:55]\n\ 
  114 set style line 1 linewidth 5\n\ 
  115 set style line 2 linewidth 5\n\ 
  116 set style line 3 linewidth 5\n\ 
  117 set style line 4 linewidth 5\n\ 
  118 set style line 5 linewidth 5\n\ 
  119 set style line 6 linewidth 5\n\ 
  120 set style line 7 linewidth 5\n\ 
  121 set style line 8 linewidth 5\n\ 
  122 set style line 9 linewidth 5\n\ 
  123 set style increment user"                                                                                                                                                                                                                                                                                                                                   );
 
Smart pointer class similar to boost::intrusive_ptr. 
 
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
 
Class to represent a 2D points plot. 
 
void AddDataset(const GnuplotDataset &dataset)
 
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
 
a simple class to generate gnuplot-ready plotting commands from a set of datasets. 
 
virtual double GetChunkSuccessRate(WifiMode mode, WifiTxVector txVector, double snr, uint32_t nbits) const 
A pure virtual method that must be implemented in the subclass. 
 
void GenerateOutput(std::ostream &os)
Writes gnuplot commands and data values to a single output stream. 
 
Parse command-line arguments. 
 
void SetLegend(const std::string &xLegend, const std::string &yLegend)
 
Every class exported by the ns3 library is enclosed in the ns3 namespace. 
 
void SetExtra(const std::string &extra)
 
void AddValue(const std::string &name, const std::string &help, T &value)
Add a program argument, assigning to POD. 
 
void Parse(int argc, char *argv[])
Parse the program arguments. 
 
void SetTerminal(const std::string &terminal)