mac-theobio / McMasterPandemic

SEIR+ model
GNU General Public License v3.0
20 stars 5 forks source link

confusion over plot of 'classic' #214

Closed bbolker closed 2 years ago

bbolker commented 2 years ago

In this section the plot has a "V" facet (all zero), not immediately obvious in the code where that comes from ...

Also, it might be good to spit out results in such a way that the facets are ordered epidemiologically (e.g. in order of definition?) rather than alphabetically ... (a very cool thing to do would be to attempt a graph-ordering, i.e. algorithmically decide which states were 'upstream' vs 'downstream' on the basis of graph metrics ...)

stevencarlislewalker commented 2 years ago

The V facet is introduced by make_state, which I have just left as is. Should make_state be fixed? In any case I've just dropped the state, which solves the problem for this specific graph.

I'll consider checking for states that aren't involved in flows and removing them with a message.

Your topological sort idea is great. https://courses.cs.washington.edu/courses/cse326/03wi/lectures/RaoLect20.pdf

stevencarlislewalker commented 2 years ago

Topological sort is implemented, although I'm realizing that I forgot to remove the namespace colons. This function seems to work well for the plot referenced above. It currently doesn't work if the graph is acyclic, but I can imagine other heuristics that might work in these cases.

I also fixed the wayward V compartment in make_state with https://github.com/mac-theobio/McMasterPandemic/commit/a1c3a4d527c134824643a777e128b3316a3ed8f1. Not sure this is the best fix, but it doesn't seem to break anything.