Author here, if there is enough interest I can clean the code up and put it on GitHub. It is basically a state machine.
It'd go well as comparison vs. this code I've been playing around with from Phillip Rosedale (Founder of Second Life) where he's simulating economy for purposes of determining wealth distribution scenarios: https://editor.p5js.org/PhilipRosedale/sketches/odl5elMWy
I’d love to see the code with a permissive license for others to build upon.
Reminds me a little of ncase’s fantastic simulations — for example: https://ncase.me/sim/
For me I’m particularly interested in how you’ve done the presentation interface.