On Monday, 8 February 2016 at 19:46:19 UTC, Joseph Rushton Wakeling wrote:
[snip]

This might be a stupid idea, but perhaps there's something useful in it:

Determinism isn't the same thing as "one long chain of numbers that everybody reads from".

It can be acceptable to seed a set of reasonable pseudo-random number generators with consecutive integers (indeed seeding randomly can be dangerous because of the birthday problem). More generally, any change of the state of the rng in "seed-space" should produce an output equivalent to taking a sample from the output distribution.

Can you not have a random number generator make a copy of itself like this:

struct RNG
{
    State state;
    static State.ModifierT modifier;
    this(this)
    {
        this.state.alterBy(modifier++);
        //recalculate output sample etc...
    }
}

Then any time you copy a RNG, the copy is kicked on to a new path in state-space. Basically we're deterministically re-seeding on copy.

Reply via email to