LEFT | RIGHT |
(no file at all) | |
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) 2014 North Carolina State University | 3 * Copyright (c) 2014 North Carolina State University |
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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 void | 85 void |
86 WaveBsmHelper::Install (Ipv4InterfaceContainer & i, | 86 WaveBsmHelper::Install (Ipv4InterfaceContainer & i, |
87 Time totalTime, // seconds | 87 Time totalTime, // seconds |
88 uint32_t wavePacketSize, // bytes | 88 uint32_t wavePacketSize, // bytes |
89 Time waveInterval, // seconds | 89 Time waveInterval, // seconds |
90 double gpsAccuracyNs, // clock drift range in number
of ns | 90 double gpsAccuracyNs, // clock drift range in number
of ns |
91 std::vector <double> ranges, // m | 91 std::vector <double> ranges, // m |
92 int chAccessMode, // channel access mode | 92 int chAccessMode, // channel access mode |
93 Time txMaxDelay) // max delay prior to transmit | 93 Time txMaxDelay) // max delay prior to transmit |
94 { | 94 { |
95 int size = ranges.size (); | 95 size_t size = ranges.size (); |
96 m_txSafetyRangesSq.clear (); | 96 m_txSafetyRangesSq.clear (); |
97 m_txSafetyRangesSq.resize (size, 0); | 97 m_txSafetyRangesSq.resize (size, 0); |
98 for (int index = 0; index < size; index++) | 98 for (size_t index = 0; index < size; index++) |
99 { | 99 { |
100 // stored as square of value, for optimization | 100 // stored as square of value, for optimization |
101 m_txSafetyRangesSq[index] = ranges[index] * ranges[index]; | 101 m_txSafetyRangesSq[index] = ranges[index] * ranges[index]; |
102 } | 102 } |
103 | 103 |
104 // install a BsmApplication on each node | 104 // install a BsmApplication on each node |
105 ApplicationContainer bsmApps = Install (i); | 105 ApplicationContainer bsmApps = Install (i); |
106 // start BSM app immediately (BsmApplication will | 106 // start BSM app immediately (BsmApplication will |
107 // delay transmission of first BSM by 1.0 seconds) | 107 // delay transmission of first BSM by 1.0 seconds) |
108 bsmApps.Start (Seconds (0)); | 108 bsmApps.Start (Seconds (0)); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 return (currentStream - stream); | 155 return (currentStream - stream); |
156 } | 156 } |
157 | 157 |
158 std::vector<int>& | 158 std::vector<int>& |
159 WaveBsmHelper::GetNodesMoving () | 159 WaveBsmHelper::GetNodesMoving () |
160 { | 160 { |
161 return nodesMoving; | 161 return nodesMoving; |
162 } | 162 } |
163 | 163 |
164 } // namespace ns3 | 164 } // namespace ns3 |
LEFT | RIGHT |