We wrote this script to show how async functions can modeling and visualizing flows in a system. github
Script logic creates nodes that run infinite loops trading Money for stuff.
As nodes trade with each other they also report to a function that reports state and accumulated flows. [⇒ Accumulation]
~
We simulate a micro economy where tom, dick and harry are makers and users of stuff in a producer-consumer relationship. github
We visualize total cash flows between the people and the organizations that represent costs for makers and reliable income for the users.
//wiki.ralfbarkow.ch/assets/pages/demo-sim--viz/demo.html HEIGHT 450
The simulation code creates cash flows into and out of the bank. A single cashflow() function alerts the viz as flows happen.
The visualization code accumulates total flows from each participant. Flows are converted to edges in a graphviz diagram updated immediately unless still busy with the previous update.
~