24 #include "ns3/simulator.h"
27 #define DEFAULT_BIN_WIDTH 1
82 uint32_t index = (uint32_t)std::floor (value/
m_binWidth);
107 os << std::string (
indent,
' ' ) <<
"<" << elementName
113 for (uint32_t index = 0; index <
m_histogram.size (); index++)
117 os << std::string (
indent,
' ' );
119 <<
" index=\"" << (index) <<
"\""
127 os << std::string (
indent+2,
' ' );
128 for (uint32_t index = 0; index <
m_histogram.size (); index++)
139 os << std::string (
indent,
' ' ) <<
"</" << elementName <<
">\n";
uint32_t GetBinCount(uint32_t index)
Get the number of data added to the bin.
double GetBinWidth(uint32_t index) const
Returns the bin width.
std::vector< uint32_t > m_histogram
Histogram data.
void SetDefaultBinWidth(double binWidth)
Set the bin width.
double m_binWidth
Bin width.
uint32_t GetNBins() const
Returns the number of bins in the histogram.
void SerializeToXmlStream(std::ostream &os, uint16_t indent, std::string elementName) const
Serializes the results to an std::ostream in XML format.
void AddValue(double value)
Add a value to the histogram.
double GetBinStart(uint32_t index)
Returns the bin start, i.e., index*binWidth.
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,...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define DEFAULT_BIN_WIDTH
def indent(source, debug, level)
Every class exported by the ns3 library is enclosed in the ns3 namespace.