OLD | NEW |
1 .. include:: replace.txt | 1 .. include:: replace.txt |
2 | 2 |
3 .. heading hierarchy: | 3 .. heading hierarchy: |
4 ************* Section (#.#) | 4 ************* Section (#.#) |
5 ============= Subsection (#.#.#) | 5 ============= Subsection (#.#.#) |
6 ############# Paragraph (no number) | 6 ############# Paragraph (no number) |
7 ~~~~~~~~~~~~~ Sub-paragraph (no number) | 7 ~~~~~~~~~~~~~ Sub-paragraph (no number) |
8 | 8 |
9 Collectors | 9 Collectors |
10 ********** | 10 ********** |
11 | 11 |
12 This section is a placeholder to detail the functionalities provided by· | 12 As stated in the introduction, a *Collector* consumes the data generated· |
13 the Collector | 13 by one or more Probe objects. It performs transformations on the data,· |
14 class to an |ns3| simulation, and gives examples on how to code them | 14 such as normalization, reduction, and the computation of basic statistics.· |
15 in a program.· | 15 Collector objects do not produce data that is directly output by the ns-3· |
| 16 run; instead, they output data downstream to another type of object,· |
| 17 called *Aggregator*, which performs that function. Typically,· |
| 18 Collectors output their data in the form of trace sources as well,· |
| 19 allowing collectors to be chained in series. |
16 | 20 |
17 **Note:** As of ns-3.18, Collectors are still under development and | 21 There are four Collector types presently provided: |
18 not yet provided as part of the framework. | 22 |
| 23 * EventDrivenCollector |
| 24 * TimeSeriesCollector |
| 25 * TimeAverageCollector |
| 26 * ScalingCollector |
| 27 |
| 28 There is a Collector base class that exists to provide default |
| 29 implementations of various TraceSinks for popular |ns3| data types |
| 30 (e.g. Double, Boolean, Time), and to allow for generic collector containers |
| 31 that hold different types of collectors. |
| 32 |
| 33 The ``ns3::EventDrivenCollector`` is almost a pass-through object |
| 34 for data generated by probes; its main responsibility is for converting |
| 35 output data into C++ type ``double``, and for appending a timestamp |
| 36 (also of type ``double``). The data is provided in a trace source |
| 37 named ``Output`` with signature: |
| 38 |
| 39 :: |
| 40 |
| 41 // the output data trace source |
| 42 TracedCallback<double, double> m_output; |
| 43 |
| 44 In fact, this is a common pattern for trace sources from these collectors, |
| 45 converting current |ns3| Time to a double value (seconds) and converting |
| 46 the new value provided by the probe to a double valued quantity. |
| 47 |
| 48 The EventDrivenCollector provides output asynchronously, for each |
| 49 event generated by the attached probe. The ``ns3::TimeSeriesCollector`` |
| 50 instead provides a time series of data, sampled every ``Period`` seconds |
| 51 (where Period is an |ns3| attribute). So while a probe may produce |
| 52 data many times per second, the time series collector outputs the most |
| 53 currently received value when its regular period is up. |
| 54 |
| 55 The ``ns3::TimeAverageCollector`` will also produce regular output according |
| 56 to a period (default 1 second), but will sum and average the values |
| 57 received by the probe across the measurement period. This is useful for |
| 58 plotting data rates (e.g. if a probe said that two 1000 byte packets |
| 59 were generated in the past second, the output of this collector would |
| 60 be 16,000 (bits/sec) in that reporting interval). |
| 61 |
| 62 Finally, the ``ns3::ScalingCollector`` will transform the input data |
| 63 that it receives by multiplying by a scaling factor, useful for |
| 64 converting the units on the output data. This collector is usually |
| 65 placed in series with another upstream Collector. |
OLD | NEW |