Thanks to visit codestin.com
Credit goes to github.com

Skip to content

No mechanism to use seeded random generation #3289

@hugoferreira

Description

@hugoferreira

Currently, methods that expose random behaviour, like sample, use the internal Math.random() function, which is unseeded. Not being able to optionally enforce deterministic behaviour in a functional setting is... odd. I would like to suggest the discussion over possible enhancements and alternatives to implement such feature, amongst which:

  • Change all internal function call of Math.random() to a lodash random number generator;
  • Make this random number generator a... generator function;
  • Support passing an extra parameter in functions like sample to set the seed;
  • Support an optional callback in functions like sample that provides a generator;
  • Get an objective measurement on the performance impact of such changes, and aim for a zero-cost abstraction so we don't end up with angry people.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions