24 #include "ns3/simulator.h"
27 #define DEFAULT_BIN_WIDTH 1
82 uint32_t index = (uint32_t)std::floor (value/
m_binWidth);
108 #define INDENT(level) for (int __xpto = 0; __xpto < level; __xpto++) os << ' ';
110 INDENT (indent); os <<
"<" << elementName
115 #if 1 // two alternative forms of representing bin data, one more verbose than the other one
116 for (uint32_t index = 0; index <
m_histogram.size (); index++)
122 <<
" index=\"" << (index) <<
"\""
124 <<
" width=\"" << m_binWidth <<
"\""
131 for (uint32_t index = 0; index <
m_histogram.size (); index++)
142 INDENT (indent); os <<
"</" << elementName <<
">\n";
double GetBinEnd(uint32_t index)
Returns the bin end, i.e., (index+1)*binWidth.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
double GetBinWidth(uint32_t index) const
Returns the bin width.
std::vector< uint32_t > m_histogram
Histogram data.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
double m_binWidth
Bin width.
def indent(source, debug, level)
#define DEFAULT_BIN_WIDTH
uint32_t GetNBins() const
Returns the number of bins in the histogram.
void SetDefaultBinWidth(double binWidth)
Set the bin width.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint32_t GetBinCount(uint32_t index)
Get the number of data added to the bin.
double GetBinStart(uint32_t index)
Returns the bin start, i.e., index*binWidth.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
void AddValue(double value)
Add a value to the histogram.
void SerializeToXmlStream(std::ostream &os, int indent, std::string elementName) const
Serializes the results to an std::ostream in XML format.