AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Module Coding (https://forums.alliedmods.net/forumdisplay.php?f=9)
-   -   [Req] A better PRNG (Mersenne Twisted) module. (https://forums.alliedmods.net/showthread.php?t=319357)

metal_upa 10-26-2019 22:41

[Req] A better PRNG (Mersenne Twisted) module.
 
Hello, can i request a better random number generator amxx module? How about to use SFMT?

More info about SFMT see http://www.math.sci.hiroshima-u.ac.j...FMT/index.html

I know that MT based module already existed but it was made 14 years ago, i believe it was out dated.
So we need an alternative for that.

Function that i need:
- generate random int - random_num_mt(min, max)
- generate random float - random_float_mt(min, max)

Thank you.

^SmileY 10-31-2019 12:22

Re: [Req] A better PRNG (Mersenne Twisted) module.
 
PHP Code:

using namespace std;

long GetLargeRand(int Min 0,int Max 2147483647)
{
    
mt19937 seed mt19937(std::random_device()());
    
uniform_int_distribution<int> = uniform_int_distribution<int>(Min,Max);

    return 
dist(seed);


Something like this is SFMT?
I did not see a reason to be outdated?


All times are GMT -4. The time now is 06:37.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.