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 * This program is free software; you can redistribute it and/or modify | 3 * This program is free software; you can redistribute it and/or modify |
4 * it under the terms of the GNU General Public License version 2 as | 4 * it under the terms of the GNU General Public License version 2 as |
5 * published by the Free Software Foundation; | 5 * published by the Free Software Foundation; |
6 * | 6 * |
7 * This program is distributed in the hope that it will be useful, | 7 * This program is distributed in the hope that it will be useful, |
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 8 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
10 * GNU General Public License for more details. | 10 * GNU General Public License for more details. |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 // Configure the plot. The first argument is the file name prefix | 276 // Configure the plot. The first argument is the file name prefix |
277 // for the output files generated. The second, third, and fourth | 277 // for the output files generated. The second, third, and fourth |
278 // arguments are, respectively, the plot title, x-axis, and y-axis labels | 278 // arguments are, respectively, the plot title, x-axis, and y-axis labels |
279 plotHelper.ConfigurePlot ("seventh-packet-byte-count", | 279 plotHelper.ConfigurePlot ("seventh-packet-byte-count", |
280 "Packet Byte Count vs. Time", | 280 "Packet Byte Count vs. Time", |
281 "Time (Seconds)", | 281 "Time (Seconds)", |
282 "Packet Byte Count"); | 282 "Packet Byte Count"); |
283 | 283 |
284 // Specify the probe type, trace source path (in configuration namespace), and | 284 // Specify the probe type, trace source path (in configuration namespace), and |
285 // probe output trace source ("OutputBytes") to plot. The fourth argument | 285 // probe output trace source ("OutputBytes") to plot. The fourth argument |
286 // specifies the name of the data series label on the plot. The last | 286 // specifies the name of the data series label on the plot. |
287 // argument formats the plot by specifying where the key should be placed. | 287 plotHelper.AddProbe (probeType, |
288 plotHelper.PlotProbe (probeType, | 288 tracePath, |
289 tracePath, | 289 "OutputBytes", |
290 "OutputBytes", | 290 "Packet Byte Count"); |
291 "Packet Byte Count", | |
292 GnuplotAggregator::KEY_BELOW); | |
293 | 291 |
294 // Use FileHelper to write out the packet byte count over time | 292 // Use FileHelper to write out the packet byte count over time |
295 FileHelper fileHelper; | 293 FileHelper fileHelper; |
296 | 294 |
297 // Configure the file to be written, and the formatting of output data. | 295 // Configure the file to be written, and the formatting of output data. |
298 fileHelper.ConfigureFile ("seventh-packet-byte-count", | 296 fileHelper.ConfigureFile ("seventh-packet-byte-count", |
299 FileAggregator::FORMATTED); | 297 FileAggregator::FORMATTED); |
300 | 298 |
301 // Set the labels for this formatted output file. | 299 // Set the labels for this formatted output file. |
302 fileHelper.Set2dFormat ("Time (Seconds) = %.3e\tPacket Byte Count = %.0f"); | 300 fileHelper.Set2dFormat ("Time (Seconds) = %.3e\tPacket Byte Count = %.0f"); |
303 | 301 |
304 // Specify the probe type, trace source path (in configuration namespace), and | 302 // Specify the probe type, trace source path (in configuration namespace), and |
305 // probe output trace source ("OutputBytes") to write. | 303 // probe output trace source ("OutputBytes") to write. |
306 fileHelper.WriteProbe (probeType, | 304 fileHelper.AddProbe (probeType, |
307 tracePath, | 305 tracePath, |
308 "OutputBytes"); | 306 "OutputBytes"); |
309 | 307 |
310 Simulator::Stop (Seconds (20)); | 308 Simulator::Stop (Seconds (20)); |
311 Simulator::Run (); | 309 Simulator::Run (); |
312 Simulator::Destroy (); | 310 Simulator::Destroy (); |
313 | 311 |
314 return 0; | 312 return 0; |
315 } | 313 } |
316 | 314 |
OLD | NEW |