Dear Tom/Administrator,
I was wondering if there is any way in Venapp that keeps the constants' value fixed in different runs? I mean if I change the value of a constant at run1, for starting the run2 the constant value will be back to its default value; while I would like to do all of my runs with the latest value I specified. I would appreciate if you could help.
e.g.
default value: 2000
value in run1: 2500
value in run2: 2000
With best regards,
Hossein
Setting constants in different runs in Venapp
-
- Super Administrator
- Posts: 4620
- Joined: Wed Mar 05, 2003 3:10 am
Re: Setting constants in different runs in Venapp
Do you have a button that runs the simulation?
Assuming you have, add the following command before it
SIMULATE>WRITECIN|temp.cin
And add this after it,
SIMULATE>READCIN|temp.cin
This creates a file called temp.cin which includes all the constants you've set. It's saved before you run, and loaded immediately when the run is complete.
So your command on the button would now look something like
SIMULATE>WRITECIN|temp.cin&MENU>RUN|o&SIMULATE>READCIN|temp.cin
Assuming you have, add the following command before it
SIMULATE>WRITECIN|temp.cin
And add this after it,
SIMULATE>READCIN|temp.cin
This creates a file called temp.cin which includes all the constants you've set. It's saved before you run, and loaded immediately when the run is complete.
So your command on the button would now look something like
SIMULATE>WRITECIN|temp.cin&MENU>RUN|o&SIMULATE>READCIN|temp.cin
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: Setting constants in different runs in Venapp
Dear Administrator,
Thank you so much for replying. I have the following commands in a BUTTON. I added the commands you said, however, it does not work and again back to the default value. I have a constant "start of the project" in my model that its default value is 2016 but I would like to run it as 2018 in any run by clicking the button. Could you please help that is the line of the command (WRITECIN and READCIN) are correct?
BUTTON,"Simulate model",35,70,30,8,,,
"SIMULATE>SETVAL|"Truck-Shovel system"=1
&SIMULATE>SETVAL|"FIPCC system"=0
&SIMULATE>SETVAL|"SFIPCC system"=0
&SIMULATE>SETVAL|"SMIPCC system"=0
&SIMULATE>SETVAL|"FMIPCC system"=0
&SIMULATE>RUNNAME|Truck-Shovel
&SIMULATE>WRITECIN|temp.cin
&MENU>RUN|O
&SIMULATE>READCIN|temp.cin
&SIMULATE>SENSSAVELIST|TESES Indexes.lst
&SIMULATE>SENSITIVITY|TESES Indexes.vsc
&SIMULATE>RUNNAME|SA Truck-Shovel
&MENU>RUN_SENSITIVITY|O
&MENU>SENS2TAB|SA Truck-Shovel.vdf|SA Truck-Shovel.tab|*
&SPECIAL>MESSAGE|||Run completed!",
Thank you so much for replying. I have the following commands in a BUTTON. I added the commands you said, however, it does not work and again back to the default value. I have a constant "start of the project" in my model that its default value is 2016 but I would like to run it as 2018 in any run by clicking the button. Could you please help that is the line of the command (WRITECIN and READCIN) are correct?
BUTTON,"Simulate model",35,70,30,8,,,
"SIMULATE>SETVAL|"Truck-Shovel system"=1
&SIMULATE>SETVAL|"FIPCC system"=0
&SIMULATE>SETVAL|"SFIPCC system"=0
&SIMULATE>SETVAL|"SMIPCC system"=0
&SIMULATE>SETVAL|"FMIPCC system"=0
&SIMULATE>RUNNAME|Truck-Shovel
&SIMULATE>WRITECIN|temp.cin
&MENU>RUN|O
&SIMULATE>READCIN|temp.cin
&SIMULATE>SENSSAVELIST|TESES Indexes.lst
&SIMULATE>SENSITIVITY|TESES Indexes.vsc
&SIMULATE>RUNNAME|SA Truck-Shovel
&MENU>RUN_SENSITIVITY|O
&MENU>SENS2TAB|SA Truck-Shovel.vdf|SA Truck-Shovel.tab|*
&SPECIAL>MESSAGE|||Run completed!",
-
- Super Administrator
- Posts: 4620
- Joined: Wed Mar 05, 2003 3:10 am
Re: Setting constants in different runs in Venapp
That looks like it should work.
You might also need to load the CIN file after the sensitivity run is complete,
...
...
&MENU>RUN|O
&SIMULATE>READCIN|temp.cin
&SIMULATE>SENSSAVELIST|TESES Indexes.lst
&SIMULATE>SENSITIVITY|TESES Indexes.vsc
&SIMULATE>RUNNAME|SA Truck-Shovel
&MENU>RUN_SENSITIVITY|O
&SIMULATE>READCIN|temp.cin
&MENU>SENS2TAB|SA Truck-Shovel.vdf|SA Truck-Shovel.tab|*
&SPECIAL>MESSAGE|||Run completed!",
You might also need to load the CIN file after the sensitivity run is complete,
...
...
&MENU>RUN|O
&SIMULATE>READCIN|temp.cin
&SIMULATE>SENSSAVELIST|TESES Indexes.lst
&SIMULATE>SENSITIVITY|TESES Indexes.vsc
&SIMULATE>RUNNAME|SA Truck-Shovel
&MENU>RUN_SENSITIVITY|O
&SIMULATE>READCIN|temp.cin
&MENU>SENS2TAB|SA Truck-Shovel.vdf|SA Truck-Shovel.tab|*
&SPECIAL>MESSAGE|||Run completed!",
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: Setting constants in different runs in Venapp
Dear Administrator,
Thank you for your help. I could resolve the problem by putting a "save changes" button in my "input menu" and reading it before simulation. However, these changes are saved in a ".cin" file and they are not shown in my "input menu" in the "modify a variable value" box (please see the attached picture). Is there any way that these changes also can be shown in the variable value box?
Thank you for your help. I could resolve the problem by putting a "save changes" button in my "input menu" and reading it before simulation. However, these changes are saved in a ".cin" file and they are not shown in my "input menu" in the "modify a variable value" box (please see the attached picture). Is there any way that these changes also can be shown in the variable value box?
- Attachments
-
- Untitled.png (64.51 KiB) Viewed 4289 times
-
- Super Administrator
- Posts: 4620
- Joined: Wed Mar 05, 2003 3:10 am
Re: Setting constants in different runs in Venapp
Are you loading the CIN file before showing that screen?
If yes, you might also need to refresh the values,
http://www.vensim.com/documentation/ind ... ?25480.htm
If yes, you might also need to refresh the values,
http://www.vensim.com/documentation/ind ... ?25480.htm
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: Setting constants in different runs in Venapp
No, the steps from entering inputs to simulation is as follows:
1- Entering values in the input screen
2- pushing the "save changes" button (SIMULATE>WRITECIN|temp.cin)
3- reading the CIN file (SIMULATE>READCIN|temp.cin)
4- pushing the "simulation" button
1- Entering values in the input screen
2- pushing the "save changes" button (SIMULATE>WRITECIN|temp.cin)
3- reading the CIN file (SIMULATE>READCIN|temp.cin)
4- pushing the "simulation" button
-
- Super Administrator
- Posts: 4620
- Joined: Wed Mar 05, 2003 3:10 am
Re: Setting constants in different runs in Venapp
Can you upload or email (vensim@vensim.com) the venapp and model and I'll take a look?
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: Setting constants in different runs in Venapp
Sure. I will email it to you.
Thanks
Thanks
Re: Setting constants in different runs in Venapp
Dear Administrator,
I could resolve the problem by putting SPECIAL>RESETINPUT after loading the CIN file
Thanks for your help
I could resolve the problem by putting SPECIAL>RESETINPUT after loading the CIN file
Thanks for your help