RandomVariableStream c'tor with assigned stream
On May 11, 2021, at 12:47 PM, Tom Henderson tomh@tomh.org wrote:
On 4/12/21 5:17 PM, Newton, Benjamin David wrote: I’ve discovered what appears to be a peculiar bug in ns-3.33. The attached aodv-test.cc creates a grid of 7x7=49 nodes and sends 1 ping packet per second for 8 seconds from the node at one corner of the grid to the node at the opposite corner of the grid, using AODV to find the route.
Ben, sorry I didn't reply to this earlier; I meant to look at it and forgot until today.
This is not a bug but an artifact of how the random variable stream assignments work, discussed here: https://urldefense.us/v3/https://www.nsnam.org/docs/release/3.33/manual/html/random-variables.html*setting-the-stream-number;Iw!!G2kpM7uM-TzIFchu!igAZQjEN5VvB8lhJao8DIQjQGn_fxOMidTJv7oX3KpdE3G8kSpkNr0pMqOZhmUutiw$ The mere act of creating the new random variable before the rest of your configuration (even though you immediately assign it to a fixed stream) will perturb the automatic stream assignments of what follows (unless the random variables used in the other subsequently created objects also have their streams assigned explicitly).
I find this unsatisfactory, but there doesn't appear to be any way around it: by the time you can set the stream number it is too late, an auto-assigned stream number has been consumed.
Suggested fix is to provide c'tors which accept a stream number.