Hi, I read in Excel data into Vensim using GET DIRECT DATA. This is an array of 5 values. I’d like to give the user the ability to change these values as one decision. Something like the drawable line chart in SIMULATE. How do I do this in epicenter?
Thanks and best, Ulrich
Vensim get direct data as decision
Hi Ulrich,
We’ve responded to another customer with a similar question recently, and I include an edited version of that comment here. There’s no built in tools in the interface builder to change a lookup function.
Forio supports changing the values of Vensim Lookup functions using direct API calls to the server, but this requires a more advanced approach using JavaScript programming.
There’s actually a simple demo of this here:
https://forio.com/app/showcase/drawable-line-graph
That model is built with Python but the principle is the same.
If you’d like to pursue this with some JavaScript, use the RunManager as described in the documentation here:
https://forio.com/epicenter/docs/public/api_adapters/generated/run-manager/
This has a section on setting variables.
For Vensim “LOOKUP” variables, the Epicenter format is an array. Each array element is itself an array with two elements: the x-y pairs from the original Vensim variable. When using the PATCH
method, update the entire Epicenter representation (replace all values); you can change the number of ordered pairs if desired. For example:
- Original Vensim LOOKUP represenation:
[(2000,0)-(2010,2)],(2000,1),(2005,.5),(2010,1)
- Epicenter representation:
[ [2000,1], [2005,.5], [2010,1] ]