Ventity makes the easy stuff easy
Posted: Wed Apr 05, 2023 3:09 pm
Hi Tom. Thought I would update you on my progress. After lots of struggles with learning Ventity and then implementing the model design, I came the realization that while Ventity makes the easy stuff easy, it makes the hard stuff hard.
Back on March 31, I noticed that for the last few days, I was spending 90% of my time in debugging. This reached a climax on the Voter action G2_4 Support Decision. This had a bug. The politician supported attribute was never being set. Why? Well, Ventity has no debugging facilities other than watching graphs or reading spreadsheet results of the end of a simulation. That did not shed light on the problem.
Ultimately the only way I could see what the app was calculating was to add 4 debugging attributes to the Voter entity, and study the results spreadsheet. That led to discovery of 2 logic errors on my part. But even after that, the politician supported attribute was still not being set correctly.
To make matter worse, Ventity only has If Then Else. It has no If Then. Thus, if you want to change the value of an attribute only if a condition is true, if it’s not true you have to set the attribute to its present state. This requires adding a pre-action to save the attribute’s state, and make it available to the If Then Else.
Ventity also lacks a numeric variable that is easily changed. Stocks don’t allow that. To change a stock value, you have to add a flow, add an arrow from the stock to the flow, and then use the equation: flow = desired change – stock. That is a hack, and my Ventity model is full of them. They are terribly awkward and clutter up the model.
The contortions of having to add 4 debugging attributes, one pre-action, and then discover that the problem was still NOT solved (maybe another variable not on a diagram causing unpredictable behavior), and the fact that I’ve had to create a document with a table of all the actions and their sequences led me to conclude that Ventity hits the wall with complex agent decision making. It’s not scalable to modeling hard problems with a high degree of complex logic during each time step. Plus, I’m not using loops and stocks and flows. I’m building a “pure” agent-based model.
What to do? I took a few days to see what was possible with JavaScript, html, and css. Lo and behold, after 4 days of work I was able to produce a fully functional app for a time step simulation of agents. Media Meme, News Organization, and Politician agents are implemented. The dashboard runs in a browser, and has one graph showing simulation output, with one slider controlling a constant used. The dashboard also lets you turn randomness on or off. The code underneath is highly readable and well-organized, so as to support building out the app easily, all of which I can envision.
All this took less than 700 lines of code, including html and css. My assumption that doing this would take “a mountain of code” was wrong. You can see the present version here.
Thus, I’ve concluded that I need to switch from Ventity to JavaScript to complete this project. I really appreciate all the help you’ve given me. I learned a lot from you and how agent-based modeling can work. Good luck moving forward with Ventity. Thanks!
Back on March 31, I noticed that for the last few days, I was spending 90% of my time in debugging. This reached a climax on the Voter action G2_4 Support Decision. This had a bug. The politician supported attribute was never being set. Why? Well, Ventity has no debugging facilities other than watching graphs or reading spreadsheet results of the end of a simulation. That did not shed light on the problem.
Ultimately the only way I could see what the app was calculating was to add 4 debugging attributes to the Voter entity, and study the results spreadsheet. That led to discovery of 2 logic errors on my part. But even after that, the politician supported attribute was still not being set correctly.
To make matter worse, Ventity only has If Then Else. It has no If Then. Thus, if you want to change the value of an attribute only if a condition is true, if it’s not true you have to set the attribute to its present state. This requires adding a pre-action to save the attribute’s state, and make it available to the If Then Else.
Ventity also lacks a numeric variable that is easily changed. Stocks don’t allow that. To change a stock value, you have to add a flow, add an arrow from the stock to the flow, and then use the equation: flow = desired change – stock. That is a hack, and my Ventity model is full of them. They are terribly awkward and clutter up the model.
The contortions of having to add 4 debugging attributes, one pre-action, and then discover that the problem was still NOT solved (maybe another variable not on a diagram causing unpredictable behavior), and the fact that I’ve had to create a document with a table of all the actions and their sequences led me to conclude that Ventity hits the wall with complex agent decision making. It’s not scalable to modeling hard problems with a high degree of complex logic during each time step. Plus, I’m not using loops and stocks and flows. I’m building a “pure” agent-based model.
What to do? I took a few days to see what was possible with JavaScript, html, and css. Lo and behold, after 4 days of work I was able to produce a fully functional app for a time step simulation of agents. Media Meme, News Organization, and Politician agents are implemented. The dashboard runs in a browser, and has one graph showing simulation output, with one slider controlling a constant used. The dashboard also lets you turn randomness on or off. The code underneath is highly readable and well-organized, so as to support building out the app easily, all of which I can envision.
All this took less than 700 lines of code, including html and css. My assumption that doing this would take “a mountain of code” was wrong. You can see the present version here.
Thus, I’ve concluded that I need to switch from Ventity to JavaScript to complete this project. I really appreciate all the help you’ve given me. I learned a lot from you and how agent-based modeling can work. Good luck moving forward with Ventity. Thanks!