Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2009 University of Washington | 3 * Copyright (c) 2009 University of Washington |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as· | 6 * it under the terms of the GNU General Public License version 2 as· |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
259 | 259 |
260 Simulator::Destroy (); | 260 Simulator::Destroy (); |
261 return m_data; | 261 return m_data; |
262 } | 262 } |
263 } | 263 } |
264 | 264 |
265 int | 265 int |
266 main (int argc, char **argv) | 266 main (int argc, char **argv) |
267 { | 267 { |
268 | 268 |
269 #if 0 | |
270 LogComponentEnable ("UanCwExample", LOG_LEVEL_ALL); | |
Fedwar
2018/01/03 14:10:07
why is this commented out?
thanks
ammo6818-vandals.uidaho.edu
2018/01/04 01:52:21
to support testing, I have set all test and exampl
| |
271 #endif | |
272 | |
273 Experiment exp; | 269 Experiment exp; |
270 bool quiet = false; | |
274 | 271 |
275 std::string gnudatfile ("cwexpgnuout.dat"); | 272 std::string gnudatfile ("cwexpgnuout.dat"); |
276 std::string perModel = "ns3::UanPhyPerGenDefault"; | 273 std::string perModel = "ns3::UanPhyPerGenDefault"; |
277 std::string sinrModel = "ns3::UanPhyCalcSinrDefault"; | 274 std::string sinrModel = "ns3::UanPhyCalcSinrDefault"; |
278 | 275 |
279 CommandLine cmd; | 276 CommandLine cmd; |
280 cmd.AddValue ("NumNodes", "Number of transmitting nodes", exp.m_numNodes); | 277 cmd.AddValue ("NumNodes", "Number of transmitting nodes", exp.m_numNodes); |
281 cmd.AddValue ("Depth", "Depth of transmitting and sink nodes", exp.m_depth); | 278 cmd.AddValue ("Depth", "Depth of transmitting and sink nodes", exp.m_depth); |
282 cmd.AddValue ("RegionSize", "Size of boundary in meters", exp.m_boundary); | 279 cmd.AddValue ("RegionSize", "Size of boundary in meters", exp.m_boundary); |
283 cmd.AddValue ("PacketSize", "Generated packet size in bytes", exp.m_packetSize ); | 280 cmd.AddValue ("PacketSize", "Generated packet size in bytes", exp.m_packetSize ); |
284 cmd.AddValue ("DataRate", "DataRate in bps", exp.m_dataRate); | 281 cmd.AddValue ("DataRate", "DataRate in bps", exp.m_dataRate); |
285 cmd.AddValue ("CwMin", "Min CW to simulate", exp.m_cwMin); | 282 cmd.AddValue ("CwMin", "Min CW to simulate", exp.m_cwMin); |
286 cmd.AddValue ("CwMax", "Max CW to simulate", exp.m_cwMax); | 283 cmd.AddValue ("CwMax", "Max CW to simulate", exp.m_cwMax); |
287 cmd.AddValue ("SlotTime", "Slot time duration", exp.m_slotTime); | 284 cmd.AddValue ("SlotTime", "Slot time duration", exp.m_slotTime); |
288 cmd.AddValue ("Averages", "Number of topologies to test for each cw point", ex p.m_avgs); | 285 cmd.AddValue ("Averages", "Number of topologies to test for each cw point", ex p.m_avgs); |
289 cmd.AddValue ("GnuFile", "Name for GNU Plot output", exp.m_gnudatfile); | 286 cmd.AddValue ("GnuFile", "Name for GNU Plot output", exp.m_gnudatfile); |
290 cmd.AddValue ("PerModel", "PER model name", perModel); | 287 cmd.AddValue ("PerModel", "PER model name", perModel); |
291 cmd.AddValue ("SinrModel", "SINR model name", sinrModel); | 288 cmd.AddValue ("SinrModel", "SINR model name", sinrModel); |
289 cmd.AddValue ("Quiet", "Run in quiet mode (disable logging)", quiet); | |
292 cmd.Parse (argc, argv); | 290 cmd.Parse (argc, argv); |
291 | |
292 if (!quiet) | |
293 { | |
294 LogComponentEnable("UanCwExample", LOG_LEVEL_ALL); | |
295 } | |
293 | 296 |
294 ObjectFactory obf; | 297 ObjectFactory obf; |
295 obf.SetTypeId (perModel); | 298 obf.SetTypeId (perModel); |
296 Ptr<UanPhyPer> per = obf.Create<UanPhyPer> (); | 299 Ptr<UanPhyPer> per = obf.Create<UanPhyPer> (); |
297 obf.SetTypeId (sinrModel); | 300 obf.SetTypeId (sinrModel); |
298 Ptr<UanPhyCalcSinr> sinr = obf.Create<UanPhyCalcSinr> (); | 301 Ptr<UanPhyCalcSinr> sinr = obf.Create<UanPhyCalcSinr> (); |
299 | 302 |
300 UanHelper uan; | 303 UanHelper uan; |
301 UanTxMode mode; | 304 UanTxMode mode; |
302 mode = UanTxModeFactory::CreateMode (UanTxMode::FSK, exp.m_dataRate, | 305 mode = UanTxModeFactory::CreateMode (UanTxMode::FSK, exp.m_dataRate, |
(...skipping 19 matching lines...) Expand all Loading... | |
322 { | 325 { |
323 NS_FATAL_ERROR ("Can not open GNU Plot outfile: " << exp.m_gnudatfile); | 326 NS_FATAL_ERROR ("Can not open GNU Plot outfile: " << exp.m_gnudatfile); |
324 } | 327 } |
325 gp.GenerateOutput (of); | 328 gp.GenerateOutput (of); |
326 | 329 |
327 per = 0; | 330 per = 0; |
328 sinr = 0; | 331 sinr = 0; |
329 | 332 |
330 } | 333 } |
331 | 334 |
LEFT | RIGHT |