Open uluturki opened 3 years ago
You are correct that I don't have an option for adoptive rewiring.
This sounds like Gillespie_simple_contagion is the best option. Something like this might give some ideas: https://epidemicsonnetworks.readthedocs.io/en/latest/examples/SEIRT.html. In this example someone who is infected might be identified due to infection or because an infected partner is identified.
Thanks for the quick response, I do need the actual rewiring mechanism (i.e. modify the graph G as the simulation goes on) since that is an important part of the model I am trying to simulate.
Is there anything I should be wary of if I went into the Gillespie_simple_contagion function and modified the graph G whenever a node transitions to a certain compartment? I think removing all related pending events for that pair from the queue when breaking an edge, and initializing related events when adding an edge should be sufficient. A hacky solution will serve me fine at the moment since I only need a very simple rewiring mechanism.
I need quick results for this but I will be happy to discuss how to implement it more properly and contribute the implementation to the repo later if there is interest in including it.
Something like this is definitely doable.
you would need to spend a little bit of time thinking about the "listDict" class that it uses. Right now it keeps track of the possible events and their associated rate. So when an edge is broken or added you'll need to update those events.
A more hacky version would be to let it run for a little while and then pause and restructure the network and restart the calculations fresh. This wouldn't be very fast, but may be less likely to make mistakes in the coding (might also run into trouble because the rewiring wouldn't happen as fast as you want).
If you do get something working it would be nice if you can provide some code that is set up in a way where the user could specify their own rewiring rules and it could be added.
Hi,
I would like to simulate a 4 compartment model (SIR with an additional Quarantine compartment) with adaptive rewiring where susceptible nodes wire away from infected nodes with a rate. It seems that modifying the network during the simulation is not supported at the moment.
Based on my cursory reading, I can achieve this by modifying "Gillespie_simple_contagion", but I wanted to check if there is a recommended way to approach this issue. I do not mind writing a bit of code to achieve this.
Thanks!