Alexander Afanasyev | 141d131 | 2011-12-18 14:58:35 -0800 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| 2 | /* |
| 3 | * Copyright (c) 2011 UCLA |
| 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: Alexander Afanasyev <alexander.afanasyev@ucla.edu> |
| 19 | */ |
| 20 | |
| 21 | #include "ccnx-trace-helper.h" |
| 22 | |
Alexander Afanasyev | 141d131 | 2011-12-18 14:58:35 -0800 | [diff] [blame] | 23 | #include "ns3/config.h" |
| 24 | #include "ns3/callback.h" |
| 25 | #include "ns3/ccnx-app.h" |
| 26 | #include "ns3/ccnx-face.h" |
| 27 | #include "ns3/packet.h" |
| 28 | #include "ns3/log.h" |
Alexander Afanasyev | c86c283 | 2011-12-23 02:56:22 -0800 | [diff] [blame] | 29 | #include "ns3/assert.h" |
Alexander Afanasyev | 141d131 | 2011-12-18 14:58:35 -0800 | [diff] [blame] | 30 | #include "ns3/node-list.h" |
| 31 | #include "ns3/object-vector.h" |
Alexander Afanasyev | c86c283 | 2011-12-23 02:56:22 -0800 | [diff] [blame] | 32 | #include "ns3/simulator.h" |
| 33 | #include "ns3/names.h" |
Alexander Afanasyev | 06b42ec | 2012-01-11 19:05:36 -0800 | [diff] [blame] | 34 | #include "ns3/tcp-l4-protocol.h" |
Alexander Afanasyev | e9c9d72 | 2012-01-19 16:59:30 -0800 | [diff] [blame] | 35 | #include "ns3/node.h" |
Alexander Afanasyev | c86c283 | 2011-12-23 02:56:22 -0800 | [diff] [blame] | 36 | |
| 37 | #include <boost/ref.hpp> |
| 38 | #include <boost/lexical_cast.hpp> |
Alexander Afanasyev | b3e4b85 | 2011-12-23 15:58:20 -0800 | [diff] [blame] | 39 | |
| 40 | #include "tracers/ccnx-aggregate-app-tracer.h" |
| 41 | #include "tracers/ccnx-aggregate-l3-tracer.h" |
| 42 | #include "tracers/ccnx-rate-l3-tracer.h" |
Alexander Afanasyev | 3183b5a | 2011-12-23 20:48:20 -0800 | [diff] [blame] | 43 | #include "tracers/ccnx-seqs-app-tracer.h" |
Alexander Afanasyev | 7e71c75 | 2012-01-25 21:40:39 -0800 | [diff] [blame] | 44 | #include "tracers/ipv4-rate-l3-tracer.h" |
Alexander Afanasyev | c4f8828 | 2012-01-03 11:27:20 -0800 | [diff] [blame] | 45 | #include "tracers/ipv4-seqs-app-tracer.h" |
Alexander Afanasyev | e4c2ece | 2012-01-11 10:44:40 -0800 | [diff] [blame] | 46 | #include "tracers/ccnx-consumer-window-tracer.h" |
Alexander Afanasyev | e9c9d72 | 2012-01-19 16:59:30 -0800 | [diff] [blame] | 47 | #include "tracers/ccnx-path-weight-tracer.h" |
Alexander Afanasyev | b3e4b85 | 2011-12-23 15:58:20 -0800 | [diff] [blame] | 48 | |
| 49 | #include "ns3/ccnx-interest-header.h" |
| 50 | #include "ns3/ccnx-content-object-header.h" |
Alexander Afanasyev | 141d131 | 2011-12-18 14:58:35 -0800 | [diff] [blame] | 51 | |
| 52 | #include <fstream> |
Alexander Afanasyev | 141d131 | 2011-12-18 14:58:35 -0800 | [diff] [blame] | 53 | |
| 54 | using namespace std; |
| 55 | using namespace boost; |
| 56 | |
| 57 | NS_LOG_COMPONENT_DEFINE ("CcnxTraceHelper"); |
| 58 | |
| 59 | namespace ns3 { |
Alexander Afanasyev | c86c283 | 2011-12-23 02:56:22 -0800 | [diff] [blame] | 60 | |
| 61 | CcnxTraceHelper::CcnxTraceHelper () |
| 62 | : m_l3RateTrace (0) |
Alexander Afanasyev | 3183b5a | 2011-12-23 20:48:20 -0800 | [diff] [blame] | 63 | , m_appSeqsTrace (0) |
Alexander Afanasyev | 42e131e | 2012-02-04 13:00:37 -0800 | [diff] [blame] | 64 | , m_ipv4RateTrace (0) |
Alexander Afanasyev | c4f8828 | 2012-01-03 11:27:20 -0800 | [diff] [blame] | 65 | , m_ipv4AppSeqsTrace (0) |
Alexander Afanasyev | e4c2ece | 2012-01-11 10:44:40 -0800 | [diff] [blame] | 66 | , m_windowsTrace (0) |
Alexander Afanasyev | 06b42ec | 2012-01-11 19:05:36 -0800 | [diff] [blame] | 67 | , m_windowsTcpTrace (0) |
Alexander Afanasyev | e9c9d72 | 2012-01-19 16:59:30 -0800 | [diff] [blame] | 68 | , m_pathWeightsTrace (0) |
Alexander Afanasyev | c86c283 | 2011-12-23 02:56:22 -0800 | [diff] [blame] | 69 | { |
| 70 | } |
| 71 | |
Alexander Afanasyev | 141d131 | 2011-12-18 14:58:35 -0800 | [diff] [blame] | 72 | CcnxTraceHelper::~CcnxTraceHelper () |
| 73 | { |
| 74 | NS_LOG_FUNCTION (this); |
Alexander Afanasyev | c86c283 | 2011-12-23 02:56:22 -0800 | [diff] [blame] | 75 | if (m_l3RateTrace != 0) delete m_l3RateTrace; |
Alexander Afanasyev | 3183b5a | 2011-12-23 20:48:20 -0800 | [diff] [blame] | 76 | if (m_appSeqsTrace != 0) delete m_appSeqsTrace; |
Alexander Afanasyev | c4f8828 | 2012-01-03 11:27:20 -0800 | [diff] [blame] | 77 | if (m_ipv4AppSeqsTrace != 0) delete m_ipv4AppSeqsTrace; |
Alexander Afanasyev | e4c2ece | 2012-01-11 10:44:40 -0800 | [diff] [blame] | 78 | if (m_windowsTrace != 0) delete m_windowsTrace; |
Alexander Afanasyev | 06b42ec | 2012-01-11 19:05:36 -0800 | [diff] [blame] | 79 | if (m_windowsTcpTrace != 0) delete m_windowsTcpTrace; |
Alexander Afanasyev | e9c9d72 | 2012-01-19 16:59:30 -0800 | [diff] [blame] | 80 | if (m_pathWeightsTrace != 0) delete m_pathWeightsTrace; |
Alexander Afanasyev | 7e71c75 | 2012-01-25 21:40:39 -0800 | [diff] [blame] | 81 | if (m_ipv4RateTrace != 0) delete m_ipv4RateTrace; |
Alexander Afanasyev | 141d131 | 2011-12-18 14:58:35 -0800 | [diff] [blame] | 82 | |
| 83 | if (m_apps.size () > 0) |
| 84 | { |
| 85 | ofstream of; |
| 86 | if (!m_appTrace.empty ()) |
| 87 | { |
| 88 | of.open (m_appTrace.c_str (), ios_base::trunc | ios_base::out); |
| 89 | of << "# "; |
| 90 | m_apps.front ()->PrintHeader (of); |
| 91 | of << "\n"; |
| 92 | } |
| 93 | |
Alexander Afanasyev | b3e4b85 | 2011-12-23 15:58:20 -0800 | [diff] [blame] | 94 | for (std::list<Ptr<CcnxAppTracer> >::iterator app = m_apps.begin (); |
Alexander Afanasyev | 141d131 | 2011-12-18 14:58:35 -0800 | [diff] [blame] | 95 | app != m_apps.end (); |
| 96 | app++) |
| 97 | { |
| 98 | if (!m_appTrace.empty ()) |
| 99 | { |
| 100 | (*app)->Print (of); |
| 101 | of << "\n"; |
| 102 | } |
| 103 | else |
| 104 | { |
| 105 | NS_LOG_INFO (*(*app)); |
| 106 | } |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | if (m_l3s.size () > 0) |
| 111 | { |
| 112 | ofstream of; |
| 113 | if (!m_l3Trace.empty ()) |
| 114 | { |
| 115 | of.open (m_l3Trace.c_str (), ios_base::trunc | ios_base::out); |
| 116 | of << "# "; |
| 117 | m_l3s.front ()->PrintHeader (of); |
| 118 | of << "\n"; |
| 119 | } |
| 120 | |
Alexander Afanasyev | b3e4b85 | 2011-12-23 15:58:20 -0800 | [diff] [blame] | 121 | for (std::list<Ptr<CcnxL3Tracer> >::iterator l3 = m_l3s.begin (); |
Alexander Afanasyev | 141d131 | 2011-12-18 14:58:35 -0800 | [diff] [blame] | 122 | l3 != m_l3s.end (); |
| 123 | l3++) |
| 124 | { |
| 125 | if (!m_l3Trace.empty ()) |
| 126 | { |
| 127 | (*l3)->Print (of); |
| 128 | of << "\n"; |
| 129 | } |
| 130 | else |
| 131 | { |
| 132 | NS_LOG_INFO (*(*l3)); |
| 133 | } |
| 134 | } |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | void |
| 139 | CcnxTraceHelper::SetAppTraceFile (const std::string &appTrace) |
| 140 | { |
| 141 | NS_LOG_FUNCTION (this << appTrace); |
| 142 | m_appTrace = appTrace; |
| 143 | } |
| 144 | |
| 145 | void |
| 146 | CcnxTraceHelper::SetL3TraceFile (const std::string &l3Trace) |
| 147 | { |
| 148 | NS_LOG_FUNCTION (this << l3Trace); |
| 149 | m_l3Trace = l3Trace; |
| 150 | } |
| 151 | |
| 152 | void |
| 153 | CcnxTraceHelper::EnableAggregateAppAll (const std::string &appName) |
| 154 | { |
| 155 | NS_LOG_FUNCTION (this << appName); |
| 156 | for (NodeList::Iterator node = NodeList::Begin (); |
| 157 | node != NodeList::End (); |
| 158 | node++) |
| 159 | { |
| 160 | ObjectVectorValue apps; |
| 161 | (*node)->GetAttribute ("ApplicationList", apps); |
| 162 | |
| 163 | NS_LOG_DEBUG ("Node: " << lexical_cast<string> ((*node)->GetId ())); |
| 164 | |
| 165 | uint32_t appId = 0; |
| 166 | for (ObjectVectorValue::Iterator app = apps.Begin (); |
| 167 | app != apps.End (); |
| 168 | app++, appId++) |
| 169 | { |
| 170 | NS_LOG_DEBUG ("App: " << lexical_cast<string> (appId) << ", typeId: " << (*app)->GetInstanceTypeId ().GetName ()); |
| 171 | if ((*app)->GetInstanceTypeId ().GetName () == appName) |
| 172 | { |
| 173 | m_apps.push_back (Create<CcnxAggregateAppTracer> (appName, |
Alexander Afanasyev | c86c283 | 2011-12-23 02:56:22 -0800 | [diff] [blame] | 174 | *node, |
Alexander Afanasyev | 141d131 | 2011-12-18 14:58:35 -0800 | [diff] [blame] | 175 | lexical_cast<string> (appId))); |
| 176 | } |
| 177 | } |
| 178 | } |
| 179 | } |
| 180 | |
| 181 | void |
| 182 | CcnxTraceHelper::EnableAggregateL3All () |
| 183 | { |
| 184 | NS_LOG_FUNCTION (this); |
| 185 | |
| 186 | for (NodeList::Iterator node = NodeList::Begin (); |
| 187 | node != NodeList::End (); |
| 188 | node++) |
| 189 | { |
| 190 | NS_LOG_DEBUG ("Node: " << lexical_cast<string> ((*node)->GetId ())); |
| 191 | |
Alexander Afanasyev | c86c283 | 2011-12-23 02:56:22 -0800 | [diff] [blame] | 192 | m_l3s.push_back (Create<CcnxAggregateL3Tracer> (*node)); |
Alexander Afanasyev | 141d131 | 2011-12-18 14:58:35 -0800 | [diff] [blame] | 193 | } |
| 194 | } |
| 195 | |
Alexander Afanasyev | c86c283 | 2011-12-23 02:56:22 -0800 | [diff] [blame] | 196 | void |
| 197 | CcnxTraceHelper::EnableRateL3All (const std::string &l3RateTrace) |
| 198 | { |
| 199 | NS_LOG_FUNCTION (this); |
| 200 | m_l3RateTrace = new ofstream (l3RateTrace.c_str (), ios::trunc); |
| 201 | |
| 202 | for (NodeList::Iterator node = NodeList::Begin (); |
| 203 | node != NodeList::End (); |
| 204 | node++) |
| 205 | { |
| 206 | NS_LOG_DEBUG ("Node: " << lexical_cast<string> ((*node)->GetId ())); |
| 207 | |
| 208 | Ptr<CcnxRateL3Tracer> trace = Create<CcnxRateL3Tracer> (boost::ref(*m_l3RateTrace), *node); |
Alexander Afanasyev | 7e71c75 | 2012-01-25 21:40:39 -0800 | [diff] [blame] | 209 | trace->SetAveragingPeriod (Seconds (0.2)); |
Alexander Afanasyev | c86c283 | 2011-12-23 02:56:22 -0800 | [diff] [blame] | 210 | m_l3Rates.push_back (trace); |
| 211 | } |
| 212 | |
| 213 | if (m_l3Rates.size () > 0) |
| 214 | { |
| 215 | // *m_l3RateTrace << "# "; // not necessary for R's read.table |
| 216 | m_l3Rates.front ()->PrintHeader (*m_l3RateTrace); |
| 217 | *m_l3RateTrace << "\n"; |
| 218 | } |
| 219 | } |
Alexander Afanasyev | 141d131 | 2011-12-18 14:58:35 -0800 | [diff] [blame] | 220 | |
Alexander Afanasyev | 3183b5a | 2011-12-23 20:48:20 -0800 | [diff] [blame] | 221 | void |
Alexander Afanasyev | 7e71c75 | 2012-01-25 21:40:39 -0800 | [diff] [blame] | 222 | CcnxTraceHelper::EnableIpv4RateL3All (const std::string &file) |
| 223 | { |
| 224 | NS_LOG_FUNCTION (this); |
| 225 | m_ipv4RateTrace = new ofstream (file.c_str (), ios::trunc); |
| 226 | |
| 227 | for (NodeList::Iterator node = NodeList::Begin (); |
| 228 | node != NodeList::End (); |
| 229 | node++) |
| 230 | { |
| 231 | NS_LOG_DEBUG ("Node: " << lexical_cast<string> ((*node)->GetId ())); |
| 232 | |
| 233 | Ptr<Ipv4RateL3Tracer> trace = Create<Ipv4RateL3Tracer> (boost::ref(*m_ipv4RateTrace), *node); |
| 234 | trace->SetAveragingPeriod (Seconds (0.2)); |
| 235 | m_ipv4Rates.push_back (trace); |
| 236 | } |
| 237 | |
| 238 | if (m_ipv4Rates.size () > 0) |
| 239 | { |
| 240 | // *m_ipv4RateTrace << "# "; // not necessary for R's read.table |
| 241 | m_ipv4Rates.front ()->PrintHeader (*m_ipv4RateTrace); |
| 242 | *m_ipv4RateTrace << "\n"; |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | |
| 247 | void |
Alexander Afanasyev | 3183b5a | 2011-12-23 20:48:20 -0800 | [diff] [blame] | 248 | CcnxTraceHelper::EnableSeqsAppAll (const std::string &appName, const std::string &trace) |
| 249 | { |
| 250 | NS_LOG_FUNCTION (this); |
| 251 | m_appSeqsTrace = new ofstream (trace.c_str (), ios::trunc); |
| 252 | |
| 253 | for (NodeList::Iterator node = NodeList::Begin (); |
| 254 | node != NodeList::End (); |
| 255 | node++) |
| 256 | { |
| 257 | ObjectVectorValue apps; |
| 258 | (*node)->GetAttribute ("ApplicationList", apps); |
| 259 | |
| 260 | NS_LOG_DEBUG ("Node: " << lexical_cast<string> ((*node)->GetId ())); |
| 261 | |
| 262 | uint32_t appId = 0; |
| 263 | for (ObjectVectorValue::Iterator app = apps.Begin (); |
| 264 | app != apps.End (); |
| 265 | app++, appId++) |
| 266 | { |
| 267 | NS_LOG_DEBUG ("App: " << lexical_cast<string> (appId) << ", typeId: " << (*app)->GetInstanceTypeId ().GetName ()); |
| 268 | if ((*app)->GetInstanceTypeId ().GetName () == appName) |
| 269 | { |
| 270 | Ptr<CcnxSeqsAppTracer> trace = Create<CcnxSeqsAppTracer> (boost::ref(*m_appSeqsTrace), |
| 271 | appName, |
| 272 | *node, |
| 273 | lexical_cast<string> (appId)); |
| 274 | m_appSeqs.push_back (trace); |
| 275 | } |
| 276 | } |
| 277 | |
| 278 | } |
| 279 | |
| 280 | if (m_appSeqs.size () > 0) |
| 281 | { |
| 282 | // *m_l3RateTrace << "# "; // not necessary for R's read.table |
| 283 | m_appSeqs.front ()->PrintHeader (*m_appSeqsTrace); |
| 284 | *m_appSeqsTrace << "\n"; |
| 285 | } |
| 286 | } |
| 287 | |
Alexander Afanasyev | c4f8828 | 2012-01-03 11:27:20 -0800 | [diff] [blame] | 288 | void |
| 289 | CcnxTraceHelper::EnableIpv4SeqsAppAll (const std::string &trace) |
| 290 | { |
| 291 | NS_LOG_FUNCTION (this); |
| 292 | m_ipv4AppSeqsTrace = new ofstream (trace.c_str (), ios::trunc); |
| 293 | |
| 294 | for (NodeList::Iterator node = NodeList::Begin (); |
| 295 | node != NodeList::End (); |
| 296 | node++) |
| 297 | { |
| 298 | ObjectVectorValue apps; |
| 299 | (*node)->GetAttribute ("ApplicationList", apps); |
| 300 | |
| 301 | NS_LOG_DEBUG ("Node: " << lexical_cast<string> ((*node)->GetId ())); |
| 302 | |
| 303 | uint32_t appId = 0; |
| 304 | for (ObjectVectorValue::Iterator app = apps.Begin (); |
| 305 | app != apps.End (); |
| 306 | app++, appId++) |
| 307 | { |
| 308 | NS_LOG_DEBUG ("App: " << lexical_cast<string> (appId) << ", typeId: " << (*app)->GetInstanceTypeId ().GetName ()); |
| 309 | if ((*app)->GetInstanceTypeId ().GetName () == "ns3::PacketSink" || |
| 310 | (*app)->GetInstanceTypeId ().GetName () == "ns3::BulkSendApplication") |
| 311 | { |
| 312 | Ptr<Ipv4SeqsAppTracer> trace = Create<Ipv4SeqsAppTracer> (boost::ref(*m_ipv4AppSeqsTrace), |
| 313 | *node, |
| 314 | lexical_cast<string> (appId)); |
| 315 | m_ipv4AppSeqs.push_back (trace); |
| 316 | } |
| 317 | } |
| 318 | |
| 319 | } |
| 320 | |
| 321 | if (m_ipv4AppSeqs.size () > 0) |
| 322 | { |
| 323 | m_ipv4AppSeqs.front ()->PrintHeader (*m_ipv4AppSeqsTrace); |
| 324 | *m_ipv4AppSeqsTrace << "\n"; |
| 325 | } |
| 326 | } |
| 327 | |
Alexander Afanasyev | e4c2ece | 2012-01-11 10:44:40 -0800 | [diff] [blame] | 328 | void |
| 329 | CcnxTraceHelper::EnableWindowsAll (const std::string &windowTrace) |
| 330 | { |
| 331 | NS_LOG_FUNCTION (this); |
| 332 | m_windowsTrace = new ofstream (windowTrace.c_str (), ios::trunc); |
| 333 | |
| 334 | for (NodeList::Iterator node = NodeList::Begin (); |
| 335 | node != NodeList::End (); |
| 336 | node++) |
| 337 | { |
| 338 | ObjectVectorValue apps; |
| 339 | (*node)->GetAttribute ("ApplicationList", apps); |
| 340 | |
| 341 | NS_LOG_DEBUG ("Node: " << lexical_cast<string> ((*node)->GetId ())); |
| 342 | |
| 343 | uint32_t appId = 0; |
| 344 | for (ObjectVectorValue::Iterator app = apps.Begin (); |
| 345 | app != apps.End (); |
| 346 | app++, appId++) |
| 347 | { |
| 348 | if ((*app)->GetInstanceTypeId ().GetName () == "ns3::CcnxConsumerWindow") |
| 349 | { |
| 350 | Ptr<CcnxConsumerWindowTracer> trace = Create<CcnxConsumerWindowTracer> (boost::ref(*m_windowsTrace), |
| 351 | *node, |
| 352 | lexical_cast<string> (appId)); |
| 353 | m_windows.push_back (trace); |
| 354 | } |
| 355 | } |
| 356 | |
| 357 | } |
| 358 | |
| 359 | if (m_windows.size () > 0) |
| 360 | { |
| 361 | m_windows.front ()->PrintHeader (*m_windowsTrace); |
| 362 | *m_windowsTrace << "\n"; |
| 363 | } |
| 364 | } |
| 365 | |
Alexander Afanasyev | 06b42ec | 2012-01-11 19:05:36 -0800 | [diff] [blame] | 366 | void |
| 367 | CcnxTraceHelper::TcpConnect (Ptr<Node> node) |
| 368 | { |
| 369 | ObjectVectorValue sockets; |
| 370 | node->GetObject<TcpL4Protocol> ()->GetAttribute ("SocketList", sockets); |
| 371 | |
| 372 | uint32_t sockId = 0; |
| 373 | for (ObjectVectorValue::Iterator socket = sockets.Begin (); |
| 374 | socket != sockets.End (); |
| 375 | socket++, sockId++) |
| 376 | { |
| 377 | // std::cout << "Node: " << node->GetId () << ", Socket " << sockId << "\n"; |
| 378 | |
| 379 | Ptr<TcpCongestionWindowTracer> trace = Create<TcpCongestionWindowTracer> (boost::ref(*m_windowsTcpTrace), |
| 380 | node, |
| 381 | lexical_cast<string> (sockId)); |
| 382 | m_windowsTcp.push_back (trace); |
| 383 | } |
| 384 | } |
| 385 | |
| 386 | void |
| 387 | CcnxTraceHelper::EnableWindowsTcpAll (const std::string &windowTrace) |
| 388 | { |
| 389 | NS_LOG_FUNCTION (this); |
| 390 | m_windowsTcpTrace = new ofstream (windowTrace.c_str (), ios::trunc); |
| 391 | |
| 392 | WindowTracer::PrintHeader (*m_windowsTcpTrace); |
| 393 | *m_windowsTcpTrace << "\n"; |
| 394 | } |
Alexander Afanasyev | 3183b5a | 2011-12-23 20:48:20 -0800 | [diff] [blame] | 395 | |
Alexander Afanasyev | e9c9d72 | 2012-01-19 16:59:30 -0800 | [diff] [blame] | 396 | void |
| 397 | CcnxTraceHelper::EnablePathWeights (const std::string &pathWeights) |
| 398 | { |
| 399 | NS_LOG_FUNCTION (this); |
| 400 | m_pathWeightsTrace = new ofstream (pathWeights.c_str (), ios::trunc); |
| 401 | |
Alexander Afanasyev | 6bff0df | 2012-01-19 17:51:52 -0800 | [diff] [blame] | 402 | CcnxPathWeightTracer::PrintHeader (*m_pathWeightsTrace); |
Alexander Afanasyev | e9c9d72 | 2012-01-19 16:59:30 -0800 | [diff] [blame] | 403 | *m_pathWeightsTrace << "\n"; |
Alexander Afanasyev | e9c9d72 | 2012-01-19 16:59:30 -0800 | [diff] [blame] | 404 | |
Alexander Afanasyev | 8e0d281 | 2012-01-19 22:38:14 -0800 | [diff] [blame] | 405 | for (NodeList::Iterator node = NodeList::Begin (); |
| 406 | node != NodeList::End (); |
| 407 | node++) |
Alexander Afanasyev | e9c9d72 | 2012-01-19 16:59:30 -0800 | [diff] [blame] | 408 | { |
Alexander Afanasyev | 8e0d281 | 2012-01-19 22:38:14 -0800 | [diff] [blame] | 409 | Ptr<CcnxPathWeightTracer> trace = Create<CcnxPathWeightTracer> (boost::ref(*m_pathWeightsTrace), |
| 410 | *node); |
| 411 | m_pathWeights.push_back (trace); |
Alexander Afanasyev | e9c9d72 | 2012-01-19 16:59:30 -0800 | [diff] [blame] | 412 | } |
Alexander Afanasyev | e9c9d72 | 2012-01-19 16:59:30 -0800 | [diff] [blame] | 413 | } |
| 414 | |
Alexander Afanasyev | 141d131 | 2011-12-18 14:58:35 -0800 | [diff] [blame] | 415 | } // namespace ns3 |