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) 2013 University of Washington | 3 * Copyright (c) 2013 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 | 119 |
120 // Configure the file to be written. | 120 // Configure the file to be written. |
121 fileHelper.ConfigureFile ("file-helper-example", | 121 fileHelper.ConfigureFile ("file-helper-example", |
122 FileAggregator::FORMATTED); | 122 FileAggregator::FORMATTED); |
123 | 123 |
124 // Set the labels for this formatted output file. | 124 // Set the labels for this formatted output file. |
125 fileHelper.Set2dFormat ("Time (Seconds) = %.3f\tCount = %.0f"); | 125 fileHelper.Set2dFormat ("Time (Seconds) = %.3f\tCount = %.0f"); |
126 | 126 |
127 // Write the values generated by the probe. The path that we | 127 // Write the values generated by the probe. The path that we |
128 // provide helps to disambiguate the source of the trace. | 128 // provide helps to disambiguate the source of the trace. |
129 fileHelper.WriteProbe ("ns3::Uinteger32Probe", | 129 fileHelper.AddProbe ("ns3::Uinteger32Probe", |
130 "/Names/Emitter/Counter", | 130 "/Names/Emitter/Counter", |
131 "Output"); | 131 "Output"); |
132 | 132 |
133 // The Emitter object is not associated with an ns-3 node, so | 133 // The Emitter object is not associated with an ns-3 node, so |
134 // it won't get started automatically, so we need to do this ourselves | 134 // it won't get started automatically, so we need to do this ourselves |
135 Simulator::Schedule (Seconds (0.0), &Emitter::Initialize, emitter); | 135 Simulator::Schedule (Seconds (0.0), &Emitter::Initialize, emitter); |
136 | 136 |
137 Simulator::Stop (Seconds (100.0)); | 137 Simulator::Stop (Seconds (100.0)); |
138 Simulator::Run (); | 138 Simulator::Run (); |
139 Simulator::Destroy (); | 139 Simulator::Destroy (); |
140 | 140 |
141 return 0; | 141 return 0; |
142 } | 142 } |
OLD | NEW |