geneticalgorithm icon indicating copy to clipboard operation
geneticalgorithm copied to clipboard

Add custom randomFunction option to geneticAlgorithmConstructor

Open chadkirby opened this issue 2 years ago • 0 comments

This commit introduces a new randomFunction option to the geneticAlgorithmConstructor to (among other things) support the use of seeded random number generators (RNG) for generating consistent results across different runs. Deterministic outputs make testing easier, and improves the user experience.

Changes:

Added the randomFunction option to the constructor with a default value of Math.random(). Replaced all occurrences of Math.random() with settings.randomFunction in the index.js file. Updated the test file to include a new test case for verifying the functionality of the randomFunction option.

chadkirby avatar Apr 06 '23 17:04 chadkirby