Load CIN and external data
Load CIN and external data
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
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
What is the symptom of data not getting loaded? Model won't run? Or ... ?
Can you post the code you're using?
Can you post the code you're using?
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: Load CIN and external data
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.
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.
-
- Super Administrator
- Posts: 4841
- Joined: Wed Mar 05, 2003 3:10 am
Re: Load CIN and external data
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.
Code: Select all
SIMULATE>DATA|
Tony.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
Re: Load CIN and external data
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?
With a void list of data, the cin file will load its own list, including the external data of the policy?
-
- Super Administrator
- Posts: 4841
- Joined: Wed Mar 05, 2003 3:10 am
Re: Load CIN and external data
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.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
Re: Load CIN and external data
Can you post the code you're using? .cin and data statements shouldn't normally interact.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: Load CIN and external data
I load data with (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?
Code: Select all
SIMULATE>ADDDATA|?&SPECIAL>CLEARRUNS
In fact, they don't interact, as I was afraid of.
When I load the cin file with
Code: Select all
SIMULATE>READCIN|?Changes file
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
When you say "data" here, do you actually mean the history of decisions made in a previous simulation, rather than external data?
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
-
- Super Administrator
- Posts: 4841
- Joined: Wed Mar 05, 2003 3:10 am
Re: Load CIN and external data
Try
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.
Code: Select all
SIMULATE>DATA|&SIMULATE>ADDDATA|?&SPECIAL>CLEARRUNS
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559