-
-
Notifications
You must be signed in to change notification settings - Fork 445
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
Create a distribution by mapping the output of another one #1129
Conversation
Does this have an advantage over |
My main use case is if a consumer needs a distribution producing a type that includes units of measurement, e.g. If I changed the requirement of the consumer from |
I am actually not sure whether I could fulfil this at all: I currently store the distributions with my model parameters while the PRNG state is part of the model state. The above would imply that I have to make these parameters part of the model state. Additionally, I would have to split the RNG streams for each distribution as I cannot mutably borrow a single one. And I would have to do this again for each agent as those are relocated between processes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not opposed to the idea. Code looks fine to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good to me. @vks can merge if he agrees.
Eratta: please add a note to the changelog. |
This is useful if consumers are to be given an opaque type implementing the Distribution trait, but the output of the provided implementations needs additional post processing, e.g. to attach compile time units of measurement.
Done. |
The CI failure looks related to |
No. Unstable features break sometimes (no surprise). |
This is useful if consumers are to be given an opaque type implementing the Distribution trait, but the output of the provided implementations needs additional post processing, e.g. to attach compile time units of measurement.