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
Schedulefeature #23
Schedulefeature #23
Conversation
dworp/scheduling.py
Outdated
if integer_increment > 0: | ||
t = t + integer_increment | ||
if t < tN: | ||
times.append((i, t)) |
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'm not sure why we are calling this a Poisson process. Isn't this a Bernoulli process now? And wouldn't it be more efficient to implement it that way with a geometric distribution (for small lambda, this throws away 10-40% of the samples)?
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.
A Poisson process has exponential inter-arrival times. We are sampling inter-activity times with the exponential distribution, so that's why we are calling it Poisson.
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.
@auroraschmidt I've added two implementations of a Bernoulli scheduler. They both give the same arrival time distribution as the original PoissonScheduler implementation. BernoulliScheduler is slower than the original implementation but handles indefinite simulations. The FastBernoulliScheduler works in the same manner as PoissonScheduler by pre-generating the schedule. Do you have strong opinions on whether the stop time for the scheduler should be inclusive or exclusive? Right now if you configure with a start time of 0 and stop time of 5, you get 4 time steps of 1, 2, 3, 4. I'd lean toward inclusive. |
This is an addition that allows for PoissonScheduling (note that times in the poisson schedule are still rounded to integers). It is used in the simple_contagion model in the Tsunami repo