stable
Valerie 2021-12-22 18:03:24 -05:00
parent 5f6e26cdb0
commit 62d72ef80f
1 changed files with 12 additions and 4 deletions

View File

@ -2,12 +2,18 @@
export default { export default {
config: () => { config: () => {
return { return {
variance: Math.random() * 10, ...genBaseStats()
base: Math.random() * 10
}; };
} }
} }
function genBaseStats() {
return {
variance: Math.random() * 10,
base: Math.random() * 10
}
}
function randomNormal(width: number = 1, offset: number = 0) { function randomNormal(width: number = 1, offset: number = 0) {
var u = 0, v = 0; var u = 0, v = 0;
while(u === 0) u = Math.random(); //Converting [0,1) to (0,1) while(u === 0) u = Math.random(); //Converting [0,1) to (0,1)
@ -22,8 +28,10 @@ export function pull() {
export function getAverageReward() { export function getAverageReward() {
const avg = this.config.base; const avg = this.config.base;
this.config.variance = Math.random() * 10; this.config = {
this.config.base = Math.random() * 10; ...this.config,
...genBaseStats()
}
console.log('slots real reward was: ' + avg); console.log('slots real reward was: ' + avg);
return avg; return avg;
} }