Open Tortar opened 1 year ago
I think that here we can even create a new package specialized for these sampling function, the reason is that these sampling function aren't useful only for agent based modeling, they can be used with any iterator
created: https://github.com/Tortar/IteratorSampling.jl
it will be be easier to solve this issue with it
With iteratorsampling.jl
it should be easy to create a fast version of multiple elements sampling functions, the problem is our current naming convetions which assume only one agent e.g. random_agent
, random_nearby_agent
, do you have any idea on how to handle this @Datseris ?
What does multiple elements mean here. what should random_agents
mean for multiple elements?
say instead of a single random agent, between all nearby agents, you want two of them, currently you either need to repeat (and maybe reject) random_agent two times or collect and sample. Instead if we talk about random_agents(model, n)
this would return n
random agents in the model. Do you think that "duplicating" random_agent
, ecc... with random_agents
, ecc... could be acceptable?
yes, that would be acceptable. We cross ref the two functions in their docsttrings.
Currently we support only single versions of specialized sampling function, but we could support also the multi-versions so that the new function sample without replacement for more than one item