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

Rethink approach to managing random #61

Open
2 of 7 tasks
oubiwann opened this issue Jun 28, 2021 · 4 comments
Open
2 of 7 tasks

Rethink approach to managing random #61

oubiwann opened this issue Jun 28, 2021 · 4 comments
Milestone

Comments

@oubiwann
Copy link
Member

oubiwann commented Jun 28, 2021

With the creation of a state-manager (gen_server; see #64), now's the right time to re-think how we're managing and using random seeds and random state.

Tasks:

  • Identify the different ways in which we want to use random seeds
  • Define those as configuration / options
  • Initialise the seed(s) as appropriate in the gen_server
  • Add functions for updating or viewing the seed(s)
  • Examine current usage
  • Add wrapping functions for the rand capabilities we need
  • Refactor code to use new wrappers

Depends upon #64

@oubiwann oubiwann added this to the 1.3.0 milestone Jun 28, 2021
@oubiwann
Copy link
Member Author

Let's see ... it would be nice to:

  1. always get the same image / noise when given a seed
  2. always get the same series of noise data when given a starting seed
  3. get something completely random, no matter what (if so desired)

I think we can collapse the first two into one. So we want seed and no-seed, really.

@oubiwann
Copy link
Member Author

These are two different sets of functions in Erlang's rand module ... but we should be able to wrap those as one set, and dispatch based upon config / setup / state.

@oubiwann
Copy link
Member Author

oubiwann commented Jun 28, 2021

We're currently only using these:

  • rand:seed_s
  • rand:uniform_s

The first appears in loise-opts and we basically want to keep that free from references to the state gen_server ... per #62. Maybe? (just added a note to that ticket)

Arguably, the function in which it appears (update-perm-table) may not really belong in loise-opts ...

The second call allears in loise-util in the random-permutation-tablewhich is called by the same update-perm-table as above :-(

So, yeah -- this is deeply tangled with #62 ...

@oubiwann
Copy link
Member Author

oubiwann commented Jul 4, 2021

We don't need this right now; gonna backlog it ...

@oubiwann oubiwann modified the milestones: 1.3.0, Backlog Jul 4, 2021
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