Priority Queues #26
Replies: 3 comments 3 replies
-
From @KevinMcCarthyAtIDM
|
Beta Was this translation helpful? Give feedback.
-
@clorton 's implementation (fixed length, array-based priority queue) was quite different than earlier implementations I had seen. I did some comparisons in different languages and implementations here. Referencing @jonathanhhb 's implementation of RI using a priority queue/task sorter here using |
Beta Was this translation helpful? Give feedback.
-
Given some of the progress we've seen in how fast we just iterate over large arrays quickly with parallelization and/or C, I'm less interested in priority queues or specialized containers for accessing (sorted) subsets of the population. That said, there could still be some valid use cases where they perform better. The 2 that I've heard proposed are:
On mortality, which has its own discussion, I'm of the view that everyone should have a predetermined 'dod' or expected_life_span and we use that to filter "dead people" out of transmission operations, and that we don't need to do much more than that. Which leaves us with... For RI, if we need high fidelity in terms of who and when folks are getting "intervened", it could make sense to stuff newborns in a queue by age and then process them in order, and stuff them in a "second dose RI queue", etc. I should add that it's my understanding that we've coalesced around keeping all agents sorted in age order (where we have ages) so it can be pretty easy to find people of the right age or even keep an index to the "oldest agent considered for RI". But when keeping track of "once vaxxed" it might be easier and faster to use a queue rather than a flag and a second index. It might all come down to how fast we can enque and deque vs for-loop. |
Beta Was this translation helpful? Give feedback.
-
From Open Design Questions
from @jonathanhhb
Beta Was this translation helpful? Give feedback.
All reactions