A Discrete-Event Network Simulator
API
sample-random-variable-stream.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2012 University of Washington
4  *
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
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
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
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */
18 #include "ns3/simulator.h"
19 #include "ns3/nstime.h"
20 #include "ns3/command-line.h"
21 #include "ns3/random-variable-stream.h"
22 #include <iostream>
23 
58 using namespace ns3;
59 
60 int main (int argc, char *argv[])
61 {
63  cmd.Parse (argc, argv);
64 
65  // SeedManager::SetRun (3);
66 
67  Ptr<UniformRandomVariable> uv = CreateObject<UniformRandomVariable> ();
68 
69  std::cout << uv->GetValue () << std::endl;
70 
71 }
tuple cmd
Definition: second.py:35
Parse command-line arguments.
Definition: command-line.h:205
Every class exported by the ns3 library is enclosed in the ns3 namespace.
double GetValue(double min, double max)
Get the next random value, as a double in the specified range .
void Parse(int argc, char *argv[])
Parse the program arguments.