-
Notifications
You must be signed in to change notification settings - Fork 57
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
Initialization of seed
for Params
virtual class
#132
Comments
Hi @wenjie2wang Thanks for asking the question! You are correct that the intention is for the user to set the seed manually, either when creating the object ( (There are also issues with how the seeds are used during the simulation which I am aware of but haven't got around to addressing yet. This is a good reminder to look into those as well.) |
Hi @lazappi Thanks for your positive feedback!
I created a simple PR to resolve this issue.
I think how the random number seed is used internally is out of the scope of the package. It is probably not necessary to set the seed internally. Users should (be able to) set the seed on their own by a preceding |
Thanks for the PR! I have made a couple of quick comments on that but looks pretty good. Part of the design philosophy for {splatter} is that you should be able to recreate the simulation from the parameters object so that in theory you could just share that rather than the whole simulated dataset. For this reason it seemed like a good idea to store the seed and set it during the simulation. Obviously that causes some issues though. I would like to keep this behaviour and I think I know how to do that but I haven't got around to working on it yet. If that is something you would be interested in helping out with let me know and I could explain what I was planning to do. |
Thanks for developing this useful package.
I have a quick question: is it expected or by design that two
Params
child class objects always have the same seed by default? For example, theobj1
andobj2
are equivalent in the following code chunk. However, I was expecting them to be different due to the precedingset.seed()
.More generally, I find that the behavior may depend on the class initialization method. Two simple examples are given below.
In my opinion, using the
initialize()
method gives a better behavior. If one wants to repeat the simulation multiple times, he/she has to specify theseed
argument when initializing the parameter objects because the current behavior does not respect the random number seed specified byset.seed()
.The text was updated successfully, but these errors were encountered: