LEFT | RIGHT |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2012 University of Washington | 3 * Copyright (c) 2012 University of Washington |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 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 | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 namespace ns3 { | 33 namespace ns3 { |
34 | 34 |
35 NS_LOG_COMPONENT_DEFINE ("RandomVariableStreamHelper"); | 35 NS_LOG_COMPONENT_DEFINE ("RandomVariableStreamHelper"); |
36 | 36 |
37 int64_t RandomVariableStreamHelper::AssignStreams (std::string path, int64_t str
eam) | 37 int64_t RandomVariableStreamHelper::AssignStreams (std::string path, int64_t str
eam) |
38 { | 38 { |
39 NS_LOG_FUNCTION_NOARGS (); | 39 NS_LOG_FUNCTION_NOARGS (); |
40 NS_ASSERT (stream >= 0); | 40 NS_ASSERT (stream >= 0); |
41 Config::MatchContainer mc = Config::LookupMatches (path); | 41 Config::MatchContainer mc = Config::LookupMatches (path); |
42 int32_t i = 0; | 42 |
43 for (Config::MatchContainer::Iterator mci = mc.Begin (); mci != mc.End (); ++m
ci, ++i) | 43 std::size_t i = 0; |
| 44 for ( ; i < mc.GetN (); ++i) |
44 { | 45 { |
45 PointerValue ptr = mc.Get (i); | 46 PointerValue ptr = mc.Get (i); |
46 Ptr<RandomVariableStream> rvs = ptr.Get<RandomVariableStream> (); | 47 Ptr<RandomVariableStream> rvs = ptr.Get<RandomVariableStream> (); |
47 NS_LOG_DEBUG ("RandomVariableStream found: " << rvs << "; setting stream t
o " << (stream + i)); | 48 NS_LOG_DEBUG ("RandomVariableStream found: " << rvs << "; setting stream t
o " << (stream + i)); |
48 rvs->SetStream (stream + i); | 49 rvs->SetStream (stream + i); |
49 } | 50 } |
50 return i; | 51 return i; |
51 } | 52 } |
52 | 53 |
53 } // namespace ns3 | 54 } // namespace ns3 |
LEFT | RIGHT |