MCPcopy
hub / github.com/frappe/charts / getRandomBias

Function getRandomBias

docs/assets/js/index.min.js:30–37  ·  view source on GitHub ↗
(min, max, bias, influence)

Source from the content-addressed store, hash-verified

28
29// https://stackoverflow.com/a/29325222
30function getRandomBias(min, max, bias, influence) {
31 var range = max - min;
32 var biasValue = range * bias + min;
33 var rnd = Math.random() * range + min,
34 // random in range
35 mix = Math.random() * influence; // random mixer
36 return rnd * (1 - mix) + biasValue * mix; // mix full range and bias
37}
38
39// Playing around with dates
40var NO_OF_MILLIS = 1000;

Callers 2

getRandomFunction · 0.70
index.min.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…