author | Tom Henderson <tomh@tomh.org> |
Thu, 01 Oct 2015 11:07:22 -0700 | |
changeset 11677 | 1e2add816314 |
parent 10968 | 2d29fee2b7b8 |
permissions | -rw-r--r-- |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
2 |
/* |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
3 |
* This program is free software; you can redistribute it and/or modify |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
4 |
* it under the terms of the GNU General Public License version 2 as |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
5 |
* published by the Free Software Foundation; |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
6 |
* |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
7 |
* This program is distributed in the hope that it will be useful, |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
8 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
9 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
10 |
* GNU General Public License for more details. |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
11 |
* |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
12 |
* You should have received a copy of the GNU General Public License |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
13 |
* along with this program; if not, write to the Free Software |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
14 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
15 |
* |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
16 |
* Author: Duy Nguyen <duy@soe.ucsc.edu> |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
17 |
*/ |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
18 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
19 |
/** |
5266 | 20 |
* Scenarios: 100 nodes, multiple simultaneous flows, multi-hop ad hoc, routing, |
21 |
* and mobility |
|
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
22 |
* |
6314
55b81e453f3f
cleaned up and fixed valgrind error in multirate example
Duy Nguyen <duy@soe.ucsc.edu>
parents:
6312
diff
changeset
|
23 |
* QUICK INSTRUCTIONS: |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
24 |
* |
5266 | 25 |
* To optimize build: |
26 |
* ./waf -d optimized configure |
|
27 |
* ./waf |
|
28 |
* |
|
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
29 |
* To compile: |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
30 |
* ./waf --run multirate |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
31 |
* |
6314
55b81e453f3f
cleaned up and fixed valgrind error in multirate example
Duy Nguyen <duy@soe.ucsc.edu>
parents:
6312
diff
changeset
|
32 |
* To compile with command line(useful for varying parameters): |
55b81e453f3f
cleaned up and fixed valgrind error in multirate example
Duy Nguyen <duy@soe.ucsc.edu>
parents:
6312
diff
changeset
|
33 |
* ./waf --run "multirate --totalTime=0.3s --rateManager=ns3::MinstrelWifiManager" |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
34 |
* |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
35 |
* To turn on NS_LOG: |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
36 |
* export NS_LOG=multirate=level_all |
5266 | 37 |
* (can only view log if built with ./waf -d debug configure) |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
38 |
* |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
39 |
* To debug: |
5266 | 40 |
* ./waf --shell |
5884
46614fa27eae
remove reference to scratch/ directory in wireless examples
Tom Henderson <tomh@tomh.org>
parents:
5369
diff
changeset
|
41 |
* gdb ./build/debug/examples/wireless/multirate |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
42 |
* |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
43 |
* To view pcap files: |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
44 |
* tcpdump -nn -tt -r filename.pcap |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
45 |
* |
6311
f8ca463163fd
update multirate example for test.py
Duy Nguyen <duy@soe.ucsc.edu>
parents:
6310
diff
changeset
|
46 |
* To monitor the files: |
5266 | 47 |
* tail -f filename.pcap |
48 |
* |
|
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
49 |
*/ |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
50 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
51 |
#include "ns3/core-module.h" |
6823
a27f86fb4e55
Merge node and common modules into new network module
Tom Henderson <tomh@tomh.org>
parents:
6674
diff
changeset
|
52 |
#include "ns3/network-module.h" |
6847
138f00c56381
Move applications to a single module
Mitch Watrous <watrous@u.washington.edu>
parents:
6823
diff
changeset
|
53 |
#include "ns3/applications-module.h" |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
54 |
#include "ns3/mobility-module.h" |
9840
ffe6c110c1ad
move gnuplot support from src/tools to src/stats
Tom Henderson <tomh@tomh.org>
parents:
9727
diff
changeset
|
55 |
#include "ns3/stats-module.h" |
8996
d0e0a162a990
Replace various instances of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8966
diff
changeset
|
56 |
#include "ns3/random-variable-stream.h" |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
57 |
#include "ns3/wifi-module.h" |
6848
1f453ad50ef3
Converts csma, emu, tap-bridge, point-to-point, wifi and wimax modules into modular format
Lalith Suresh <suresh.lalith@gmail.com>
parents:
6847
diff
changeset
|
58 |
#include "ns3/internet-module.h" |
6632
1f0ce8e8a810
flow-monitor-helper.h is no longer part of the helper module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6314
diff
changeset
|
59 |
#include "ns3/flow-monitor-helper.h" |
6640
8285fbb8b04d
Fix some examples, broken after bridge/olsr reorganization
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6632
diff
changeset
|
60 |
#include "ns3/olsr-helper.h" |
6648
d1785ce489c5
Module layout rework for static-routing, list-routing, global-routing
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6640
diff
changeset
|
61 |
#include "ns3/ipv4-static-routing-helper.h" |
d1785ce489c5
Module layout rework for static-routing, list-routing, global-routing
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6640
diff
changeset
|
62 |
#include "ns3/ipv4-list-routing-helper.h" |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
63 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
64 |
#include <iostream> |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
65 |
#include <fstream> |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
66 |
|
10968
2d29fee2b7b8
[Bug 1551] Redux: NS_LOG_COMPONENT_DEFINE inside or outside of ns3 namespace?
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10668
diff
changeset
|
67 |
using namespace ns3; |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
68 |
|
10968
2d29fee2b7b8
[Bug 1551] Redux: NS_LOG_COMPONENT_DEFINE inside or outside of ns3 namespace?
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10668
diff
changeset
|
69 |
NS_LOG_COMPONENT_DEFINE ("multirate"); |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
70 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
71 |
class Experiment |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
72 |
{ |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
73 |
public: |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
74 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
75 |
Experiment (); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
76 |
Experiment (std::string name); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
77 |
Gnuplot2dDataset Run (const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy, |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
78 |
const NqosWifiMacHelper &wifiMac, const YansWifiChannelHelper &wifiChannel, const MobilityHelper &mobility); |
5266 | 79 |
|
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
80 |
bool CommandSetup (int argc, char **argv); |
6674
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
81 |
bool IsRouting () { return (enableRouting == 1) ? 1 : 0; } |
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
82 |
bool IsMobility () { return (enableMobility == 1) ? 1 : 0; } |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
83 |
|
6674
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
84 |
uint32_t GetScenario () { return scenario; } |
5266 | 85 |
|
86 |
std::string GetRtsThreshold () { return rtsThreshold; } |
|
87 |
std::string GetOutputFileName () { return outputFileName; } |
|
88 |
std::string GetRateManager () { return rateManager; } |
|
6674
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
89 |
|
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
90 |
private: |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
91 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
92 |
Ptr<Socket> SetupPacketReceive (Ptr<Node> node); |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
93 |
NodeContainer GenerateNeighbors (NodeContainer c, uint32_t senderId); |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
94 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
95 |
void ApplicationSetup (Ptr<Node> client, Ptr<Node> server, double start, double stop); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
96 |
void AssignNeighbors (NodeContainer c); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
97 |
void SelectSrcDest (NodeContainer c); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
98 |
void ReceivePacket (Ptr<Socket> socket); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
99 |
void CheckThroughput (); |
5266 | 100 |
void SendMultiDestinations (Ptr<Node> sender, NodeContainer c); |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
101 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
102 |
Gnuplot2dDataset m_output; |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
103 |
|
5266 | 104 |
double totalTime; |
6314
55b81e453f3f
cleaned up and fixed valgrind error in multirate example
Duy Nguyen <duy@soe.ucsc.edu>
parents:
6312
diff
changeset
|
105 |
double expMean; |
9916
725d7c8811b8
Bug 1675 - Throughput computation error in Wireless examples
Junling Bu <linlinjavaer@gmail.com>
parents:
9840
diff
changeset
|
106 |
double samplingPeriod; |
5266 | 107 |
|
108 |
uint32_t bytesTotal; |
|
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
109 |
uint32_t packetSize; |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
110 |
uint32_t gridSize; |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
111 |
uint32_t nodeDistance; |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
112 |
uint32_t port; |
5266 | 113 |
uint32_t scenario; |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
114 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
115 |
bool enablePcap; |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
116 |
bool enableTracing; |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
117 |
bool enableFlowMon; |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
118 |
bool enableRouting; |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
119 |
bool enableMobility; |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
120 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
121 |
NodeContainer containerA, containerB, containerC, containerD; |
5266 | 122 |
std::string rtsThreshold, rateManager, outputFileName; |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
123 |
}; |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
124 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
125 |
Experiment::Experiment () |
6674
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
126 |
{ |
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
127 |
} |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
128 |
|
6674
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
129 |
Experiment::Experiment (std::string name) : |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
130 |
m_output (name), |
6674
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
131 |
totalTime (0.3), |
6314
55b81e453f3f
cleaned up and fixed valgrind error in multirate example
Duy Nguyen <duy@soe.ucsc.edu>
parents:
6312
diff
changeset
|
132 |
expMean (0.1), //flows being exponentially distributed |
9916
725d7c8811b8
Bug 1675 - Throughput computation error in Wireless examples
Junling Bu <linlinjavaer@gmail.com>
parents:
9840
diff
changeset
|
133 |
samplingPeriod(0.1), |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
134 |
bytesTotal (0), |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
135 |
packetSize (2000), |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
136 |
gridSize (10), //10x10 grid for a total of 100 nodes |
5266 | 137 |
nodeDistance (30), |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
138 |
port (5000), |
6674
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
139 |
scenario (4), |
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
140 |
enablePcap (false), |
5266 | 141 |
enableTracing (true), |
6312
903f0ede458b
disable flowmonitor for multirate example
Duy Nguyen <duy@soe.ucsc.edu>
parents:
6311
diff
changeset
|
142 |
enableFlowMon (false), |
5266 | 143 |
enableRouting (false), |
144 |
enableMobility (false), |
|
145 |
rtsThreshold ("2200"), //0 for enabling rts/cts |
|
146 |
rateManager ("ns3::MinstrelWifiManager"), |
|
147 |
outputFileName ("minstrel") |
|
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
148 |
{ |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
149 |
m_output.SetStyle (Gnuplot2dDataset::LINES); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
150 |
} |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
151 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
152 |
Ptr<Socket> |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
153 |
Experiment::SetupPacketReceive (Ptr<Node> node) |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
154 |
{ |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
155 |
TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory"); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
156 |
Ptr<Socket> sink = Socket::CreateSocket (node, tid); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
157 |
InetSocketAddress local = InetSocketAddress (Ipv4Address::GetAny (), port); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
158 |
sink->Bind (local); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
159 |
sink->SetRecvCallback (MakeCallback (&Experiment::ReceivePacket, this)); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
160 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
161 |
return sink; |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
162 |
} |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
163 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
164 |
void |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
165 |
Experiment::ReceivePacket (Ptr<Socket> socket) |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
166 |
{ |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
167 |
Ptr<Packet> packet; |
7733
abd63101a73a
Add parenthesis in while (packet = socket->Recv ()) to make clang++ (LLVM) happy
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7704
diff
changeset
|
168 |
while ((packet = socket->Recv ())) |
6674
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
169 |
{ |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
170 |
bytesTotal += packet->GetSize (); |
6674
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
171 |
} |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
172 |
} |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
173 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
174 |
void |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
175 |
Experiment::CheckThroughput () |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
176 |
{ |
9916
725d7c8811b8
Bug 1675 - Throughput computation error in Wireless examples
Junling Bu <linlinjavaer@gmail.com>
parents:
9840
diff
changeset
|
177 |
double mbs = ((bytesTotal * 8.0) /1000000 /samplingPeriod); |
5266 | 178 |
bytesTotal = 0; |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
179 |
m_output.Add ((Simulator::Now ()).GetSeconds (), mbs); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
180 |
|
9916
725d7c8811b8
Bug 1675 - Throughput computation error in Wireless examples
Junling Bu <linlinjavaer@gmail.com>
parents:
9840
diff
changeset
|
181 |
//check throughput every samplingPeriod second |
725d7c8811b8
Bug 1675 - Throughput computation error in Wireless examples
Junling Bu <linlinjavaer@gmail.com>
parents:
9840
diff
changeset
|
182 |
Simulator::Schedule (Seconds (samplingPeriod), &Experiment::CheckThroughput, this); |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
183 |
} |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
184 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
185 |
/** |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
186 |
* |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
187 |
* Take the grid map, divide it into 4 quadrants |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
188 |
* Assign all nodes from each quadrant to a specific container |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
189 |
* |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
190 |
*/ |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
191 |
void |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
192 |
Experiment::AssignNeighbors (NodeContainer c) |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
193 |
{ |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
194 |
uint32_t totalNodes = c.GetN (); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
195 |
for (uint32_t i=0; i< totalNodes; i++) |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
196 |
{ |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
197 |
if ( (i % gridSize) <= (gridSize/2 - 1)) |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
198 |
{ |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
199 |
//lower left quadrant |
6674
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
200 |
if ( i < totalNodes/2 ) |
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
201 |
{ |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
202 |
containerA.Add (c.Get (i)); |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
203 |
} |
6674
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
204 |
|
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
205 |
//upper left quadrant |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
206 |
if ( i >= (uint32_t)(4*totalNodes)/10 ) |
6674
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
207 |
{ |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
208 |
containerC.Add (c.Get (i)); |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
209 |
} |
6674
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
210 |
} |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
211 |
if ( (i % gridSize) >= (gridSize/2 - 1)) |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
212 |
{ |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
213 |
//lower right quadrant |
6674
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
214 |
if ( i < totalNodes/2 ) |
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
215 |
{ |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
216 |
containerB.Add (c.Get (i)); |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
217 |
} |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
218 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
219 |
//upper right quadrant |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
220 |
if ( i >= (uint32_t)(4*totalNodes)/10 ) |
6674
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
221 |
{ |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
222 |
containerD.Add (c.Get (i)); |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
223 |
} |
6674
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
224 |
} |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
225 |
} |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
226 |
} |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
227 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
228 |
/** |
5266 | 229 |
* Generate 1-hop and 2-hop neighbors of a node in grid topology |
230 |
* |
|
231 |
*/ |
|
232 |
NodeContainer |
|
233 |
Experiment::GenerateNeighbors (NodeContainer c, uint32_t senderId) |
|
234 |
{ |
|
235 |
NodeContainer nc; |
|
6674
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
236 |
uint32_t limit = senderId + 2; |
5266 | 237 |
for (uint32_t i= senderId - 2; i <= limit; i++) |
238 |
{ |
|
239 |
//must ensure the boundaries for other topologies |
|
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
240 |
nc.Add (c.Get (i)); |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
241 |
nc.Add (c.Get (i + 10)); |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
242 |
nc.Add (c.Get (i + 20)); |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
243 |
nc.Add (c.Get (i - 10)); |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
244 |
nc.Add (c.Get (i - 20)); |
5266 | 245 |
} |
246 |
return nc; |
|
247 |
} |
|
248 |
||
249 |
/** |
|
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
250 |
* Sources and destinations are randomly selected such that a node |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
251 |
* may be the source for multiple destinations and a node maybe a destination |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
252 |
* for multiple sources. |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
253 |
*/ |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
254 |
void |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
255 |
Experiment::SelectSrcDest (NodeContainer c) |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
256 |
{ |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
257 |
uint32_t totalNodes = c.GetN (); |
8996
d0e0a162a990
Replace various instances of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8966
diff
changeset
|
258 |
Ptr<UniformRandomVariable> uvSrc = CreateObject<UniformRandomVariable> (); |
d0e0a162a990
Replace various instances of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8966
diff
changeset
|
259 |
uvSrc->SetAttribute ("Min", DoubleValue (0)); |
d0e0a162a990
Replace various instances of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8966
diff
changeset
|
260 |
uvSrc->SetAttribute ("Max", DoubleValue (totalNodes/2 -1)); |
d0e0a162a990
Replace various instances of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8966
diff
changeset
|
261 |
Ptr<UniformRandomVariable> uvDest = CreateObject<UniformRandomVariable> (); |
d0e0a162a990
Replace various instances of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8966
diff
changeset
|
262 |
uvDest->SetAttribute ("Min", DoubleValue (totalNodes/2)); |
d0e0a162a990
Replace various instances of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8966
diff
changeset
|
263 |
uvDest->SetAttribute ("Max", DoubleValue (totalNodes)); |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
264 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
265 |
for (uint32_t i=0; i < totalNodes/3; i++) |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
266 |
{ |
8996
d0e0a162a990
Replace various instances of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8966
diff
changeset
|
267 |
ApplicationSetup (c.Get (uvSrc->GetInteger ()), c.Get (uvDest->GetInteger ()), 0, totalTime); |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
268 |
} |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
269 |
} |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
270 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
271 |
/** |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
272 |
* |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
273 |
* A sender node will set up a flow to each of the its neighbors |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
274 |
* in its quadrant randomly. All the flows are exponentially distributed |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
275 |
* |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
276 |
*/ |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
277 |
void |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
278 |
Experiment::SendMultiDestinations (Ptr<Node> sender, NodeContainer c) |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
279 |
{ |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
280 |
|
8998 | 281 |
// UniformRandomVariable params: (Xrange, Yrange) |
8996
d0e0a162a990
Replace various instances of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8966
diff
changeset
|
282 |
Ptr<UniformRandomVariable> uv = CreateObject<UniformRandomVariable> (); |
d0e0a162a990
Replace various instances of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8966
diff
changeset
|
283 |
uv->SetAttribute ("Min", DoubleValue (0)); |
d0e0a162a990
Replace various instances of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8966
diff
changeset
|
284 |
uv->SetAttribute ("Max", DoubleValue (c.GetN ())); |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
285 |
|
8998 | 286 |
// ExponentialRandomVariable params: (mean, upperbound) |
8996
d0e0a162a990
Replace various instances of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8966
diff
changeset
|
287 |
Ptr<ExponentialRandomVariable> ev = CreateObject<ExponentialRandomVariable> (); |
d0e0a162a990
Replace various instances of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8966
diff
changeset
|
288 |
ev->SetAttribute ("Mean", DoubleValue (expMean)); |
d0e0a162a990
Replace various instances of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8966
diff
changeset
|
289 |
ev->SetAttribute ("Bound", DoubleValue (totalTime)); |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
290 |
|
6311
f8ca463163fd
update multirate example for test.py
Duy Nguyen <duy@soe.ucsc.edu>
parents:
6310
diff
changeset
|
291 |
double start=0.0, stop=totalTime; |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
292 |
uint32_t destIndex; |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
293 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
294 |
for (uint32_t i=0; i < c.GetN (); i++) |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
295 |
{ |
8996
d0e0a162a990
Replace various instances of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8966
diff
changeset
|
296 |
stop = start + ev->GetValue (); |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
297 |
NS_LOG_DEBUG ("Start=" << start << " Stop=" << stop); |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
298 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
299 |
do { |
8996
d0e0a162a990
Replace various instances of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8966
diff
changeset
|
300 |
destIndex = (uint32_t) uv->GetValue (); |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
301 |
} while ( (c.Get (destIndex))->GetId () == sender->GetId ()); |
6674
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
302 |
|
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
303 |
ApplicationSetup (sender, c.Get (destIndex), start, stop); |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
304 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
305 |
start = stop; |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
306 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
307 |
if(start > totalTime) |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
308 |
{ |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
309 |
break; |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
310 |
} |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
311 |
} |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
312 |
} |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
313 |
|
9227
cca3ebe36928
make non-static global debugging-only functions static inline (bug 1170).
Andrey Mazo <mazo@telum.ru>
parents:
9000
diff
changeset
|
314 |
static inline Vector |
7704
aef733235832
Bug 1170: Formulate best practices for dealing with unused debug variables.
Andrey Mazo <mazo@iitp.ru>
parents:
7256
diff
changeset
|
315 |
GetPosition (Ptr<Node> node) |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
316 |
{ |
7704
aef733235832
Bug 1170: Formulate best practices for dealing with unused debug variables.
Andrey Mazo <mazo@iitp.ru>
parents:
7256
diff
changeset
|
317 |
Ptr<MobilityModel> mobility = node->GetObject<MobilityModel> (); |
aef733235832
Bug 1170: Formulate best practices for dealing with unused debug variables.
Andrey Mazo <mazo@iitp.ru>
parents:
7256
diff
changeset
|
318 |
return mobility->GetPosition (); |
aef733235832
Bug 1170: Formulate best practices for dealing with unused debug variables.
Andrey Mazo <mazo@iitp.ru>
parents:
7256
diff
changeset
|
319 |
} |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
320 |
|
9227
cca3ebe36928
make non-static global debugging-only functions static inline (bug 1170).
Andrey Mazo <mazo@telum.ru>
parents:
9000
diff
changeset
|
321 |
static inline std::string |
7704
aef733235832
Bug 1170: Formulate best practices for dealing with unused debug variables.
Andrey Mazo <mazo@iitp.ru>
parents:
7256
diff
changeset
|
322 |
PrintPosition (Ptr<Node> client, Ptr<Node> server) |
aef733235832
Bug 1170: Formulate best practices for dealing with unused debug variables.
Andrey Mazo <mazo@iitp.ru>
parents:
7256
diff
changeset
|
323 |
{ |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
324 |
Vector serverPos = GetPosition (server); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
325 |
Vector clientPos = GetPosition (client); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
326 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
327 |
Ptr<Ipv4> ipv4Server = server->GetObject<Ipv4>(); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
328 |
Ptr<Ipv4> ipv4Client = client->GetObject<Ipv4>(); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
329 |
|
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
330 |
Ipv4InterfaceAddress iaddrServer = ipv4Server->GetAddress (1,0); |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
331 |
Ipv4InterfaceAddress iaddrClient = ipv4Client->GetAddress (1,0); |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
332 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
333 |
Ipv4Address ipv4AddrServer = iaddrServer.GetLocal (); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
334 |
Ipv4Address ipv4AddrClient = iaddrClient.GetLocal (); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
335 |
|
7704
aef733235832
Bug 1170: Formulate best practices for dealing with unused debug variables.
Andrey Mazo <mazo@iitp.ru>
parents:
7256
diff
changeset
|
336 |
std::ostringstream oss; |
aef733235832
Bug 1170: Formulate best practices for dealing with unused debug variables.
Andrey Mazo <mazo@iitp.ru>
parents:
7256
diff
changeset
|
337 |
oss << "Set up Server Device " << (server->GetDevice (0))->GetAddress () |
aef733235832
Bug 1170: Formulate best practices for dealing with unused debug variables.
Andrey Mazo <mazo@iitp.ru>
parents:
7256
diff
changeset
|
338 |
<< " with ip " << ipv4AddrServer |
aef733235832
Bug 1170: Formulate best practices for dealing with unused debug variables.
Andrey Mazo <mazo@iitp.ru>
parents:
7256
diff
changeset
|
339 |
<< " position (" << serverPos.x << "," << serverPos.y << "," << serverPos.z << ")"; |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
340 |
|
7704
aef733235832
Bug 1170: Formulate best practices for dealing with unused debug variables.
Andrey Mazo <mazo@iitp.ru>
parents:
7256
diff
changeset
|
341 |
oss << "Set up Client Device " << (client->GetDevice (0))->GetAddress () |
aef733235832
Bug 1170: Formulate best practices for dealing with unused debug variables.
Andrey Mazo <mazo@iitp.ru>
parents:
7256
diff
changeset
|
342 |
<< " with ip " << ipv4AddrClient |
aef733235832
Bug 1170: Formulate best practices for dealing with unused debug variables.
Andrey Mazo <mazo@iitp.ru>
parents:
7256
diff
changeset
|
343 |
<< " position (" << clientPos.x << "," << clientPos.y << "," << clientPos.z << ")" |
aef733235832
Bug 1170: Formulate best practices for dealing with unused debug variables.
Andrey Mazo <mazo@iitp.ru>
parents:
7256
diff
changeset
|
344 |
<< "\n"; |
aef733235832
Bug 1170: Formulate best practices for dealing with unused debug variables.
Andrey Mazo <mazo@iitp.ru>
parents:
7256
diff
changeset
|
345 |
return oss.str (); |
aef733235832
Bug 1170: Formulate best practices for dealing with unused debug variables.
Andrey Mazo <mazo@iitp.ru>
parents:
7256
diff
changeset
|
346 |
} |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
347 |
|
7704
aef733235832
Bug 1170: Formulate best practices for dealing with unused debug variables.
Andrey Mazo <mazo@iitp.ru>
parents:
7256
diff
changeset
|
348 |
void |
aef733235832
Bug 1170: Formulate best practices for dealing with unused debug variables.
Andrey Mazo <mazo@iitp.ru>
parents:
7256
diff
changeset
|
349 |
Experiment::ApplicationSetup (Ptr<Node> client, Ptr<Node> server, double start, double stop) |
aef733235832
Bug 1170: Formulate best practices for dealing with unused debug variables.
Andrey Mazo <mazo@iitp.ru>
parents:
7256
diff
changeset
|
350 |
{ |
aef733235832
Bug 1170: Formulate best practices for dealing with unused debug variables.
Andrey Mazo <mazo@iitp.ru>
parents:
7256
diff
changeset
|
351 |
Ptr<Ipv4> ipv4Server = server->GetObject<Ipv4> (); |
aef733235832
Bug 1170: Formulate best practices for dealing with unused debug variables.
Andrey Mazo <mazo@iitp.ru>
parents:
7256
diff
changeset
|
352 |
|
aef733235832
Bug 1170: Formulate best practices for dealing with unused debug variables.
Andrey Mazo <mazo@iitp.ru>
parents:
7256
diff
changeset
|
353 |
Ipv4InterfaceAddress iaddrServer = ipv4Server->GetAddress (1,0); |
aef733235832
Bug 1170: Formulate best practices for dealing with unused debug variables.
Andrey Mazo <mazo@iitp.ru>
parents:
7256
diff
changeset
|
354 |
Ipv4Address ipv4AddrServer = iaddrServer.GetLocal (); |
aef733235832
Bug 1170: Formulate best practices for dealing with unused debug variables.
Andrey Mazo <mazo@iitp.ru>
parents:
7256
diff
changeset
|
355 |
|
aef733235832
Bug 1170: Formulate best practices for dealing with unused debug variables.
Andrey Mazo <mazo@iitp.ru>
parents:
7256
diff
changeset
|
356 |
NS_LOG_DEBUG (PrintPosition (client, server)); |
6674
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
357 |
|
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
358 |
// Equipping the source node with OnOff Application used for sending |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
359 |
OnOffHelper onoff ("ns3::UdpSocketFactory", Address (InetSocketAddress (Ipv4Address ("10.0.0.1"), port))); |
9000
3ec20a64fd08
Add a constant rate setting function to the on-off helper
Mitch Watrous
parents:
8998
diff
changeset
|
360 |
onoff.SetConstantRate (DataRate (60000000)); |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
361 |
onoff.SetAttribute ("PacketSize", UintegerValue (packetSize)); |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
362 |
onoff.SetAttribute ("Remote", AddressValue (InetSocketAddress (ipv4AddrServer, port))); |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
363 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
364 |
ApplicationContainer apps = onoff.Install (client); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
365 |
apps.Start (Seconds (start)); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
366 |
apps.Stop (Seconds (stop)); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
367 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
368 |
Ptr<Socket> sink = SetupPacketReceive (server); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
369 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
370 |
} |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
371 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
372 |
Gnuplot2dDataset |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
373 |
Experiment::Run (const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy, |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
374 |
const NqosWifiMacHelper &wifiMac, const YansWifiChannelHelper &wifiChannel, const MobilityHelper &mobility) |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
375 |
{ |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
376 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
377 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
378 |
uint32_t nodeSize = gridSize*gridSize; |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
379 |
NodeContainer c; |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
380 |
c.Create (nodeSize); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
381 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
382 |
YansWifiPhyHelper phy = wifiPhy; |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
383 |
phy.SetChannel (wifiChannel.Create ()); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
384 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
385 |
NqosWifiMacHelper mac = wifiMac; |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
386 |
NetDeviceContainer devices = wifi.Install (phy, mac, c); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
387 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
388 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
389 |
OlsrHelper olsr; |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
390 |
Ipv4StaticRoutingHelper staticRouting; |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
391 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
392 |
Ipv4ListRoutingHelper list; |
6674
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
393 |
|
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
394 |
if (enableRouting) |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
395 |
{ |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
396 |
list.Add (staticRouting, 0); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
397 |
list.Add (olsr, 10); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
398 |
} |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
399 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
400 |
InternetStackHelper internet; |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
401 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
402 |
if (enableRouting) |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
403 |
{ |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
404 |
internet.SetRoutingHelper (list); // has effect on the next Install () |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
405 |
} |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
406 |
internet.Install (c); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
407 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
408 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
409 |
Ipv4AddressHelper address; |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
410 |
address.SetBase ("10.0.0.0", "255.255.255.0"); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
411 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
412 |
Ipv4InterfaceContainer ipInterfaces; |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
413 |
ipInterfaces = address.Assign (devices); |
6674
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
414 |
|
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
415 |
MobilityHelper mobil= mobility; |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
416 |
mobil.SetPositionAllocator ("ns3::GridPositionAllocator", |
6674
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
417 |
"MinX", DoubleValue (0.0), |
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
418 |
"MinY", DoubleValue (0.0), |
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
419 |
"DeltaX", DoubleValue (nodeDistance), |
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
420 |
"DeltaY", DoubleValue (nodeDistance), |
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
421 |
"GridWidth", UintegerValue (gridSize), |
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
422 |
"LayoutType", StringValue ("RowFirst")); |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
423 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
424 |
mobil.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
425 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
426 |
if (enableMobility && enableRouting) |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
427 |
{ |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
428 |
//Rectangle (xMin, xMax, yMin, yMax) |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
429 |
mobil.SetMobilityModel ("ns3::RandomDirection2dMobilityModel", |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
430 |
"Bounds", RectangleValue (Rectangle (0, 500, 0, 500)), |
8996
d0e0a162a990
Replace various instances of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8966
diff
changeset
|
431 |
"Speed", StringValue ("ns3::ConstantRandomVariable[Constant=10]"), |
d0e0a162a990
Replace various instances of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8966
diff
changeset
|
432 |
"Pause", StringValue ("ns3::ConstantRandomVariable[Constant=0.2]")); |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
433 |
} |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
434 |
mobil.Install (c); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
435 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
436 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
437 |
// NS_LOG_INFO ("Enabling global routing on all nodes"); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
438 |
// Ipv4GlobalRoutingHelper::PopulateRoutingTables (); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
439 |
|
5266 | 440 |
if ( scenario == 1 && enableRouting) |
441 |
{ |
|
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
442 |
SelectSrcDest (c); |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
443 |
} |
5266 | 444 |
else if ( scenario == 2) |
445 |
{ |
|
446 |
//All flows begin at the same time |
|
447 |
for (uint32_t i = 0; i < nodeSize - 1; i = i+2) |
|
448 |
{ |
|
6314
55b81e453f3f
cleaned up and fixed valgrind error in multirate example
Duy Nguyen <duy@soe.ucsc.edu>
parents:
6312
diff
changeset
|
449 |
ApplicationSetup (c.Get (i), c.Get (i+1), 0, totalTime); |
5266 | 450 |
} |
451 |
} |
|
452 |
else if ( scenario == 3) |
|
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
453 |
{ |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
454 |
AssignNeighbors (c); |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
455 |
//Note: these senders are hand-picked in order to ensure good coverage |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
456 |
//for 10x10 grid, basically one sender for each quadrant |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
457 |
//you might have to change these values for other grids |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
458 |
NS_LOG_DEBUG (">>>>>>>>>region A<<<<<<<<<"); |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
459 |
SendMultiDestinations (c.Get (22), containerA); |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
460 |
|
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
461 |
NS_LOG_DEBUG (">>>>>>>>>region B<<<<<<<<<"); |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
462 |
SendMultiDestinations (c.Get (26), containerB); |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
463 |
|
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
464 |
NS_LOG_DEBUG (">>>>>>>>>region C<<<<<<<<<"); |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
465 |
SendMultiDestinations (c.Get (72), containerC); |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
466 |
|
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
467 |
NS_LOG_DEBUG (">>>>>>>>>region D<<<<<<<<<"); |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
468 |
SendMultiDestinations (c.Get (76), containerD); |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
469 |
} |
5266 | 470 |
else if ( scenario == 4) |
471 |
{ |
|
472 |
//GenerateNeighbors(NodeContainer, uint32_t sender) |
|
473 |
//Note: these senders are hand-picked in order to ensure good coverage |
|
474 |
//you might have to change these values for other grids |
|
475 |
NodeContainer c1, c2, c3, c4, c5, c6, c7, c8, c9; |
|
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
476 |
|
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
477 |
c1 = GenerateNeighbors (c, 22); |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
478 |
c2 = GenerateNeighbors (c, 24);; |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
479 |
c3 = GenerateNeighbors (c, 26);; |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
480 |
c4 = GenerateNeighbors (c, 42);; |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
481 |
c5 = GenerateNeighbors (c, 44);; |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
482 |
c6 = GenerateNeighbors (c, 46);; |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
483 |
c7 = GenerateNeighbors (c, 62);; |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
484 |
c8 = GenerateNeighbors (c, 64);; |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
485 |
c9 = GenerateNeighbors (c, 66);; |
5266 | 486 |
|
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
487 |
SendMultiDestinations (c.Get (22), c1); |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
488 |
SendMultiDestinations (c.Get (24), c2); |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
489 |
SendMultiDestinations (c.Get (26), c3); |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
490 |
SendMultiDestinations (c.Get (42), c4); |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
491 |
SendMultiDestinations (c.Get (44), c5); |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
492 |
SendMultiDestinations (c.Get (46), c6); |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
493 |
SendMultiDestinations (c.Get (62), c7); |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
494 |
SendMultiDestinations (c.Get (64), c8); |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
495 |
SendMultiDestinations (c.Get (66), c9); |
5266 | 496 |
} |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
497 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
498 |
CheckThroughput (); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
499 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
500 |
if (enablePcap) |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
501 |
{ |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
502 |
phy.EnablePcapAll (GetOutputFileName ()); |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
503 |
} |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
504 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
505 |
if (enableTracing) |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
506 |
{ |
6014 | 507 |
AsciiTraceHelper ascii; |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
508 |
phy.EnableAsciiAll (ascii.CreateFileStream (GetOutputFileName () + ".tr")); |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
509 |
} |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
510 |
|
9727
cb763839fc18
bug 1644: dispose of flow monitor objects from FlowMonitorHelper
Tom Henderson <tomh@tomh.org>
parents:
9227
diff
changeset
|
511 |
FlowMonitorHelper flowmonHelper; |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
512 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
513 |
if (enableFlowMon) |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
514 |
{ |
10668
50137e334cf2
Bug 1842 - FlowMonitor SerializeToXml<Something> should be called by the helper
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9916
diff
changeset
|
515 |
flowmonHelper.InstallAll (); |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
516 |
} |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
517 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
518 |
Simulator::Stop (Seconds (totalTime)); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
519 |
Simulator::Run (); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
520 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
521 |
if (enableFlowMon) |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
522 |
{ |
10668
50137e334cf2
Bug 1842 - FlowMonitor SerializeToXml<Something> should be called by the helper
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9916
diff
changeset
|
523 |
flowmonHelper.SerializeToXmlFile ((GetOutputFileName () + ".flomon"), false, false); |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
524 |
} |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
525 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
526 |
Simulator::Destroy (); |
6674
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
527 |
|
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
528 |
return m_output; |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
529 |
} |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
530 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
531 |
bool |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
532 |
Experiment::CommandSetup (int argc, char **argv) |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
533 |
{ |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
534 |
// for commandline input |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
535 |
CommandLine cmd; |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
536 |
cmd.AddValue ("packetSize", "packet size", packetSize); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
537 |
cmd.AddValue ("totalTime", "simulation time", totalTime); |
9916
725d7c8811b8
Bug 1675 - Throughput computation error in Wireless examples
Junling Bu <linlinjavaer@gmail.com>
parents:
9840
diff
changeset
|
538 |
// according to totalTime, select an appropriate samplingPeriod automatically. |
725d7c8811b8
Bug 1675 - Throughput computation error in Wireless examples
Junling Bu <linlinjavaer@gmail.com>
parents:
9840
diff
changeset
|
539 |
if (totalTime < 1.0) |
725d7c8811b8
Bug 1675 - Throughput computation error in Wireless examples
Junling Bu <linlinjavaer@gmail.com>
parents:
9840
diff
changeset
|
540 |
{ |
725d7c8811b8
Bug 1675 - Throughput computation error in Wireless examples
Junling Bu <linlinjavaer@gmail.com>
parents:
9840
diff
changeset
|
541 |
samplingPeriod = 0.1; |
725d7c8811b8
Bug 1675 - Throughput computation error in Wireless examples
Junling Bu <linlinjavaer@gmail.com>
parents:
9840
diff
changeset
|
542 |
} |
725d7c8811b8
Bug 1675 - Throughput computation error in Wireless examples
Junling Bu <linlinjavaer@gmail.com>
parents:
9840
diff
changeset
|
543 |
else |
725d7c8811b8
Bug 1675 - Throughput computation error in Wireless examples
Junling Bu <linlinjavaer@gmail.com>
parents:
9840
diff
changeset
|
544 |
{ |
725d7c8811b8
Bug 1675 - Throughput computation error in Wireless examples
Junling Bu <linlinjavaer@gmail.com>
parents:
9840
diff
changeset
|
545 |
samplingPeriod = 1.0; |
725d7c8811b8
Bug 1675 - Throughput computation error in Wireless examples
Junling Bu <linlinjavaer@gmail.com>
parents:
9840
diff
changeset
|
546 |
} |
725d7c8811b8
Bug 1675 - Throughput computation error in Wireless examples
Junling Bu <linlinjavaer@gmail.com>
parents:
9840
diff
changeset
|
547 |
// or user selects a samplingPeriod. |
725d7c8811b8
Bug 1675 - Throughput computation error in Wireless examples
Junling Bu <linlinjavaer@gmail.com>
parents:
9840
diff
changeset
|
548 |
cmd.AddValue ("samplingPeriod", "sampling period", samplingPeriod); |
5266 | 549 |
cmd.AddValue ("rtsThreshold", "rts threshold", rtsThreshold); |
550 |
cmd.AddValue ("rateManager", "type of rate", rateManager); |
|
551 |
cmd.AddValue ("outputFileName", "output filename", outputFileName); |
|
552 |
cmd.AddValue ("enableRouting", "enable Routing", enableRouting); |
|
553 |
cmd.AddValue ("enableMobility", "enable Mobility", enableMobility); |
|
554 |
cmd.AddValue ("scenario", "scenario ", scenario); |
|
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
555 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
556 |
cmd.Parse (argc, argv); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
557 |
return true; |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
558 |
} |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
559 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
560 |
int main (int argc, char *argv[]) |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
561 |
{ |
5266 | 562 |
|
563 |
Experiment experiment; |
|
564 |
experiment = Experiment ("multirate"); |
|
565 |
||
6314
55b81e453f3f
cleaned up and fixed valgrind error in multirate example
Duy Nguyen <duy@soe.ucsc.edu>
parents:
6312
diff
changeset
|
566 |
//for commandline input |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
567 |
experiment.CommandSetup (argc, argv); |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
568 |
|
5266 | 569 |
// set value to 0 for enabling fragmentation |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
570 |
Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue ("2200")); |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
571 |
Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue (experiment.GetRtsThreshold ())); |
5266 | 572 |
|
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
573 |
std::ofstream outfile ((experiment.GetOutputFileName ()+ ".plt").c_str ()); |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
574 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
575 |
MobilityHelper mobility; |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
576 |
Gnuplot gnuplot; |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
577 |
Gnuplot2dDataset dataset; |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
578 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
579 |
WifiHelper wifi = WifiHelper::Default (); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
580 |
NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default (); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
581 |
YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default (); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
582 |
YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default (); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
583 |
Ssid ssid = Ssid ("Testbed"); |
6674
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
584 |
|
6673
ec22aa763e2d
Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents:
6648
diff
changeset
|
585 |
wifiMac.SetType ("ns3::AdhocWifiMac", |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
586 |
"Ssid", SsidValue (ssid)); |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
587 |
wifi.SetStandard (WIFI_PHY_STANDARD_holland); |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
588 |
wifi.SetRemoteStationManager (experiment.GetRateManager ()); |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
589 |
|
6310 | 590 |
NS_LOG_INFO ("Scenario: " << experiment.GetScenario ()); |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
591 |
NS_LOG_INFO ("Rts Threshold: " << experiment.GetRtsThreshold ()); |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
592 |
NS_LOG_INFO ("Name: " << experiment.GetOutputFileName ()); |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
593 |
NS_LOG_INFO ("Rate: " << experiment.GetRateManager ()); |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
594 |
NS_LOG_INFO ("Routing: " << experiment.IsRouting ()); |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7231
diff
changeset
|
595 |
NS_LOG_INFO ("Mobility: " << experiment.IsMobility ()); |
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
596 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
597 |
dataset = experiment.Run (wifi, wifiPhy, wifiMac, wifiChannel, mobility); |
5266 | 598 |
|
5256
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
599 |
gnuplot.AddDataset (dataset); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
600 |
gnuplot.GenerateOutput (outfile); |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
601 |
|
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
602 |
return 0; |
7bd503be20c9
Replace multi-rate-first.cc and multi-rate-second.cc with better example multirate.cc
Duy Nguyen <duy@soe.ucsc.edu>
parents:
diff
changeset
|
603 |
} |