lundi 29 août 2016

Possible to save seeded PRNG in Objective-C?

I'm seeding a PRNG in objective-c by writing

srandom(seed);

I'n C# I can save that PRNG away in a variable as:

prng = new Random(seed);

Is this possible in Objective-C as well?

The reason I want to save the PRNG in a variable is that a want a deterministic outcome. I don't want to have the risk that another function reseeds the PRNG.

I have tried to do some research, for example reading this article that lists different libraries: http://ift.tt/17J0OtL, but I haven't found anything.




Aucun commentaire:

Enregistrer un commentaire