author | Peter D. Barnes, Jr. <barnes26@llnl.gov> |
Fri, 26 Sep 2014 15:51:00 -0700 | |
changeset 10968 | 2d29fee2b7b8 |
parent 10627 | 7423d0b3ce9a |
child 11432 | d2656819dd54 |
permissions | -rw-r--r-- |
3570 | 1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 |
/* |
|
3 |
* Copyright (c) 2008 Drexel University |
|
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: Joe Kopena (tjkopena@cs.drexel.edu) |
|
19 |
*/ |
|
20 |
||
21 |
#include <fstream> |
|
5502
04acce3f7133
Bug #645: fixes for opening stats file with OMNeT++
Andras Varga <andras@omnetpp.org>
parents:
4581
diff
changeset
|
22 |
#include <cstdlib> |
3570 | 23 |
|
24 |
#include "ns3/log.h" |
|
25 |
#include "ns3/nstime.h" |
|
26 |
||
27 |
#include "data-collector.h" |
|
28 |
#include "data-calculator.h" |
|
29 |
#include "omnet-data-output.h" |
|
30 |
||
31 |
using namespace ns3; |
|
32 |
||
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
33 |
NS_LOG_COMPONENT_DEFINE ("OmnetDataOutput"); |
3570 | 34 |
|
35 |
//-------------------------------------------------------------- |
|
36 |
//---------------------------------------------- |
|
4581 | 37 |
OmnetDataOutput::OmnetDataOutput() |
3570 | 38 |
{ |
10627
7423d0b3ce9a
Clean up function logging for non-DCF part of stats module
Vedran Miletić <rivanvx@gmail.com>
parents:
9870
diff
changeset
|
39 |
NS_LOG_FUNCTION (this); |
4581 | 40 |
|
10627
7423d0b3ce9a
Clean up function logging for non-DCF part of stats module
Vedran Miletić <rivanvx@gmail.com>
parents:
9870
diff
changeset
|
41 |
m_filePrefix = "data"; |
3570 | 42 |
} |
43 |
OmnetDataOutput::~OmnetDataOutput() |
|
44 |
{ |
|
10627
7423d0b3ce9a
Clean up function logging for non-DCF part of stats module
Vedran Miletić <rivanvx@gmail.com>
parents:
9870
diff
changeset
|
45 |
NS_LOG_FUNCTION (this); |
3570 | 46 |
} |
47 |
void |
|
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
48 |
OmnetDataOutput::DoDispose () |
3570 | 49 |
{ |
10627
7423d0b3ce9a
Clean up function logging for non-DCF part of stats module
Vedran Miletić <rivanvx@gmail.com>
parents:
9870
diff
changeset
|
50 |
NS_LOG_FUNCTION (this); |
3570 | 51 |
|
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
52 |
DataOutputInterface::DoDispose (); |
3570 | 53 |
// end OmnetDataOutput::DoDispose |
54 |
} |
|
55 |
||
56 |
//---------------------------------------------- |
|
5502
04acce3f7133
Bug #645: fixes for opening stats file with OMNeT++
Andras Varga <andras@omnetpp.org>
parents:
4581
diff
changeset
|
57 |
|
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
58 |
inline bool isNumeric (const std::string& s) { |
7200
4e1d562d5029
Bug 1103 - Useless assignment in omnet-data-output.cc
Mitch Watrous <watrous@u.washington.edu>
parents:
7189
diff
changeset
|
59 |
bool decimalPtSeen = false; |
4e1d562d5029
Bug 1103 - Useless assignment in omnet-data-output.cc
Mitch Watrous <watrous@u.washington.edu>
parents:
7189
diff
changeset
|
60 |
bool exponentSeen = false; |
4e1d562d5029
Bug 1103 - Useless assignment in omnet-data-output.cc
Mitch Watrous <watrous@u.washington.edu>
parents:
7189
diff
changeset
|
61 |
char last = '\0'; |
4e1d562d5029
Bug 1103 - Useless assignment in omnet-data-output.cc
Mitch Watrous <watrous@u.washington.edu>
parents:
7189
diff
changeset
|
62 |
|
4e1d562d5029
Bug 1103 - Useless assignment in omnet-data-output.cc
Mitch Watrous <watrous@u.washington.edu>
parents:
7189
diff
changeset
|
63 |
for (std::string::const_iterator it = s.begin (); it != s.end (); it++) |
4e1d562d5029
Bug 1103 - Useless assignment in omnet-data-output.cc
Mitch Watrous <watrous@u.washington.edu>
parents:
7189
diff
changeset
|
64 |
{ |
4e1d562d5029
Bug 1103 - Useless assignment in omnet-data-output.cc
Mitch Watrous <watrous@u.washington.edu>
parents:
7189
diff
changeset
|
65 |
if ((*it == '.') && (decimalPtSeen)) |
4e1d562d5029
Bug 1103 - Useless assignment in omnet-data-output.cc
Mitch Watrous <watrous@u.washington.edu>
parents:
7189
diff
changeset
|
66 |
return false; |
4e1d562d5029
Bug 1103 - Useless assignment in omnet-data-output.cc
Mitch Watrous <watrous@u.washington.edu>
parents:
7189
diff
changeset
|
67 |
else if (*it == '.') |
4e1d562d5029
Bug 1103 - Useless assignment in omnet-data-output.cc
Mitch Watrous <watrous@u.washington.edu>
parents:
7189
diff
changeset
|
68 |
decimalPtSeen = true; |
4e1d562d5029
Bug 1103 - Useless assignment in omnet-data-output.cc
Mitch Watrous <watrous@u.washington.edu>
parents:
7189
diff
changeset
|
69 |
else if ((*it == 'e') && exponentSeen) |
4e1d562d5029
Bug 1103 - Useless assignment in omnet-data-output.cc
Mitch Watrous <watrous@u.washington.edu>
parents:
7189
diff
changeset
|
70 |
return false; |
4e1d562d5029
Bug 1103 - Useless assignment in omnet-data-output.cc
Mitch Watrous <watrous@u.washington.edu>
parents:
7189
diff
changeset
|
71 |
else if (*it == 'e') |
4e1d562d5029
Bug 1103 - Useless assignment in omnet-data-output.cc
Mitch Watrous <watrous@u.washington.edu>
parents:
7189
diff
changeset
|
72 |
{ |
4e1d562d5029
Bug 1103 - Useless assignment in omnet-data-output.cc
Mitch Watrous <watrous@u.washington.edu>
parents:
7189
diff
changeset
|
73 |
exponentSeen = true; |
4e1d562d5029
Bug 1103 - Useless assignment in omnet-data-output.cc
Mitch Watrous <watrous@u.washington.edu>
parents:
7189
diff
changeset
|
74 |
decimalPtSeen = false; |
4e1d562d5029
Bug 1103 - Useless assignment in omnet-data-output.cc
Mitch Watrous <watrous@u.washington.edu>
parents:
7189
diff
changeset
|
75 |
} |
4e1d562d5029
Bug 1103 - Useless assignment in omnet-data-output.cc
Mitch Watrous <watrous@u.washington.edu>
parents:
7189
diff
changeset
|
76 |
else if (*it == '-' && it != s.begin () && last != 'e') |
4e1d562d5029
Bug 1103 - Useless assignment in omnet-data-output.cc
Mitch Watrous <watrous@u.washington.edu>
parents:
7189
diff
changeset
|
77 |
return false; |
4e1d562d5029
Bug 1103 - Useless assignment in omnet-data-output.cc
Mitch Watrous <watrous@u.washington.edu>
parents:
7189
diff
changeset
|
78 |
|
4e1d562d5029
Bug 1103 - Useless assignment in omnet-data-output.cc
Mitch Watrous <watrous@u.washington.edu>
parents:
7189
diff
changeset
|
79 |
last = *it; |
4e1d562d5029
Bug 1103 - Useless assignment in omnet-data-output.cc
Mitch Watrous <watrous@u.washington.edu>
parents:
7189
diff
changeset
|
80 |
} |
4e1d562d5029
Bug 1103 - Useless assignment in omnet-data-output.cc
Mitch Watrous <watrous@u.washington.edu>
parents:
7189
diff
changeset
|
81 |
return true; |
5502
04acce3f7133
Bug #645: fixes for opening stats file with OMNeT++
Andras Varga <andras@omnetpp.org>
parents:
4581
diff
changeset
|
82 |
} |
04acce3f7133
Bug #645: fixes for opening stats file with OMNeT++
Andras Varga <andras@omnetpp.org>
parents:
4581
diff
changeset
|
83 |
|
3570 | 84 |
void |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
85 |
OmnetDataOutput::Output (DataCollector &dc) |
3570 | 86 |
{ |
10627
7423d0b3ce9a
Clean up function logging for non-DCF part of stats module
Vedran Miletić <rivanvx@gmail.com>
parents:
9870
diff
changeset
|
87 |
NS_LOG_FUNCTION (this << &dc); |
3570 | 88 |
|
89 |
std::ofstream scalarFile; |
|
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
90 |
std::string fn = m_filePrefix +"-"+dc.GetRunLabel ()+ ".sca"; |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
91 |
scalarFile.open (fn.c_str (), std::ios_base::out); |
3570 | 92 |
|
9870
6543f3876ff5
[Doxygen] use \todo
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7256
diff
changeset
|
93 |
/// \todo add timestamp to the runlevel |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
94 |
scalarFile << "run " << dc.GetRunLabel () << std::endl; |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
95 |
scalarFile << "attr experiment \"" << dc.GetExperimentLabel () |
7189
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
96 |
<< "\"" << std::endl; |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
97 |
scalarFile << "attr strategy \"" << dc.GetStrategyLabel () |
7189
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
98 |
<< "\"" << std::endl; |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
99 |
scalarFile << "attr measurement \"" << dc.GetInputLabel () |
7189
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
100 |
<< "\"" << std::endl; |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
101 |
scalarFile << "attr description \"" << dc.GetDescription () |
7189
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
102 |
<< "\"" << std::endl; |
3570 | 103 |
|
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
104 |
for (MetadataList::iterator i = dc.MetadataBegin (); |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
105 |
i != dc.MetadataEnd (); i++) { |
7189
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
106 |
std::pair<std::string, std::string> blob = (*i); |
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
107 |
scalarFile << "attr \"" << blob.first << "\" \"" << blob.second << "\"" |
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
108 |
<< std::endl; |
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
109 |
} |
3570 | 110 |
|
111 |
scalarFile << std::endl; |
|
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
112 |
if (isNumeric (dc.GetInputLabel ())) { |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
113 |
scalarFile << "scalar . measurement \"" << dc.GetInputLabel () |
7189
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
114 |
<< "\"" << std::endl; |
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
115 |
} |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
116 |
for (MetadataList::iterator i = dc.MetadataBegin (); |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
117 |
i != dc.MetadataEnd (); i++) { |
7189
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
118 |
std::pair<std::string, std::string> blob = (*i); |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
119 |
if (isNumeric (blob.second)) { |
7189
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
120 |
scalarFile << "scalar . \"" << blob.first << "\" \"" << blob.second << "\"" |
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
121 |
<< std::endl; |
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
122 |
} |
5502
04acce3f7133
Bug #645: fixes for opening stats file with OMNeT++
Andras Varga <andras@omnetpp.org>
parents:
4581
diff
changeset
|
123 |
} |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
124 |
OmnetOutputCallback callback (&scalarFile); |
3570 | 125 |
|
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
126 |
for (DataCalculatorList::iterator i = dc.DataCalculatorBegin (); |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
127 |
i != dc.DataCalculatorEnd (); i++) { |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
128 |
(*i)->Output (callback); |
7189
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
129 |
} |
3570 | 130 |
|
131 |
scalarFile << std::endl << std::endl; |
|
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
132 |
scalarFile.close (); |
3570 | 133 |
|
134 |
// end OmnetDataOutput::Output |
|
135 |
} |
|
136 |
||
5502
04acce3f7133
Bug #645: fixes for opening stats file with OMNeT++
Andras Varga <andras@omnetpp.org>
parents:
4581
diff
changeset
|
137 |
|
3570 | 138 |
OmnetDataOutput::OmnetOutputCallback::OmnetOutputCallback |
7252
c8200621e252
rerun check-style.py with uncrustify-0.58
Tom Henderson <tomh@tomh.org>
parents:
7200
diff
changeset
|
139 |
(std::ostream *scalar) : |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
140 |
m_scalar (scalar) |
3570 | 141 |
{ |
10627
7423d0b3ce9a
Clean up function logging for non-DCF part of stats module
Vedran Miletić <rivanvx@gmail.com>
parents:
9870
diff
changeset
|
142 |
NS_LOG_FUNCTION (this << scalar); |
3570 | 143 |
} |
144 |
||
145 |
void |
|
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
146 |
OmnetDataOutput::OmnetOutputCallback::OutputStatistic (std::string context, |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
147 |
std::string name, |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
148 |
const StatisticalSummary *statSum) |
5502
04acce3f7133
Bug #645: fixes for opening stats file with OMNeT++
Andras Varga <andras@omnetpp.org>
parents:
4581
diff
changeset
|
149 |
{ |
10627
7423d0b3ce9a
Clean up function logging for non-DCF part of stats module
Vedran Miletić <rivanvx@gmail.com>
parents:
9870
diff
changeset
|
150 |
NS_LOG_FUNCTION (this << context << name << statSum); |
7423d0b3ce9a
Clean up function logging for non-DCF part of stats module
Vedran Miletić <rivanvx@gmail.com>
parents:
9870
diff
changeset
|
151 |
|
7189
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
152 |
if (context == "") |
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
153 |
context = "."; |
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
154 |
if (name == "") |
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
155 |
name = "\"\""; |
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
156 |
(*m_scalar) << "statistic " << context << " " << name << std::endl; |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
157 |
if (!isNaN (statSum->getCount ())) |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
158 |
(*m_scalar) << "field count " << statSum->getCount () << std::endl; |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
159 |
if (!isNaN (statSum->getSum ())) |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
160 |
(*m_scalar) << "field sum " << statSum->getSum () << std::endl; |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
161 |
if (!isNaN (statSum->getMean ())) |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
162 |
(*m_scalar) << "field mean " << statSum->getMean () << std::endl; |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
163 |
if (!isNaN (statSum->getMin ())) |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
164 |
(*m_scalar) << "field min " << statSum->getMin () << std::endl; |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
165 |
if (!isNaN (statSum->getMax ())) |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
166 |
(*m_scalar) << "field max " << statSum->getMax () << std::endl; |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
167 |
if (!isNaN (statSum->getSqrSum ())) |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
168 |
(*m_scalar) << "field sqrsum " << statSum->getSqrSum () << std::endl; |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
169 |
if (!isNaN (statSum->getStddev ())) |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
170 |
(*m_scalar) << "field stddev " << statSum->getStddev () << std::endl; |
5502
04acce3f7133
Bug #645: fixes for opening stats file with OMNeT++
Andras Varga <andras@omnetpp.org>
parents:
4581
diff
changeset
|
171 |
} |
04acce3f7133
Bug #645: fixes for opening stats file with OMNeT++
Andras Varga <andras@omnetpp.org>
parents:
4581
diff
changeset
|
172 |
|
04acce3f7133
Bug #645: fixes for opening stats file with OMNeT++
Andras Varga <andras@omnetpp.org>
parents:
4581
diff
changeset
|
173 |
void |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
174 |
OmnetDataOutput::OmnetOutputCallback::OutputSingleton (std::string context, |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
175 |
std::string name, |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
176 |
int val) |
3570 | 177 |
{ |
10627
7423d0b3ce9a
Clean up function logging for non-DCF part of stats module
Vedran Miletić <rivanvx@gmail.com>
parents:
9870
diff
changeset
|
178 |
NS_LOG_FUNCTION (this << context << name << val); |
7423d0b3ce9a
Clean up function logging for non-DCF part of stats module
Vedran Miletić <rivanvx@gmail.com>
parents:
9870
diff
changeset
|
179 |
|
7189
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
180 |
if (context == "") |
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
181 |
context = "."; |
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
182 |
if (name == "") |
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
183 |
name = "\"\""; |
5502
04acce3f7133
Bug #645: fixes for opening stats file with OMNeT++
Andras Varga <andras@omnetpp.org>
parents:
4581
diff
changeset
|
184 |
(*m_scalar) << "scalar " << context << " " << name << " " << val << std::endl; |
3570 | 185 |
// end OmnetDataOutput::OmnetOutputCallback::OutputSingleton |
186 |
} |
|
5502
04acce3f7133
Bug #645: fixes for opening stats file with OMNeT++
Andras Varga <andras@omnetpp.org>
parents:
4581
diff
changeset
|
187 |
|
3570 | 188 |
void |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
189 |
OmnetDataOutput::OmnetOutputCallback::OutputSingleton (std::string context, |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
190 |
std::string name, |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
191 |
uint32_t val) |
3570 | 192 |
{ |
10627
7423d0b3ce9a
Clean up function logging for non-DCF part of stats module
Vedran Miletić <rivanvx@gmail.com>
parents:
9870
diff
changeset
|
193 |
NS_LOG_FUNCTION (this << context << name << val); |
7423d0b3ce9a
Clean up function logging for non-DCF part of stats module
Vedran Miletić <rivanvx@gmail.com>
parents:
9870
diff
changeset
|
194 |
|
7189
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
195 |
if (context == "") |
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
196 |
context = "."; |
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
197 |
if (name == "") |
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
198 |
name = "\"\""; |
5502
04acce3f7133
Bug #645: fixes for opening stats file with OMNeT++
Andras Varga <andras@omnetpp.org>
parents:
4581
diff
changeset
|
199 |
(*m_scalar) << "scalar " << context << " " << name << " " << val << std::endl; |
3570 | 200 |
// end OmnetDataOutput::OmnetOutputCallback::OutputSingleton |
201 |
} |
|
5502
04acce3f7133
Bug #645: fixes for opening stats file with OMNeT++
Andras Varga <andras@omnetpp.org>
parents:
4581
diff
changeset
|
202 |
|
3570 | 203 |
void |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
204 |
OmnetDataOutput::OmnetOutputCallback::OutputSingleton (std::string context, |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
205 |
std::string name, |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
206 |
double val) |
3570 | 207 |
{ |
10627
7423d0b3ce9a
Clean up function logging for non-DCF part of stats module
Vedran Miletić <rivanvx@gmail.com>
parents:
9870
diff
changeset
|
208 |
NS_LOG_FUNCTION (this << context << name << val); |
7423d0b3ce9a
Clean up function logging for non-DCF part of stats module
Vedran Miletić <rivanvx@gmail.com>
parents:
9870
diff
changeset
|
209 |
|
7189
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
210 |
if (context == "") |
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
211 |
context = "."; |
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
212 |
if (name == "") |
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
213 |
name = "\"\""; |
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
214 |
(*m_scalar) << "scalar " << context << " " << name << " " << val << std::endl; |
3570 | 215 |
// end OmnetDataOutput::OmnetOutputCallback::OutputSingleton |
216 |
} |
|
5502
04acce3f7133
Bug #645: fixes for opening stats file with OMNeT++
Andras Varga <andras@omnetpp.org>
parents:
4581
diff
changeset
|
217 |
|
3570 | 218 |
void |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
219 |
OmnetDataOutput::OmnetOutputCallback::OutputSingleton (std::string context, |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
220 |
std::string name, |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
221 |
std::string val) |
3570 | 222 |
{ |
10627
7423d0b3ce9a
Clean up function logging for non-DCF part of stats module
Vedran Miletić <rivanvx@gmail.com>
parents:
9870
diff
changeset
|
223 |
NS_LOG_FUNCTION (this << context << name << val); |
7423d0b3ce9a
Clean up function logging for non-DCF part of stats module
Vedran Miletić <rivanvx@gmail.com>
parents:
9870
diff
changeset
|
224 |
|
7189
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
225 |
if (context == "") |
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
226 |
context = "."; |
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
227 |
if (name == "") |
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
228 |
name = "\"\""; |
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
229 |
(*m_scalar) << "scalar " << context << " " << name << " " << val << std::endl; |
3570 | 230 |
// end OmnetDataOutput::OmnetOutputCallback::OutputSingleton |
231 |
} |
|
5502
04acce3f7133
Bug #645: fixes for opening stats file with OMNeT++
Andras Varga <andras@omnetpp.org>
parents:
4581
diff
changeset
|
232 |
|
3570 | 233 |
void |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
234 |
OmnetDataOutput::OmnetOutputCallback::OutputSingleton (std::string context, |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
235 |
std::string name, |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
236 |
Time val) |
3570 | 237 |
{ |
10627
7423d0b3ce9a
Clean up function logging for non-DCF part of stats module
Vedran Miletić <rivanvx@gmail.com>
parents:
9870
diff
changeset
|
238 |
NS_LOG_FUNCTION (this << context << name << val); |
7423d0b3ce9a
Clean up function logging for non-DCF part of stats module
Vedran Miletić <rivanvx@gmail.com>
parents:
9870
diff
changeset
|
239 |
|
7189
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
240 |
if (context == "") |
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
241 |
context = "."; |
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
242 |
if (name == "") |
a3a61f7d66ef
stats coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6855
diff
changeset
|
243 |
name = "\"\""; |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7252
diff
changeset
|
244 |
(*m_scalar) << "scalar " << context << " " << name << " " << val.GetTimeStep () << std::endl; |
3570 | 245 |
// end OmnetDataOutput::OmnetOutputCallback::OutputSingleton |
246 |
} |