A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
sample-random-variable.cc
Go to the documentation of this file.
1
/*
2
* This program is free software; you can redistribute it and/or modify
3
* it under the terms of the GNU General Public License version 2 as
4
* published by the Free Software Foundation;
5
*
6
* This program is distributed in the hope that it will be useful,
7
* but WITHOUT ANY WARRANTY; without even the implied warranty of
8
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9
* GNU General Public License for more details.
10
*
11
* You should have received a copy of the GNU General Public License
12
* along with this program; if not, write to the Free Software
13
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
14
*/
15
#include "ns3/command-line.h"
16
#include "ns3/nstime.h"
17
#include "ns3/random-variable-stream.h"
18
#include "ns3/simulator.h"
19
20
#include <iostream>
21
29
using namespace
ns3
;
30
60
int
61
main(
int
argc,
char
* argv[])
62
{
63
CommandLine
cmd
(__FILE__);
64
cmd
.Parse(argc, argv);
65
66
// SeedManager::SetRun (3);
67
68
Ptr<UniformRandomVariable>
uv = CreateObject<UniformRandomVariable>();
69
70
std::cout << uv->
GetValue
() << std::endl;
71
72
return
0;
73
}
ns3::CommandLine
Parse command-line arguments.
Definition:
command-line.h:232
ns3::Ptr< UniformRandomVariable >
ns3::UniformRandomVariable::GetValue
double GetValue(double min, double max)
Get the next random value drawn from the distribution.
Definition:
random-variable-stream.cc:196
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
second.cmd
cmd
Definition:
second.py:40
src
core
examples
sample-random-variable.cc
Generated on Sun Mar 3 2024 17:10:55 for ns-3 by
1.9.1