Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meta data to rng functions #60

Open
pvdz opened this issue Mar 29, 2016 · 0 comments
Open

Meta data to rng functions #60

pvdz opened this issue Mar 29, 2016 · 0 comments

Comments

@pvdz
Copy link
Contributor

pvdz commented Mar 29, 2016

We shouldn't use bare rng functions inside the project but instead an object that contains the meta data so we can reconstruct the function if needed.

Basically right now we accept a rng (like Math.random, or something more reproducable for prod, or something fixed for tests) which is just a function. But once we have it we can't really trace back how it was created. This makes it harder to generate the code to reproduce a particular test case.

Something like this would solve it:

{
  _class: 'special_rng',
  _params: 'fcxfds9fdsfua9uf98ds',
  roll: function(){ ... },
}

Then we can figure out what created the function through _class, recreate it through the _params property, and just call it through rng.roll().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant