Am 09.04.20 um 22:24 schrieb Edwin Lock: > Initially, I thought I would be able maintain who is quarantined (and for how > long) with a vertex property map and filter the quarantined individuals out > from the network using a vertex filter. However, I noticed that the > iterate_sync() function, which iterates the model by one time step, seems to > ignore vertex filters. In particular, if I filter out all infected > individuals, it will still infect new people.
Using the epidemic models on filtered graphs should work. Maybe you should try explaining in more detail how you are doing it so we can see what the problem may be. > My second idea was to directly edit the vertex property maps that store the > state of each individual in the graph (susceptible, infected and recovered), > and introduce an additional ‘immunised’ state (with value 4, say). However, I > have noticed that changing the values of instance.s and instance.s_copy does > not seem to have any effect on iterate_sync(). In particular, if I mark > everyone as susceptible and thus nobody as infected, it still infects new > people in the next time step when I call iterate_sync(). So I am assuming > that the state is also stored elsewhere? Indeed this approach will not work so well, as the logic of the dynamics only differentiates between three states, not four. > Any pointers that might help me extend graph-tool’s SIR model to incorporate > quarantining/immunising would be greatly appreciated. I have tried > implementing my own model from scratch, but it is significantly slower. As mentioned above, filtered graphs should work. In addition, the SIR model allows for different transmission probabilities on each edge, by passing an edge property map as the 'beta' parameter, which you can set to zero for the edges incident on quarantined nodes. If these change over time, don't forget to pass the 'constant_beta=False' option as well. Best, Tiago -- Tiago de Paula Peixoto <[email protected]>
signature.asc
Description: OpenPGP digital signature
_______________________________________________ graph-tool mailing list [email protected] https://lists.skewed.de/mailman/listinfo/graph-tool
