20 #include "ns3/core-module.h" 
   21 #include "ns3/yans-error-rate-model.h" 
   22 #include "ns3/nist-error-rate-model.h" 
   23 #include "ns3/gnuplot.h" 
   31 int main (
int argc, 
char *argv[])
 
   33   uint32_t FrameSize = 2000;
 
   34   std::ofstream yansfile (
"yans-frame-success-rate.plt");
 
   35   std::ofstream nistfile (
"nist-frame-success-rate.plt");
 
   36   std::vector <std::string> modes;
 
   38   modes.push_back (
"OfdmRate6Mbps");
 
   39   modes.push_back (
"OfdmRate9Mbps");
 
   40   modes.push_back (
"OfdmRate12Mbps");
 
   41   modes.push_back (
"OfdmRate18Mbps");
 
   42   modes.push_back (
"OfdmRate24Mbps");
 
   43   modes.push_back (
"OfdmRate36Mbps");
 
   44   modes.push_back (
"OfdmRate48Mbps");
 
   45   modes.push_back (
"OfdmRate54Mbps");
 
   48   cmd.
AddValue (
"FrameSize", 
"The frame size", FrameSize);
 
   49   cmd.
Parse (argc, argv);
 
   57   for (uint32_t i = 0; i < modes.size (); i++)
 
   59       std::cout << modes[i] << std::endl;
 
   63       for (
double snr = -5.0; snr <= 30.0; snr += 0.1)
 
   66           yansdataset.
Add (snr, ps);
 
   67           ps = nist->GetChunkSuccessRate (
WifiMode (modes[i]), std::pow (10.0,snr/10.0), FrameSize*8);
 
   68           nistdataset.
Add (snr, ps);
 
   75   yansplot.
SetTerminal (
"postscript eps color enh \"Times-BoldItalic\"");
 
   76   yansplot.
SetLegend (
"SNR(dB)", 
"Frame Success Rate");
 
   77   yansplot.
SetExtra  (
"set xrange [-5:30]\n\ 
   79 set style line 1 linewidth 5\n\ 
   80 set style line 2 linewidth 5\n\ 
   81 set style line 3 linewidth 5\n\ 
   82 set style line 4 linewidth 5\n\ 
   83 set style line 5 linewidth 5\n\ 
   84 set style line 6 linewidth 5\n\ 
   85 set style line 7 linewidth 5\n\ 
   86 set style line 8 linewidth 5\n\ 
   87 set style increment user"                                                                                                                                                                                                                                                                                                                                   );
 
   91   nistplot.
SetTerminal (
"postscript eps color enh \"Times-BoldItalic\"");
 
   92   nistplot.
SetLegend (
"SNR(dB)", 
"Frame Success Rate");
 
   93   nistplot.
SetExtra  (
"set xrange [-5:30]\n\ 
   95 set style line 1 linewidth 5\n\ 
   96 set style line 2 linewidth 5\n\ 
   97 set style line 3 linewidth 5\n\ 
   98 set style line 4 linewidth 5\n\ 
   99 set style line 5 linewidth 5\n\ 
  100 set style line 6 linewidth 5\n\ 
  101 set style line 7 linewidth 5\n\ 
  102 set style line 8 linewidth 5\n\ 
  103 set style increment user"                                                                                                                                                                                                                                                                                                                                   );
 
smart pointer class similar to boost::intrusive_ptr 
 
Class to represent a 2D points plot. Set the line or points style using SetStyle() and set points usi...
 
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. 
 
void GenerateOutput(std::ostream &os)
Writes gnuplot commands and data values to a single output stream. 
 
void Add(double x, double y)
 
virtual double GetChunkSuccessRate(WifiMode mode, double snr, uint32_t nbits) const 
 
Parse command-line arguments. 
 
void SetLegend(const std::string &xLegend, const std::string &yLegend)
 
void SetExtra(const std::string &extra)
 
int main(int argc, char *argv[])
 
void AddValue(const std::string &name, const std::string &help, T &value)
 
void Parse(int argc, char *argv[])
 
void SetTerminal(const std::string &terminal)