Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

try drawing product model flow diagrams with a recursive approach #222

Open
stevencarlislewalker opened this issue Oct 5, 2024 · 0 comments
Assignees

Comments

@stevencarlislewalker
Copy link
Member

We assume that we know (either through user input or explicitly represented model structure) what flows should go east and south (and even north and west if we want to be able to go back and forth along chains through things like immunity waning and vaccination).

We also assume that we have a topological sort, and if necessary for non-DAGs a way to declare the first state in the sort.

We then have a recursive function f(i, list(x, y), list(N, S, E, W), visited) that updates (x, y) where.

  • i : an index representing one state
  • x, y : vectors giving the x and y coordinates of each state (this is the 'layout')
  • N, S, E, W : lists, each element of which gives states to the north, south, east, and west of a focal state
  • visited : vector containing indices of states that have been visited, with this vector growing as the recursion traverses the graph
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🔖 Ready
Development

No branches or pull requests

1 participant