diff --git a/js/random.js b/js/random.js index 8ab8e1d61ea85182398316e6f9927fec8840c5e2..10569f08e4029693bfd48c510c68be8d573cabc7 100644 --- a/js/random.js +++ b/js/random.js @@ -1,8 +1,8 @@ /** * generate two independent Gaussian numbers using Box-Muller transform. * mean and deviation specify the desired mean and standard deviation. - * @param {number} [mean] - * @param {number} [deviation] + * @param {number} [mean=0] + * @param {number} [deviation=1] * @returns {number[]} */ function gaussianPair(mean = 0, deviation = 1) { @@ -47,10 +47,10 @@ App.Utils.Math.limitedSkewedGaussian = function(max, min, skew) { * Generate a random integer with a normal distribution between min and max (both inclusive). * Default parameters result in truncating the standard normal distribution between -3 and +3. * Not specifying min/max results in rerolling val approximately 0.3% of the time. - * @param {number} [mean] - * @param {number} [deviation] - * @param {number} [min] - * @param {number} [max] + * @param {number} [mean=0] + * @param {number} [deviation=1] + * @param {number} [min=mean-3*deviation] + * @param {number} [max=mean+3*deviation] * @returns {number} */ function normalRandInt(mean = 0, deviation = 1, min = mean - 3 * deviation, max = mean + 3 * deviation) { @@ -66,7 +66,7 @@ function normalRandInt(mean = 0, deviation = 1, min = mean - 3 * deviation, max * If count is defined, chooses that many random numbers between min and max and returns the average. This is an approximation of a normal distribution. * @param {number} min * @param {number} max - * @param {number} [count] + * @param {number} [count=1] * @returns {number} */ function jsRandom(min, max, count = 1) {