lm_random
v1.0.2
Published
Pseudo random number generator based on logistic map. Not safe, with short period
Downloads
4
Readme
lm_random
Seedable pseudo random number generator based on Logistic map. Returns value beetween 0 and 1 Default seed is 0.1
API:
Usage:
Import Random class to your project, use constructor to create new instance of Random class and you are ready to go:
let rand = new Random();
Seeding:
Setting initial value for the generator
rand.seed(0.4);
Improving results
Since logistic map's trajectories for two seeds that are close to themselves might lay close to each other initially - producing simmiliar sets of numbers for first several iterations, you might want to warm up the generator to get better quality of randomness.
You do that with warmUp function. This function performs 100 iterations without returning a result.
rand.warmUp()
To get next random number:
rand.random()
Source code
(Github repository)[https://github.com/KrzysztofWojnarowski/random]