Message180480
| Author |
klankschap |
| Recipients |
klankschap, ronaldoussoren |
| Date |
2013年01月23日.17:32:11 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1358962332.33.0.660025767409.issue17020@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I recently noticed that the standard random() function generates values >= 1.0
As processes are called from an event scheduler, each process has its own Random() instance.
self.random = random.Random(seed)
self.randomState = self.random.getstate()
keeping track of multiple objects:
self.random.setstate(self.randomState)
self.random.jumpahead(1)
self.randomState = self.random.getstate()
Also gammavariate() generates errors as it too makes use of the _random() call
A workaround is to check each response of random() for values >= 1.0 |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2013年01月23日 17:32:12 | klankschap | set | recipients:
+ klankschap, ronaldoussoren |
| 2013年01月23日 17:32:12 | klankschap | set | messageid: <1358962332.33.0.660025767409.issue17020@psf.upfronthosting.co.za> |
| 2013年01月23日 17:32:12 | klankschap | link | issue17020 messages |
| 2013年01月23日 17:32:11 | klankschap | create |
|