Page 1 of 1
Load CIN and external data
Posted: Tue Apr 23, 2013 4:52 pm
by apix
Hi,
my Venapp interface let the user load a cin file to restore a previuos scenario.
When the cin file has been loaded, switchvars take the right values (super!) but external data doesn't get loaded (d'oh!)
What do you suggest me ? Should I write a note reminding to re-load external data after having loaded a cin file ?
Or there is an automatic way ?
Many thanks
Re: Load CIN and external data
Posted: Tue Apr 23, 2013 5:37 pm
by tomfid
What is the symptom of data not getting loaded? Model won't run? Or ... ?
Can you post the code you're using?
Re: Load CIN and external data
Posted: Fri Apr 26, 2013 9:42 am
by apix
After having loaded the cin file and run the simulation, the outputs show that external data were'nt loaded.
Some variables have default values. Some policies let the user change such values by loading an external vdf file.
The outputs correspond to the default values, not to the data relative to the cin file.
Re: Load CIN and external data
Posted: Fri Apr 26, 2013 10:55 am
by Administrator
Can you try running
and then loading your data files? It sounds like the default files are already loaded, so Vensim is getting data from those. This command will clear the list so you can use your own.
Tony.
Re: Load CIN and external data
Posted: Fri Apr 26, 2013 11:02 am
by apix
That means, I have to reset the data list, before loading the cin file?
With a void list of data, the cin file will load its own list, including the external data of the policy?
Re: Load CIN and external data
Posted: Fri Apr 26, 2013 12:16 pm
by Administrator
Reset the data list before you read the CIN, and then use SIMULATE>DATA|datafile1.vdf to load the data you need to run the simulation.
Re: Load CIN and external data
Posted: Fri Apr 26, 2013 2:58 pm
by tomfid
Can you post the code you're using? .cin and data statements shouldn't normally interact.
Re: Load CIN and external data
Posted: Tue Apr 30, 2013 3:43 pm
by apix
I load data with
Code: Select all
SIMULATE>ADDDATA|?&SPECIAL>CLEARRUNS
(the clearruns command is necessary to not see the loaded data as a loaded run)
In fact, they don't interact, as I was afraid of.
When I load the cin file with
, only Constants take the right values, while the external data are not restored.
My purpose was to let the user save the settings of a new scenario in order to complete the set up later. But the cin file is not the right way, if not all settings are restored.
Is there another way, supposed that the entire simulation requires too long?
Re: Load CIN and external data
Posted: Tue Apr 30, 2013 5:00 pm
by tomfid
When you say "data" here, do you actually mean the history of decisions made in a previous simulation, rather than external data?
Re: Load CIN and external data
Posted: Tue Apr 30, 2013 5:24 pm
by Administrator
Try
Code: Select all
SIMULATE>DATA|&SIMULATE>ADDDATA|?&SPECIAL>CLEARRUNS
Your call to "SIMULATE>ADDDATA|?" will add data files to an existing list. What you need to do is clear the list being used first, "SIMULATE>DATA|" will do that.