Skip to content

Conversation

@rht
Copy link
Contributor

@rht rht commented Jul 24, 2022

For steps of 100, this improves the time for CovidAgent.step from 20 s to 8.9 s. Also, this makes it easy to use a batch of pre-generated uniform random numbers. As in, there could be a follow-up PR that further speeds up bernoulli_rvs.

But upon benchmarking, the bernoulli_rvs is no longer the most time-consuming part of CovidAgent.step. It becomes CovidAgent.move. I measured the time for CovidAgent.move; most of it is due to poisson.rvs.

@nunezco2 nunezco2 merged commit 5ef523e into ncsa:master Jul 25, 2022
AngelSaint pushed a commit to AngelSaint/COVID19-mesa that referenced this pull request Nov 8, 2025
perf: Use Python builtin RNG to generate Bernoulli samples
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

Successfully merging this pull request may close these issues.

2 participants