Ventity makes the easy stuff easy

A place for Ventity software questions & answers
Post Reply
Jack Harich
Senior Member
Posts: 68
Joined: Wed Sep 15, 2004 9:01 pm
Vensim version: DSS

Ventity makes the easy stuff easy

Post by Jack Harich »

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!
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: Ventity makes the easy stuff easy

Post by tomfid »

Thanks for the feedback. I'm not really surprised at your choice, given the granularity of your model. It's not our target use case.

Two quick tech notes:
Jack Harich wrote: Wed Apr 05, 2023 3:09 pm 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.
I don't think this is necessary. You can just write:
parent.attribute = if ( a<b ) { invoker.otherAttrib } else {parent.attribute}
to set the attribute to itself if the condition is false.
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.
Changing stocks with flows isn't a hack - it's quite deliberate. It preserves visual consistency between behaviors in continuous integration (entities) and discrete time (actions) and more importantly permits enforcement of material conservation in the case of stock-flow-stock connections. However, I can see the case for a numeric attribute that would simplify the kind of discrete changes you want.
Jack Harich
Senior Member
Posts: 68
Joined: Wed Sep 15, 2004 9:01 pm
Vensim version: DSS

Re: Ventity makes the easy stuff easy

Post by Jack Harich »

I don't think this is necessary. You can just write:
parent.attribute = if ( a<b ) { invoker.otherAttrib } else {parent.attribute}
to set the attribute to itself if the condition is false.
That’s the first step I tried, over and over, first with normal and then with shadow variables. No effect. So I tried adding a pre-action to save the state for use in the if then else. No effect. So I added 4 debug attributes, found 2 errors, fixed them. But the original problem remained “The politician supported attribute as never being set.” This took a LOT of time.

I concluded I needed to post a question “Unable to change an attribute.” But I had asked that before. My learning curve on Ventity was now obvious flat. I was getting nowhere. So I switched to developing the model in JavaScript. This is going very well.

IMHO, Ventity is brittle. I’ve used enough apps, including Vensim, and done enough programming, to be able to use well designed apps to accomplish complex things. They were not brittle.

But twice with Ventity I would implement some small change that took a few minutes. Suddenly the app would misbehave. After an hour of looking for the cause of the problem, I had to revert to a previous copy. Then I would slowly put the same change back in, running the model after EACH edit to see it if was broken. Both times, it never broke. I never did discover what caused it to break before, so I could learn nothing.

Thanks for the feedback. I'm not really surprised at your choice, given the granularity of your model. It's not our target use case.
Thanks, but if you are promoting Ventity as capable of agent-based modeling by saying it supports “ABM with complex agents, no programming needed”, then you apparently realize there are many real-world problems where agents make complex decisions. If Ventity says it can do that (see the above quote) but actually cannot (as I have discovered) then you may have some rethinking to do. Apparently Ventity can only handle simple agents. Just trying to give honest, helpful feedback.

The greatest challenge social scientists and business problem solvers face today is highly complex problems, where various agents (notably people and institutions) misbehave. If Ventity is not designed for these complex agent cases, then it cannot be used to solve the hardest problems. That would be a shame, because Ventity is loaded with brilliant design, like its relational database paradigm, organization of model components, and its superb overall user interface. My take is it needs to be far less brittle and far easier to debug. It also needs current documentation of the quality needed to learn to apply all the complex features of the tool. Good luck!
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: Ventity makes the easy stuff easy

Post by tomfid »

ChangeAttributeMaybe.zip
(5.78 KiB) Downloaded 252 times
This model runs an action each time step that either updates an attribute to a new value, or retains the current value. Is this what you were after?
Post Reply