OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2008 Timo Bingmann | 3 * Copyright (c) 2008 Timo Bingmann |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
15 * along with this program; if not, write to the Free Software | 15 * along with this program; if not, write to the Free Software |
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
17 * | 17 * |
18 * Author: Timo Bingmann <timo.bingmann@student.kit.edu> | 18 * Author: Timo Bingmann <timo.bingmann@student.kit.edu> |
19 */ | 19 */ |
20 #include "ns3/random-variable-stream.h" | 20 #include "ns3/random-variable-stream.h" |
21 #include "ns3/ptr.h" | 21 #include "ns3/ptr.h" |
22 #include "ns3/double.h" | 22 #include "ns3/double.h" |
23 #include "ns3/string.h" | 23 #include "ns3/string.h" |
24 #include "ns3/integer.h" | 24 #include "ns3/integer.h" |
25 #include "ns3/gnuplot.h" | 25 #include "ns3/gnuplot.h" |
| 26 #include "ns3/command-line.h" |
| 27 |
26 #include <map> | 28 #include <map> |
27 #include <cmath> | 29 #include <cmath> |
28 | 30 |
29 /** | 31 /** |
30 * \file | 32 * \file |
31 * \ingroup core-examples | 33 * \ingroup core-examples |
32 * \ingroup randomvariable | 34 * \ingroup randomvariable |
33 * Example program illustrating use of (Deprecated) RandomVariable | 35 * Example program illustrating use of (Deprecated) RandomVariable |
34 */ | 36 */ |
35 | 37 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 } | 97 } |
96 | 98 |
97 return data; | 99 return data; |
98 } | 100 } |
99 | 101 |
100 } // unnamed namespace | 102 } // unnamed namespace |
101 | 103 |
102 | 104 |
103 int main (int argc, char *argv[]) | 105 int main (int argc, char *argv[]) |
104 { | 106 { |
| 107 CommandLine cmd; |
| 108 cmd.Parse(argc, argv); |
| 109 |
105 unsigned int probes = 1000000; | 110 unsigned int probes = 1000000; |
106 double precision = 0.01; | 111 double precision = 0.01; |
107 | 112 |
108 GnuplotCollection gnuplots ("main-random-variables.pdf"); | 113 GnuplotCollection gnuplots ("main-random-variables.pdf"); |
109 gnuplots.SetTerminal ("pdf enhanced"); | 114 gnuplots.SetTerminal ("pdf enhanced"); |
110 | 115 |
111 { | 116 { |
112 Gnuplot plot; | 117 Gnuplot plot; |
113 plot.SetTitle ("UniformRandomVariable"); | 118 plot.SetTitle ("UniformRandomVariable"); |
114 plot.AppendExtra ("set yrange [0:]"); | 119 plot.AppendExtra ("set yrange [0:]"); |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 plot.AddDataset ( Gnuplot2dFunction ("Erlang(x, 2, 5.0)", | 551 plot.AddDataset ( Gnuplot2dFunction ("Erlang(x, 2, 5.0)", |
547 "ErlangDist(x, 2, 5.0)") ); | 552 "ErlangDist(x, 2, 5.0)") ); |
548 | 553 |
549 gnuplots.AddPlot (plot); | 554 gnuplots.AddPlot (plot); |
550 } | 555 } |
551 | 556 |
552 gnuplots.GenerateOutput (std::cout); | 557 gnuplots.GenerateOutput (std::cout); |
553 | 558 |
554 return 0; | 559 return 0; |
555 } | 560 } |
OLD | NEW |