--- a/src/core/helper/event-garbage-collector.h +++ a/src/core/helper/event-garbage-collector.h @@ -27,7 +27,7 @@ namespace ns3 { /** - * \ingroup tools + * \ingroup events * * \brief An object that tracks scheduled events and automatically * cancels them when it is destroyed. It is useful in situations --- a/src/stats/helper/file-helper.h +++ a/src/stats/helper/file-helper.h @@ -32,6 +32,7 @@ namespace ns3 { /** + * \ingroup stats * \brief Helper class used to put data values into a file. **/ class FileHelper @@ -304,17 +305,16 @@ /// Heading line for the outputfile. std::string m_heading; - /// Format strings for C-style sprintf() function. - std::string m_1dFormat; - std::string m_2dFormat; - std::string m_3dFormat; - std::string m_4dFormat; - std::string m_5dFormat; - std::string m_6dFormat; - std::string m_7dFormat; - std::string m_8dFormat; - std::string m_9dFormat; - std::string m_10dFormat; + std::string m_1dFormat; //!< Format string for 1D format C-style sprintf() function. + std::string m_2dFormat; //!< Format string for 2D format C-style sprintf() function. + std::string m_3dFormat; //!< Format string for 3D format C-style sprintf() function. + std::string m_4dFormat; //!< Format string for 4D format C-style sprintf() function. + std::string m_5dFormat; //!< Format string for 5D format C-style sprintf() function. + std::string m_6dFormat; //!< Format string for 6D format C-style sprintf() function. + std::string m_7dFormat; //!< Format string for 7D format C-style sprintf() function. + std::string m_8dFormat; //!< Format string for 8D format C-style sprintf() function. + std::string m_9dFormat; //!< Format string for 9D format C-style sprintf() function. + std::string m_10dFormat; //!< Format string for 10D format C-style sprintf() function. }; // class FileHelper --- a/src/stats/helper/gnuplot-helper.h +++ a/src/stats/helper/gnuplot-helper.h @@ -33,6 +33,7 @@ namespace ns3 { /** + * \ingroup gnuplot * \brief Helper class used to make gnuplot plots. **/ class GnuplotHelper --- a/src/stats/model/average.h +++ a/src/stats/model/average.h @@ -30,12 +30,7 @@ namespace ns3 { /** - * \defgroup tools Tools - * - */ - -/** - * \ingroup tools + * \ingroup stats * * Simple average, min, max and std. deviation calculator * @@ -106,9 +101,10 @@ //\} private: - uint32_t m_size; - T m_min, m_max; - MinMaxAvgTotalCalculator m_varianceCalculator; + uint32_t m_size; //!< Number of sampled data. + T m_min; //!< Minimum value observed. + T m_max; //!< Maximum value observed. + MinMaxAvgTotalCalculator m_varianceCalculator; //!< Variance calculator. }; /// Print avg (err) [min, max] --- a/src/stats/model/basic-data-calculators.h +++ a/src/stats/model/basic-data-calculators.h @@ -27,11 +27,6 @@ namespace ns3 { /** - * \defgroup stats Statistics - * - */ - -/** * \ingroup stats * \class MinMaxAvgTotalCalculator * \brief Template class MinMaxAvgTotalCalculator @@ -102,19 +97,19 @@ protected: virtual void DoDispose (void); - uint32_t m_count; /// Count value of MinMaxAvgTotalCalculator + uint32_t m_count; //!< Count value of MinMaxAvgTotalCalculator - T m_total; /// Total value of MinMaxAvgTotalCalculator - T m_squareTotal; /// Sum of squares value of MinMaxAvgTotalCalculator - T m_min; /// Minimum value of MinMaxAvgTotalCalculator - T m_max; /// Maximum value of MinMaxAvgTotalCalculator + T m_total; //!< Total value of MinMaxAvgTotalCalculator + T m_squareTotal; //!< Sum of squares value of MinMaxAvgTotalCalculator + T m_min; //!< Minimum value of MinMaxAvgTotalCalculator + T m_max; //!< Maximum value of MinMaxAvgTotalCalculator - double m_meanCurr; /// Current mean of MinMaxAvgTotalCalculator - double m_sCurr; /// Current s of MinMaxAvgTotalCalculator - double m_varianceCurr; /// Current variance of MinMaxAvgTotalCalculator + double m_meanCurr; //!< Current mean of MinMaxAvgTotalCalculator + double m_sCurr; //!< Current s of MinMaxAvgTotalCalculator + double m_varianceCurr; //!< Current variance of MinMaxAvgTotalCalculator - double m_meanPrev; /// Previous mean of MinMaxAvgTotalCalculator - double m_sPrev; /// Previous s of MinMaxAvgTotalCalculator + double m_meanPrev; //!< Previous mean of MinMaxAvgTotalCalculator + double m_sPrev; //!< Previous s of MinMaxAvgTotalCalculator // end MinMaxAvgTotalCalculator }; @@ -279,7 +274,7 @@ protected: virtual void DoDispose (void); - T m_count; /// Count value of CounterCalculator + T m_count; //!< Count value of CounterCalculator // end CounterCalculator }; --- a/src/stats/model/boolean-probe.h +++ a/src/stats/model/boolean-probe.h @@ -34,6 +34,8 @@ namespace ns3 { /** + * \ingroup probes + * * This class is designed to probe an underlying ns3 TraceSource exporting * a bool. This probe exports a trace source "Output" of type bool. * The Output trace source emits a value when either the trace source @@ -45,6 +47,10 @@ class BooleanProbe : public Probe { public: + /** + * \brief Get the type ID. + * \return the object TypeId + */ static TypeId GetTypeId (); BooleanProbe (); virtual ~BooleanProbe (); @@ -97,7 +103,7 @@ */ void TraceSink (bool oldData, bool newData); - TracedValue m_output; + TracedValue m_output; //!< Output trace source. }; } // namespace ns3 --- a/src/stats/model/data-calculator.h +++ a/src/stats/model/data-calculator.h @@ -26,7 +26,7 @@ #include "ns3/simulator.h" namespace ns3 { -extern const double NaN; /// Stored representation of NaN +extern const double NaN; //!< Stored representation of NaN /** * \brief true if x is NaN @@ -166,16 +166,16 @@ virtual void Output (DataOutputCallback &callback) const = 0; protected: - bool m_enabled; /// Descendant classes *must* check & respect m_enabled! + bool m_enabled; //!< Descendant classes *must* check & respect m_enabled! - std::string m_key; /// Key value - std::string m_context; /// Context value + std::string m_key; //!< Key value + std::string m_context; //!< Context value virtual void DoDispose (void); private: - EventId m_startEvent; - EventId m_stopEvent; + EventId m_startEvent; //!< Start event + EventId m_stopEvent; //!< Stop event // end class DataCalculator }; --- a/src/stats/model/data-collection-object.h +++ a/src/stats/model/data-collection-object.h @@ -27,6 +27,8 @@ namespace ns3 { /** + * \ingroup aggregator + * * Base class for data collection framework objects. * * All data collection objects have 1) a string name, and 2) enabled @@ -35,6 +37,10 @@ class DataCollectionObject : public Object { public: + /** + * \brief Get the type ID. + * \return the object TypeId + */ static TypeId GetTypeId (); DataCollectionObject (); --- a/src/stats/model/data-collector.h +++ a/src/stats/model/data-collector.h @@ -28,10 +28,6 @@ namespace ns3 { -/** - * \ingroup stats - * - */ class DataCalculator; //------------------------------------------------------------ @@ -46,7 +42,7 @@ typedef std::list > MetadataList; /** - * \ingroup stats + * \ingroup dataoutput * \class DataCollector * \brief Collects data */ @@ -144,14 +140,14 @@ virtual void DoDispose (); private: - std::string m_experimentLabel; - std::string m_strategyLabel; - std::string m_inputLabel; - std::string m_runLabel; - std::string m_description; + std::string m_experimentLabel; //!< Experiment label + std::string m_strategyLabel; //!< Strategy label + std::string m_inputLabel; //!< Input label + std::string m_runLabel; //!< Run label + std::string m_description; //!< Description label - MetadataList m_metadata; - DataCalculatorList m_calcList; + MetadataList m_metadata; //!< List of experiment metadata + DataCalculatorList m_calcList; //!< List of data calculators // end class DataCollector }; --- a/src/stats/model/data-output-interface.h +++ a/src/stats/model/data-output-interface.h @@ -32,11 +32,10 @@ //------------------------------------------------------------ //-------------------------------------------- /** - * \ingroup stats - * \class DataCollector + * \ingroup dataoutput + * * \brief Abstract Data Output Interface class - * - */ +s */ class DataOutputInterface : public Object { public: DataOutputInterface(); @@ -50,7 +49,7 @@ /** * Sets the DataOutputInterface prefix to the provided prefix - * \param File prefix as a string + * \param prefix prefix as a string */ void SetFilePrefix (const std::string prefix); /** @@ -62,14 +61,14 @@ protected: virtual void DoDispose (); - std::string m_filePrefix; /// File prefix for the DataOutputInterface + std::string m_filePrefix; //!< File prefix for the DataOutputInterface // end class DataOutputInterface }; /** - * \ingroup stats - * \class DataOutputCallback + * \ingroup dataoutput + * * \brief Callback class for the DataOutput classes * */ --- a/src/stats/model/double-probe.h +++ a/src/stats/model/double-probe.h @@ -34,6 +34,8 @@ namespace ns3 { /** + * \ingroup probes + * * This class is designed to probe an underlying ns3 TraceSource exporting * a double. This probe exports a trace source "Output" of type double. * The Output trace source emits a value when either the trace source @@ -45,6 +47,10 @@ class DoubleProbe : public Probe { public: + /** + * \brief Get the type ID. + * \return the object TypeId + */ static TypeId GetTypeId (); DoubleProbe (); virtual ~DoubleProbe (); @@ -92,12 +98,10 @@ * * \param oldData previous value of the double * \param newData new value of the double - * - * \internal */ void TraceSink (double oldData, double newData); - TracedValue m_output; + TracedValue m_output; //!< Output trace source. }; } // namespace ns3 --- a/src/stats/model/file-aggregator.h +++ a/src/stats/model/file-aggregator.h @@ -32,6 +32,8 @@ namespace ns3 { /** + * \ingroup aggregator + * * This aggregator sends values it receives to a file. **/ class FileAggregator : public DataCollectionObject @@ -46,6 +48,10 @@ TAB_SEPARATED }; + /** + * \brief Get the type ID. + * \return the object TypeId + */ static TypeId GetTypeId (); /** @@ -364,17 +370,16 @@ /// Heading line for the outputfile. std::string m_heading; - /// Format strings for C-style sprintf() function. - std::string m_1dFormat; - std::string m_2dFormat; - std::string m_3dFormat; - std::string m_4dFormat; - std::string m_5dFormat; - std::string m_6dFormat; - std::string m_7dFormat; - std::string m_8dFormat; - std::string m_9dFormat; - std::string m_10dFormat; + std::string m_1dFormat; //!< Format string for 1D C-style sprintf() function. + std::string m_2dFormat; //!< Format string for 2D C-style sprintf() function. + std::string m_3dFormat; //!< Format string for 3D C-style sprintf() function. + std::string m_4dFormat; //!< Format string for 4D C-style sprintf() function. + std::string m_5dFormat; //!< Format string for 5D C-style sprintf() function. + std::string m_6dFormat; //!< Format string for 6D C-style sprintf() function. + std::string m_7dFormat; //!< Format string for 7D C-style sprintf() function. + std::string m_8dFormat; //!< Format string for 8D C-style sprintf() function. + std::string m_9dFormat; //!< Format string for 9D C-style sprintf() function. + std::string m_10dFormat; //!< Format string for 10D C-style sprintf() function. }; // class FileAggregator --- a/src/stats/model/gnuplot-aggregator.h +++ a/src/stats/model/gnuplot-aggregator.h @@ -32,6 +32,7 @@ namespace ns3 { /** + * \ingroup aggregator * This aggregator produces output used to make gnuplot plots. **/ class GnuplotAggregator : public DataCollectionObject @@ -46,6 +47,10 @@ KEY_BELOW }; + /** + * \brief Get the type ID. + * \return the object TypeId + */ static TypeId GetTypeId (); /** --- a/src/stats/model/gnuplot.cc +++ a/src/stats/model/gnuplot.cc @@ -27,17 +27,24 @@ // --- GnuplotDataset::Data ------------------------------------------------ // +/** + * \ingroup gnuplot + * + * Structure storing the data to plot. + * Derived classes subclass this struct and add their own data fields. + */ struct GnuplotDataset::Data { // *** Data Variables *** - unsigned int m_references; + unsigned int m_references; //!< ref/unref counter for garbage collection - std::string m_title; - std::string m_extra; + std::string m_title; //!< Dataset title + std::string m_extra; //!< Extra parameters for the plot /** * Initializes the reference counter to 1 and sets m_title and m_extra. + * \param title Dataset title */ Data(const std::string& title); @@ -45,7 +52,8 @@ virtual ~Data(); /** - * Returns "plot" or "splot". + * \brief Returns the plot type ("plot" or "splot"). + * \returns the plot type ("plot" or "splot"). */ virtual std::string GetCommand () const = 0; @@ -57,6 +65,11 @@ * If more than one output file is being generated, i.e. separate * data and control files, then the index for the current dataset * and the name for the data file are also included. + * + * \param os Output stream + * \param generateOneOutputFile If true, generate only one output file. + * \param dataFileDatasetIndex Dataset Index + * \param dataFileName Dataset file name */ virtual void PrintExpression (std::ostream &os, bool generateOneOutputFile, @@ -66,6 +79,9 @@ /** * Print the inline data file contents trailing the plot command. Empty for * functions. + * + * \param os Output stream + * \param generateOneOutputFile If true, generate only one output file. */ virtual void PrintDataFile (std::ostream &os, bool generateOneOutputFile) const = 0; @@ -140,17 +156,23 @@ // --- Gnuplot2dDataset::Data2d -------------------------------------------- // +/** + * \ingroup gnuplot + * + * Structure storing the data to for a 2D plot. + */ struct Gnuplot2dDataset::Data2d : public GnuplotDataset::Data { // *** Data Variables *** - enum Style m_style; - enum ErrorBars m_errorBars; + enum Style m_style; //!< The plotting style to use for this dataset. + enum ErrorBars m_errorBars; //!< Whether errorbars should be used for this dataset. - PointSet m_pointset; + PointSet m_pointset; //!< The set of points in this data set /** * Initializes with the values from m_defaultStyle and m_defaultErrorBars. + * \param title Dataset title */ Data2d(const std::string& title); @@ -386,14 +408,22 @@ // --- Gnuplot2dFunction::Function2d --------------------------------------- // +/** + * \ingroup gnuplot + * + * Structure storing the function to be used for a 2D plot. + */ struct Gnuplot2dFunction::Function2d : public GnuplotDataset::Data { // *** Data Variables *** - std::string m_function; + std::string m_function; //!< Function to use /** * Initializes with the function and title. + * + * \param title Title of the plot + * \param function Function to plot */ Function2d(const std::string& title, const std::string& function); @@ -459,16 +489,22 @@ // --- Gnuplot3dDataset::Data3d -------------------------------------------- // +/** + * \ingroup gnuplot + * + * Structure storing the data for a 3D plot. + */ struct Gnuplot3dDataset::Data3d : public GnuplotDataset::Data { // *** Data Variables *** - std::string m_style; + std::string m_style; //!< The plotting style to use for this dataset. - PointSet m_pointset; + PointSet m_pointset; //!< The set of points in this data set /** * Initializes with value from m_defaultStyle. + * \param title Dataset title */ Data3d(const std::string& title); @@ -574,14 +610,22 @@ // --- Gnuplot3dFunction::Function3d --------------------------------------- // +/** + * \ingroup gnuplot + * + * Structure storing the function to be used for a 3D plot. + */ struct Gnuplot3dFunction::Function3d : public GnuplotDataset::Data { // *** Data Variables *** - std::string m_function; + std::string m_function; //!< Function to use /** * Initializes with the function and title. + * + * \param title Title of the plot + * \param function Function to plot */ Function3d(const std::string& title, const std::string& function); --- a/src/stats/model/gnuplot.h +++ a/src/stats/model/gnuplot.h @@ -28,7 +28,7 @@ namespace ns3 { /** - * \ingroup tools + * \ingroup gnuplot * * \brief Abstract class to store a plot line to be used by ns3::Gnuplot. * @@ -104,6 +104,8 @@ }; /** + * \ingroup gnuplot + * * \class Gnuplot2dDataset * \brief Class to represent a 2D points plot. Set the line or points style * using SetStyle() and set points using Add(). @@ -205,24 +207,30 @@ private: + /** + * A point in a 2D plot + */ struct Point { - bool empty; - double x; - double y; - double dx; - double dy; + bool empty; //!< the point is empty + double x; //!< X coordinate + double y; //!< Y coordinate + double dx; //!< X error delta + double dy; //!< Y error delta }; + /// The set of points in the dataset typedef std::vector PointSet; - static enum Style m_defaultStyle; - static enum ErrorBars m_defaultErrorBars; + static enum Style m_defaultStyle; //!< default plot style + static enum ErrorBars m_defaultErrorBars; //!< default error bars type /// Forward declaration of the internal data class. struct Data2d; }; /** + * \ingroup gnuplot + * * \brief Class to represent a 2D function expression plot. * * Since the function expression is not escaped, styles and extras could just @@ -252,6 +260,8 @@ }; /** + * \ingroup gnuplot + * * \brief Class to represent a 3D points plot. Set the line or points style * using SetStyle() and set points using Add(). */ @@ -294,20 +304,28 @@ private: + /** + * A point in a 3D plot + */ struct Point { - bool empty; - double x, y, z; + bool empty; //!< the point is empty + double x; //!< X coordinate + double y; //!< Y coordinate + double z; //!< Z coordinate }; + /// The set of points in the dataset typedef std::vector PointSet; - static std::string m_defaultStyle; + static std::string m_defaultStyle; //!< default plot style /// Forward declaration of the internal data class. struct Data3d; }; /** + * \ingroup gnuplot + * * \brief Class to represent a 3D function expression plot. * * Since the function expression is not escaped, styles and extras could just as @@ -338,6 +356,8 @@ }; /** + * \ingroup gnuplot + * * \brief a simple class to generate gnuplot-ready plotting commands * from a set of datasets. * @@ -436,24 +456,27 @@ void SetDataFileDatasetIndex (unsigned int index); private: + /// Type for Datasets to be used in plots typedef std::vector Datasets; - std::string m_outputFilename; - std::string m_terminal; + std::string m_outputFilename; //!< Output file name + std::string m_terminal; //!< Gnuplot "terminal" to use - Datasets m_datasets; + Datasets m_datasets; //!< Data sets - std::string m_title; - std::string m_xLegend; - std::string m_yLegend; - std::string m_extra; + std::string m_title; //!< Plot title + std::string m_xLegend; //!< X axis legend + std::string m_yLegend; //!< Y axis legend + std::string m_extra; //!< extra parameters for the plot - bool m_generateOneOutputFile; + bool m_generateOneOutputFile; //!< true if only one plot will be generated - unsigned int m_dataFileDatasetIndex; + unsigned int m_dataFileDatasetIndex; //!< Data set index to plot }; /** + * \ingroup gnuplot + * * \brief a simple class to group together multiple gnuplots into one file, * e.g. for PDF multi-page output terminals. */ @@ -505,12 +528,13 @@ std::string dataFileName); private: + /// Type of the Gnuplot collection typedef std::vector Plots; - std::string m_outputFilename; - std::string m_terminal; + std::string m_outputFilename; //!< Output file name + std::string m_terminal; //!< Gnuplot "terminal" to use - Plots m_plots; + Plots m_plots; //!< Plots in the collection }; } // namespace ns3 --- a/src/stats/model/omnet-data-output.h +++ a/src/stats/model/omnet-data-output.h @@ -31,7 +31,7 @@ //------------------------------------------------------------ //-------------------------------------------- /** - * \ingroup stats + * \ingroup dataoutput * \class OmnetDataOutput * \brief Outputs data in a format compatible with OMNeT library and framework * @@ -47,36 +47,81 @@ virtual void DoDispose (); private: + /** + * \ingroup dataoutput + * + * \brief Class to generate OMNeT output + */ class OmnetOutputCallback : public DataOutputCallback { public: + /** + * Constructor + * \param scalar the output stream + */ OmnetOutputCallback(std::ostream *scalar); + /** + * \brief Generates data statistics + * \param context the output context + * \param name the output name + * \param statSum the stats to print + */ void OutputStatistic (std::string context, std::string name, const StatisticalSummary *statSum); + /** + * \brief Generates a single data output + * \param context the output context + * \param name the output name + * \param val the value + */ void OutputSingleton (std::string context, std::string name, int val); + /** + * \brief Generates a single data output + * \param context the output context + * \param name the output name + * \param val the value + */ void OutputSingleton (std::string context, std::string name, uint32_t val); + /** + * \brief Generates a single data output + * \param context the output context + * \param name the output name + * \param val the value + */ void OutputSingleton (std::string context, std::string name, double val); + /** + * \brief Generates a single data output + * \param context the output context + * \param name the output name + * \param val the value + */ void OutputSingleton (std::string context, std::string name, std::string val); + /** + * \brief Generates a single data output + * \param context the output context + * \param name the output name + * \param val the value + */ void OutputSingleton (std::string context, std::string name, Time val); private: - std::ostream *m_scalar; + std::ostream *m_scalar; //!< output stream // end class OmnetOutputCallback }; --- a/src/stats/model/probe.h +++ a/src/stats/model/probe.h @@ -28,6 +28,8 @@ namespace ns3 { /** + * \ingroup probes + * * Base class for probes. * * This class provides general functionality to control each @@ -37,6 +39,10 @@ class Probe : public DataCollectionObject { public: + /** + * \brief Get the type ID. + * \return the object TypeId + */ static TypeId GetTypeId (); Probe (); virtual ~Probe (); --- a/src/stats/model/sqlite-data-output.h +++ a/src/stats/model/sqlite-data-output.h @@ -34,7 +34,7 @@ //------------------------------------------------------------ //-------------------------------------------- /** - * \ingroup stats + * \ingroup dataoutput * \class SqliteDataOutput * \brief Outputs data in a format compatible with SQLite */ @@ -49,43 +49,95 @@ virtual void DoDispose (); private: + /** + * \ingroup dataoutput + * + * \brief Class to generate OMNeT output + */ class SqliteOutputCallback : public DataOutputCallback { public: + /** + * Constructor + * \param owner pointer to the instance this object belongs to + * \param run experiment descriptor + */ SqliteOutputCallback(Ptr owner, std::string run); + /** + * \brief Generates data statistics + * \param key the SQL key to use + * \param variable the variable name + * \param statSum the stats to print + */ void OutputStatistic (std::string key, std::string variable, const StatisticalSummary *statSum); + /** + * \brief Generates a single data output + * \param key the SQL key to use + * \param variable the variable name + * \param val the value + */ void OutputSingleton (std::string key, std::string variable, int val); + /** + * \brief Generates a single data output + * \param key the SQL key to use + * \param variable the variable name + * \param val the value + */ void OutputSingleton (std::string key, std::string variable, uint32_t val); + /** + * \brief Generates a single data output + * \param key the SQL key to use + * \param variable the variable name + * \param val the value + */ void OutputSingleton (std::string key, std::string variable, double val); + /** + * \brief Generates a single data output + * \param key the SQL key to use + * \param variable the variable name + * \param val the value + */ void OutputSingleton (std::string key, std::string variable, std::string val); + /** + * \brief Generates a single data output + * \param key the SQL key to use + * \param variable the variable name + * \param val the value + */ void OutputSingleton (std::string key, std::string variable, Time val); private: - Ptr m_owner; - std::string m_runLabel; + Ptr m_owner; //!< the instance this object belongs to + std::string m_runLabel; //!< Run label // end class SqliteOutputCallback }; - sqlite3 *m_db; + sqlite3 *m_db; //!< pointer to the SQL database + + /** + * \brief Execute a sqlite3 query + * \param exe the query to execute + * \return sqlite return code. + */ int Exec (std::string exe); // end class SqliteDataOutput --- a/src/stats/model/stats.h +++ a/src/stats/model/stats.h @@ -0,0 +1,78 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2013 Universita' di Firenze + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Tommaso Pecorella + */ + +#ifndef STATS_H +#define STATS_H + +// Header file used only to define the stats group in Doxygen + +/** + * \defgroup stats Statistics + * + * The statistics module includes some useful features to ease data collection from experiments. + * In particular the following features are included: + *
    + *
  • The core framework and two basic data collectors: A counter, and a min/max/avg/total observer.
  • + *
  • Extensions of those to easily work with times and packets.
  • + *
  • Plaintext output formatted for OMNet++.
  • + *
  • Database output using SQLite, a standalone, lightweight, high performance SQL engine.
  • + *
  • Mandatory and open ended metadata for describing and working with runs.
  • + *
+ * + * See the manual for a complete documentation. + */ + +/** + * \ingroup stats + * \defgroup aggregator Data Aggregators + * + * Data aggregators are classes used to collect data and produce output + * specialized for various purpose, e.g., Gnuplot, file output, etc. + */ + +/** + * \ingroup stats + * \defgroup probes Probes + * + * Probes are used to probe an underlying ns3 TraceSource exporting + * its value. This probe usually exports a trace source "Output". + * The Output trace source emits a value when either the trace source + * emits a new value, or when SetValue () is called. + * + * Probes are a special kind of Data Aggregator + */ + +/** + * \ingroup stats + * \defgroup gnuplot Gnuplot + * + * Classes in Gnuplot group are used to collect and prepare and output data + * for subsequent processing by Gnuplot. + */ + +/** + * \ingroup stats + * \defgroup dataoutput Data Output + * + * Classes in Data Output group are used to collect and prepare and output data + * for subsequent ouput in a specific format, e.g., Omnet++, SQLite, etc. + */ + +#endif /* STATS_H */ --- a/src/stats/model/time-data-calculators.h +++ a/src/stats/model/time-data-calculators.h @@ -59,10 +59,10 @@ protected: virtual void DoDispose (void); - uint32_t m_count; /// Count value of TimeMinMaxAvgTotalCalculator - Time m_total; /// Total value of TimeMinMaxAvgTotalCalculator - Time m_min; /// Minimum value of TimeMinMaxAvgTotalCalculator - Time m_max; /// Maximum value of TimeMinMaxAvgTotalCalculator + uint32_t m_count; //!< Count value of TimeMinMaxAvgTotalCalculator + Time m_total; //!< Total value of TimeMinMaxAvgTotalCalculator + Time m_min; //!< Minimum value of TimeMinMaxAvgTotalCalculator + Time m_max; //!< Maximum value of TimeMinMaxAvgTotalCalculator // end class TimeMinMaxAvgTotalCalculator }; --- a/src/stats/model/time-series-adaptor.h +++ a/src/stats/model/time-series-adaptor.h @@ -29,6 +29,8 @@ namespace ns3 { /** + * \ingroup aggregator + * * \brief Takes probed values of different types and outputs the * current time plus the value with both converted to doubles. * @@ -46,6 +48,10 @@ class TimeSeriesAdaptor : public DataCollectionObject { public: + /** + * \brief Get the type ID. + * \return the object TypeId + */ static TypeId GetTypeId (void); TimeSeriesAdaptor (); @@ -107,7 +113,7 @@ void TraceSinkUinteger32 (uint32_t oldData, uint32_t newData); private: - TracedCallback m_output; + TracedCallback m_output; //!< output trace }; } // namespace ns3 --- a/src/stats/model/uinteger-16-probe.h +++ a/src/stats/model/uinteger-16-probe.h @@ -31,6 +31,8 @@ namespace ns3 { /** + * \ingroup probes + * * This class is designed to probe an underlying ns3 TraceSource exporting * an uint16_t. This probe exports a trace source "Output" of type uint16_t. * The Output trace source emits a value when either the trace source @@ -41,6 +43,10 @@ class Uinteger16Probe : public Probe { public: + /** + * \brief Get the type ID. + * \return the object TypeId + */ static TypeId GetTypeId (); Uinteger16Probe (); virtual ~Uinteger16Probe (); @@ -88,12 +94,10 @@ * * \param oldData previous value of the uint16_t * \param newData new value of the uint16_t - * - * \internal */ void TraceSink (uint16_t oldData, uint16_t newData); - TracedValue m_output; + TracedValue m_output; //!< Output trace source. }; } // namespace ns3 --- a/src/stats/model/uinteger-32-probe.h +++ a/src/stats/model/uinteger-32-probe.h @@ -31,6 +31,8 @@ namespace ns3 { /** + * \ingroup probes + * * This class is designed to probe an underlying ns3 TraceSource exporting * an uint32_t. This probe exports a trace source "Output" of type uint32_t. * The Output trace source emits a value when either the trace source @@ -41,6 +43,10 @@ class Uinteger32Probe : public Probe { public: + /** + * \brief Get the type ID. + * \return the object TypeId + */ static TypeId GetTypeId (); Uinteger32Probe (); virtual ~Uinteger32Probe (); @@ -88,12 +94,10 @@ * * \param oldData previous value of the uint32_t * \param newData new value of the uint32_t - * - * \internal */ void TraceSink (uint32_t oldData, uint32_t newData); - TracedValue m_output; + TracedValue m_output; //!< Output trace source. }; } // namespace ns3 --- a/src/stats/model/uinteger-8-probe.h +++ a/src/stats/model/uinteger-8-probe.h @@ -31,6 +31,8 @@ namespace ns3 { /** + * \ingroup probes + * * This class is designed to probe an underlying ns3 TraceSource exporting * an uint8_t. This probe exports a trace source "Output" of type uint8_t. * The Output trace source emits a value when either the trace source @@ -41,6 +43,10 @@ class Uinteger8Probe : public Probe { public: + /** + * \brief Get the type ID. + * \return the object TypeId + */ static TypeId GetTypeId (); Uinteger8Probe (); virtual ~Uinteger8Probe (); @@ -88,12 +94,10 @@ * * \param oldData previous value of the uint8_t * \param newData new value of the uint8_t - * - * \internal */ void TraceSink (uint8_t oldData, uint8_t newData); - TracedValue m_output; + TracedValue m_output; //!< Output trace source. }; } // namespace ns3