How to get live Totals in Interface Builder with Vensim model

Hi,
My simulation needs inputs on 5 items on the decision page which the player has to spend on. eg total budget of 10,000USD and user has to choose between advertising, promotions, sales force, etc. I wanted to give a running total of the money being spent, and have a running balance of the amount left for him to spend, to be displayed at the bottom. how can i do this?
I have used the “total option” but this gives the previous runs values, not the current value generated by the input. Any ideas?

this feature is also there in the Managing customers and Segments simulation, where the total marketing budget is given, and the user is restricted in choosing only to this extent for expenditure.

I am a new to this, do not have any coding expertise, and am building this up on the Interface builder option on forio epicenter. I have a vensim PLE model at the backend.

thanks in advance for any help!
regards
Rajiv

Hi Rajiv,

While this is possible with Epicenter in general, it’s not easy to do in the interface builder, as Vensim only recalculates values upon a simulation step.

You can do this with JavaScript by editing the HTML directly and adding custom functions, but this is a bit complex. If you then edit the file with the interface builder it will remove that Javascript from the controls. I only recommend that if you have some JavaScript experience.

While it’s not exactly what you are asking for, I think the most practical way of doing this would be to handle it in the model. If the user enters values that sum to greater than $10,000, normalize this to $10,000 total and use that in the budget.

Here’s equations you might use in vensim

d1 = something
d2 = something
d3 = something
d4 = something
d5 = something

max_value = 10000
sum = d1 + d2 + d3 + d4 + d5
adjustment = IF THEN ELSE(sum = 0, 0, min(1, max_value / sum))

a1 = d1 * adjustment
a2 = d2 * adjustment
a3 = d3 * adjustment
a4 = d4 * adjustment
a5 = d5 * adjustment

Thank you let me try this!