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) 2011 Yufei Cheng | 3 * Copyright (c) 2011 Yufei Cheng |
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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 #endif | 75 #endif |
76 | 76 |
77 SeedManager::SetSeed (99); | 77 SeedManager::SetSeed (99); |
78 SeedManager::SetRun (1); | 78 SeedManager::SetRun (1); |
79 | 79 |
80 double totalTime = 1000.0; | 80 double totalTime = 1000.0; |
81 double dataTime = 900.0; | 81 double dataTime = 900.0; |
82 double dataStart = 50.0; | 82 double dataStart = 50.0; |
83 uint32_t nWifis = 50; | 83 uint32_t nWifis = 50; |
84 uint32_t nSinks = 10; | 84 uint32_t nSinks = 10; |
85 double txp = 15.2045; | 85 double txp = 10.7675; |
86 double pauseTime = 0.0; | 86 double pauseTime = 0.0; |
87 double nodeSpeed = 10.0; | 87 double nodeSpeed = 10.0; |
88 double gridSize = 1000.0; | 88 double gridSize = 1000.0; |
89 uint32_t packetSize = 64; | 89 uint32_t packetSize = 64; |
90 std::string phyModeControl ("DsssRate11Mbps"); | 90 std::string phyModeControl ("DsssRate11Mbps"); |
91 std::string phyModeData ("DsssRate11Mbps"); | 91 std::string phyModeData ("DsssRate11Mbps"); |
92 std::string rate = "0.512kbps"; | 92 std::string rate = "0.512kbps"; |
93 double ppers = 1.0; | 93 double ppers = 1.0; |
94 /* | 94 /* |
95 * Define the DSR parameters | 95 * Define the DSR parameters |
96 */ | 96 */ |
97 uint32_t m_maxCacheLen = 64; | 97 uint32_t m_maxCacheLen = 64; |
98 Time m_maxCacheTime = Seconds (30); | 98 Time m_maxCacheTime = Seconds (30); |
99 Time m_nodeTraversalTime = MicroSeconds (1); | 99 Time m_nodeTraversalTime = MicroSeconds (2); |
100 Time m_passiveAckTimeout = MicroSeconds (2); | 100 Time m_passiveAckTimeout = MicroSeconds (4); |
101 uint32_t m_maxSendBuffLen = 64; | 101 uint32_t m_maxSendBuffLen = 64; |
102 Time m_sendBufferTimeout = Seconds (30); | 102 Time m_sendBufferTimeout = Seconds (30); |
103 uint32_t m_maxMaintainLen = 50; | 103 uint32_t m_maxMaintainLen = 50; |
104 Time m_maxMaintainTime = Seconds (30); | 104 Time m_maxMaintainTime = Seconds (30); |
105 uint32_t m_maintenanceRetries = 2; | 105 uint32_t m_maintenanceRetries = 2; |
106 | 106 |
107 //Allow users to override the default parameters and set it to new ones from C
ommandLine. | 107 //Allow users to override the default parameters and set it to new ones from C
ommandLine. |
108 CommandLine cmd; | 108 CommandLine cmd; |
109 cmd.AddValue ("MaxCacheLen", "Max route cache length.", m_maxCacheLen); | 109 cmd.AddValue ("MaxCacheLen", "Max route cache length.", m_maxCacheLen); |
110 cmd.AddValue ("RouteCacheTimeout", "Max route cache timeout.", m_maxCacheTime)
; | 110 cmd.AddValue ("RouteCacheTimeout", "Max route cache timeout.", m_maxCacheTime)
; |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 | 212 |
213 AsciiTraceHelper ascii; | 213 AsciiTraceHelper ascii; |
214 Ptr<OutputStreamWrapper> stream = ascii.CreateFileStream ("dsrtest.tr"); | 214 Ptr<OutputStreamWrapper> stream = ascii.CreateFileStream ("dsrtest.tr"); |
215 wifiPhy.EnableAsciiAll (stream); | 215 wifiPhy.EnableAsciiAll (stream); |
216 | 216 |
217 NS_LOG_INFO ("Run Simulation."); | 217 NS_LOG_INFO ("Run Simulation."); |
218 Simulator::Stop (Seconds (totalTime)); | 218 Simulator::Stop (Seconds (totalTime)); |
219 Simulator::Run (); | 219 Simulator::Run (); |
220 Simulator::Destroy (); | 220 Simulator::Destroy (); |
221 } | 221 } |
LEFT | RIGHT |