A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
histogram.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
//
3
// Copyright (c) 2009 INESC Porto
4
//
5
// This program is free software; you can redistribute it and/or modify
6
// it under the terms of the GNU General Public License version 2 as
7
// published by the Free Software Foundation;
8
//
9
// This program is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
// GNU General Public License for more details.
13
//
14
// You should have received a copy of the GNU General Public License
15
// along with this program; if not, write to the Free Software
16
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
//
18
// Author: Pedro Fortuna <pedro.fortuna@inescporto.pt> <pedro.fortuna@gmail.com>
19
//
20
21
#ifndef NS3_HISTOGRAM_H
22
#define NS3_HISTOGRAM_H
23
24
#include <vector>
25
#include <stdint.h>
26
#include <ostream>
27
28
namespace
ns3 {
29
45
class
Histogram
46
{
47
public
:
48
49
// --- basic methods ---
54
Histogram
(
double
binWidth);
55
Histogram
();
56
57
// Methods for Getting the Histogram Results
62
uint32_t
GetNBins
()
const
;
68
double
GetBinStart
(uint32_t index);
74
double
GetBinEnd
(uint32_t index);
83
double
GetBinWidth
(uint32_t index)
const
;
91
void
SetDefaultBinWidth
(
double
binWidth);
97
uint32_t
GetBinCount
(uint32_t index);
98
99
// Method for adding values
104
void
AddValue
(
double
value);
105
112
void
SerializeToXmlStream
(std::ostream &os,
int
indent
, std::string elementName)
const
;
113
114
115
private
:
116
std::vector<uint32_t>
m_histogram
;
117
double
m_binWidth
;
118
};
119
120
121
}
// namespace ns3
122
123
#endif
/* NS3_HISTOGRAM_H */
ns3::Histogram::GetBinEnd
double GetBinEnd(uint32_t index)
Returns the bin end, i.e., (index+1)*binWidth.
Definition:
histogram.cc:55
ns3::Histogram::GetBinWidth
double GetBinWidth(uint32_t index) const
Returns the bin width.
Definition:
histogram.cc:61
ns3::Histogram::m_histogram
std::vector< uint32_t > m_histogram
Histogram data.
Definition:
histogram.h:116
ns3::Histogram::m_binWidth
double m_binWidth
Bin width.
Definition:
histogram.h:117
check-style.indent
def indent
Definition:
check-style.py:286
ns3::Histogram::GetNBins
uint32_t GetNBins() const
Returns the number of bins in the histogram.
Definition:
histogram.cc:43
ns3::Histogram::SetDefaultBinWidth
void SetDefaultBinWidth(double binWidth)
Set the bin width.
Definition:
histogram.cc:67
ns3::Histogram::GetBinCount
uint32_t GetBinCount(uint32_t index)
Get the number of data added to the bin.
Definition:
histogram.cc:74
ns3::Histogram::GetBinStart
double GetBinStart(uint32_t index)
Returns the bin start, i.e., index*binWidth.
Definition:
histogram.cc:49
ns3::Histogram::Histogram
Histogram()
Definition:
histogram.cc:100
ns3::Histogram::AddValue
void AddValue(double value)
Add a value to the histogram.
Definition:
histogram.cc:81
ns3::Histogram
Class used to store data and make an histogram of the data frequency.
Definition:
histogram.h:45
ns3::Histogram::SerializeToXmlStream
void SerializeToXmlStream(std::ostream &os, int indent, std::string elementName) const
Serializes the results to an std::ostream in XML format.
Definition:
histogram.cc:107
src
flow-monitor
model
histogram.h
Generated on Sat Apr 19 2014 14:06:55 for ns-3 by
1.8.6