You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am back with another question! Let's say we wanted to create a custom model by importing the DiffusionModel partial class, like you mentioned in #171 and wanted to make it such that the model is SE(IA)R, such that E -> I with rate = alpha and E -> A with rate = phi, what would be the best way to do this? My current code blocks for transitions are borrowed from the SEIR class, and are pasted below:
if u_status == 2:
if self.progress[u] < 1:
self.progress[u] += self.params['model']['alpha']
else:
actual_status[u] = 3 # I
del self.progress[u]
if u_status == 2:
if self.progress[u] < 1:
self.progress[u] += self.params['model']['phi']
else:
actual_status[u] = 4 # A
del self.progress[u]
The text was updated successfully, but these errors were encountered:
Yes, the idea is that within each iteration you cycle over the node set and, depending on the current node status, apply the transition rule you designed.
I haven't checked the code (I'm on the smartphone right now) but the scheme seems the standard one.
My only concern is that the rate is progressed through a simple '+=' counter in this example (taken from the SEIR model) and has no random elements, making it effectively a counter. I may just do a quick random chance instead, which matches more of what I would expect from the model, and is closer to the custom model with probabilities, where I check "if random() < (alpha): self.progress[u] = 1". This should solve the issue of the disease always doing E -> I and never E -> A.
I am back with another question! Let's say we wanted to create a custom model by importing the DiffusionModel partial class, like you mentioned in #171 and wanted to make it such that the model is SE(IA)R, such that E -> I with rate = alpha and E -> A with rate = phi, what would be the best way to do this? My current code blocks for transitions are borrowed from the SEIR class, and are pasted below:
The text was updated successfully, but these errors were encountered: