Closed kerbe6 closed 6 years ago
Actually it should be:
let position = randomExt.integer(allProps.length - 1, 0);
Also, I'd like to suggest an additional method of mutating a parameter. Instead of selecting a new parameter randomly, it would be nice if one could "jiggle" the existing parameter. Maybe by a user-defined percentage. For example:
maxMutataePercent = 0.1
newParam = oldParam * randomExt.float(maxMutatePercent, -maxMutatePercent)
Could you submit a pull request with these changes?
The "jiggle" feature sounds interesting.
@kerbe6 nice find would you like to PR it? That jiggle idea though... love it! Unfortunately my hands are tied atm so it wont be me that brings it to fruition, but id love to see it eventually.
Should be: let position = randomExt.integer(a.length, 0);
@kerbe6 i finally had time to take a look. Good eye just one more thing though. Being 'a' is an object not an array, we get the length of the object keys Object.keys(a).length..... again very nice find im gonna go ahead and get the fix pushed.
Problem is this line:
let position = randomExt.integer(0, a.length);
Should be:
let position = randomExt.integer(a.length, 0);