Hello,
I am trying to add gaussian randoms to my script. I started using:
int dynamicReturn = (int) ((rand.nextGaussian()*deviation)+mean);
but the issue with that is the Gaussian random will not always stay within the deviation variable. To fix this I did:
int dynamicReturn;
do {
dynamicReturn = (int) ((rand.nextGaussian()*deviation)+mean);
}while(dynamicReturn < (mean-deviation) || dynamicReturn > (mean+deviation));
which works but because that would make it skip generated numbers outside of the range, I'm wondering if that would throw off my gaussian distribution?
If so, what would be a better approach to use that would still lock all the values within my deviation?