I am using C ++ 11 with a new header <random>in my application and in the same class in different methods I need a different random number with different distributions. I simply placed the random engine std::default_random_engineas a member of the class, ran it in the class constructor with the help, std::random_deviceand used it for different distributions in my methods. It's okay to use a random engine this way or I have to declare different mechanisms for each distribution you use.
<random>
std::default_random_engine
std::random_device
This is normal.
Reasons for rejecting the generator:
:
( / ) , , , , RNG, RNG .
, .
: (, x y), . (noise())
while(simulating) x = x + noise() y = y + noise()
x y , , , , , , . , , .
. sehe .
. , , (2 ^ 19937 -), . , , , 3 , 1/3 .
, . , , ++ 11, , , , . .
MosteM . , , . - , . , , , : , A, B (0,1), A aA + sqrt (1-a * * 2) B (0,1) a.
EDIT: ++ 11, .