--- a/src/wifi/model/random-stream.h Tue Aug 14 13:12:00 2012 -0700
+++ b/src/wifi/model/random-stream.h Tue Aug 14 13:52:17 2012 -0700
@@ -22,7 +22,7 @@
#include <stdint.h>
#include <list>
-#include "ns3/random-variable.h"
+#include "ns3/random-variable-stream.h"
namespace ns3 {
@@ -35,6 +35,16 @@
public:
virtual ~RandomStream ();
virtual uint32_t GetNext (uint32_t min, uint32_t max) = 0;
+
+ /**
+ * Assign a fixed random variable stream number to the random variables
+ * used by this model. Return the number of streams (possibly zero) that
+ * have been assigned.
+ *
+ * \param stream first stream index to use
+ * \return the number of stream indices assigned by this model
+ */
+ virtual int64_t AssignStreams (int64_t stream) = 0;
};
class RealRandomStream : public RandomStream
@@ -42,8 +52,20 @@
public:
RealRandomStream ();
virtual uint32_t GetNext (uint32_t min, uint32_t max);
+
+ /**
+ * Assign a fixed random variable stream number to the random variables
+ * used by this model. Return the number of streams (possibly zero) that
+ * have been assigned.
+ *
+ * \param stream first stream index to use
+ * \return the number of stream indices assigned by this model
+ */
+ virtual int64_t AssignStreams (int64_t stream);
+
private:
- UniformVariable m_stream;
+ /// Provides uniform random variables.
+ Ptr<UniformRandomVariable> m_stream;
};
class TestRandomStream : public RandomStream
@@ -51,6 +73,17 @@
public:
void AddNext (uint32_t v);
virtual uint32_t GetNext (uint32_t min, uint32_t max);
+
+ /**
+ * Assign a fixed random variable stream number to the random variables
+ * used by this model. Return the number of streams (possibly zero) that
+ * have been assigned.
+ *
+ * \param stream first stream index to use
+ * \return the number of stream indices assigned by this model
+ */
+ virtual int64_t AssignStreams (int64_t stream);
+
private:
std::list<uint32_t> m_nexts;
};