Changed in version 3.2: Moved to the version 2 scheme which uses all of the bits in a string seed.
Deprecated since version 3.9: In the future, the seed must be one of the following types: NoneType, int , float , str , bytes , or bytearray .
Functions for bytes¶
random. setstate ( state ) ¶
Weibull distribution. alpha is the scale parameter and beta is the shape parameter.
Changed in version 3.2: randrange() is more sophisticated about producing equally distributed values. Formerly it used a style like int(random()*n) which could produce slightly uneven distributions.
.Random.seed saves the seed set for the uniform random-number generator
But I don’t know how that helps.
5 Answers 5
If you didn’t keep the seed, there’s no general way to “roll back” the random number generator to a previous state after you’ve observed a random draw. Going forward, what you may want to do is save the value of .Random.seed along with the results of your computations. Something like this.
I also wrote a C-standard rand() function that passes in a min, max, n, method, and so on. This is how I generate an "integer" to feed the setSeed and store in memory. I use Sys.time() as min/max for a default seed generation ( min = -1*as.integer(Sys.time()) and max = as.integer(Sys.time()) ). sample is a bad idea as it has to create a vector in the range to compute a single value, but it is an method option of rand() which feeds initSeed . The default "high-low" I found to be slightly faster than "floor".
Then you can reset the PRNG as follows; result2 should be the same as result .
Get Seed Funding is a micro-funding opportunity for CU Boulder undergrads and grads that provides up to $500 in funding for entrepreneurial ideas in the making. Applications are accepted on a rolling basis and reviewed by the Innovation Action Team.
NOTE: If your venture has generated $1,000 or more in profit, you are welcome to come pitch, but you will be less likely to receive funding unless there is an outstanding reason why seed funding will help your business flourish.
How do I participate?
Here are a few examples of funding that can be awarded (things that can be purchased with a credit card):