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

Add Distributions to the Random generation #5

Closed
3 tasks done
joneubank opened this issue Sep 5, 2021 · 0 comments · Fixed by #10
Closed
3 tasks done

Add Distributions to the Random generation #5

joneubank opened this issue Sep 5, 2021 · 0 comments · Fixed by #10
Labels
enhancement New feature or request

Comments

@joneubank
Copy link
Contributor

joneubank commented Sep 5, 2021

  • Add distribution as an optional parameter to all the generators.
  • Add as an optional parameter to context generation, so that it can be the default distribution for everything called within that context
  • Make the default distribution added to a context be Uniform

Interface for this something like:

type Distribution = (x: number) => number;

example:

const Uniform: Distribution = (x) => x;

or

const Sinusoidal = (periods: number, offset: number):Distribution => (x) => Math.sin(x*PI*periods+offset*TWO_PI);
@joneubank joneubank added the enhancement New feature or request label Sep 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant