OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 #include "uan-rc-example.h" | 54 #include "uan-rc-example.h" |
55 #include "ns3/core-module.h" | 55 #include "ns3/core-module.h" |
56 #include "ns3/network-module.h" | 56 #include "ns3/network-module.h" |
57 #include "ns3/applications-module.h" | 57 #include "ns3/applications-module.h" |
58 #include "ns3/mobility-module.h" | 58 #include "ns3/mobility-module.h" |
59 #include "ns3/log.h" | 59 #include "ns3/log.h" |
60 #include "ns3/config.h" | 60 #include "ns3/config.h" |
61 #include "ns3/callback.h" | 61 #include "ns3/callback.h" |
62 #include "ns3/stats-module.h" | 62 #include "ns3/stats-module.h" |
| 63 #ifdef _WIN32 |
| 64 #include "CrashHandler.h" |
| 65 #endif |
63 | 66 |
64 #include <fstream> | 67 #include <fstream> |
65 | 68 |
66 using namespace ns3; | 69 using namespace ns3; |
67 | 70 |
68 NS_LOG_COMPONENT_DEFINE ("UanRcExample"); | 71 NS_LOG_COMPONENT_DEFINE ("UanRcExample"); |
69 | 72 |
70 Experiment::Experiment ()· | 73 Experiment::Experiment ()· |
71 : m_simMin (1), | 74 : m_simMin (1), |
72 m_simMax (1), | 75 m_simMax (1), |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 | 246 |
244 Simulator::Stop (m_simTime + Seconds (0.6)); | 247 Simulator::Stop (m_simTime + Seconds (0.6)); |
245 Simulator::Run (); | 248 Simulator::Run (); |
246 Simulator::Destroy (); | 249 Simulator::Destroy (); |
247 | 250 |
248 return m_bytesTotal; | 251 return m_bytesTotal; |
249 } | 252 } |
250 int | 253 int |
251 main (int argc, char *argv[]) | 254 main (int argc, char *argv[]) |
252 { | 255 { |
| 256 #ifdef _WIN32 |
| 257 #ifndef _DEBUG |
| 258 CCrashHandler ch; |
| 259 ch.SetProcessExceptionHandlers(); |
| 260 ch.SetThreadExceptionHandlers(); |
| 261 #endif |
| 262 #endif |
253 | 263 |
254 Experiment exp; | 264 Experiment exp; |
255 bool quiet = false; | 265 bool quiet = false; |
256 | 266 |
257 CommandLine cmd; | 267 CommandLine cmd; |
258 cmd.AddValue ("TotalRate", "Total channel capacity", exp.m_totalRate); | 268 cmd.AddValue ("TotalRate", "Total channel capacity", exp.m_totalRate); |
259 cmd.AddValue ("NumberRates", "Number of divided rates ( (NumberRates+1)%TotalR
ate should be 0)", exp.m_numRates); | 269 cmd.AddValue ("NumberRates", "Number of divided rates ( (NumberRates+1)%TotalR
ate should be 0)", exp.m_numRates); |
260 cmd.AddValue ("MaxRange", "Maximum range between gateway and acoustic node", e
xp.m_maxRange); | 270 cmd.AddValue ("MaxRange", "Maximum range between gateway and acoustic node", e
xp.m_maxRange); |
261 cmd.AddValue ("SimMin", "Minimum parameter to test (nodes if DoNode=1, \"a\" p
aram otherwise)", exp.m_simMin); | 271 cmd.AddValue ("SimMin", "Minimum parameter to test (nodes if DoNode=1, \"a\" p
aram otherwise)", exp.m_simMin); |
262 cmd.AddValue ("SimMax", "Maximum parameter to test (nodes if DoNode=1, \"a\" p
aram otherwise)", exp.m_simMax); | 272 cmd.AddValue ("SimMax", "Maximum parameter to test (nodes if DoNode=1, \"a\" p
aram otherwise)", exp.m_simMax); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 Gnuplot gp; | 305 Gnuplot gp; |
296 gp.AddDataset (ds); | 306 gp.AddDataset (ds); |
297 std::ofstream of (exp.m_gnuplotfile.c_str ()); | 307 std::ofstream of (exp.m_gnuplotfile.c_str ()); |
298 if (!of.is_open ()) | 308 if (!of.is_open ()) |
299 { | 309 { |
300 NS_FATAL_ERROR ("Can not open GNU Plot outfile: " << exp.m_gnuplotfile); | 310 NS_FATAL_ERROR ("Can not open GNU Plot outfile: " << exp.m_gnuplotfile); |
301 } | 311 } |
302 gp.GenerateOutput (of); | 312 gp.GenerateOutput (of); |
303 | 313 |
304 } | 314 } |
OLD | NEW |