I have this script, but when I run it back to back with different {idx} it compiles the model from scratch every time, which is confusing because i'm not changing anything in the model (like changing the constants in between the iterations). If I repeat the steps manually inside Vensim by changing the dataset from simulation control and run the optimization, it just compiles the model only for the first time and the next iterations of Powell run immediately without a need of compiling. Any suggestions? Should I update the CMD content?
SPECIAL>NOINTERACTION
SPECIAL>LOADMODEL|LV.mdl
SIMULATE>DATA|data_v{idx:02d}.vdfx
SIMULATE>RUNNAME|Powell_Gaussian_v{idx:02d}
SIMULATE>OPTPARM|Powell_Settings_Gaussian.voc
SIMULATE>PAYOFF|Payoff_Gaussian.vpd
MENU>RUN_OPTIMIZE|o
MENU>EXIT
How do I use the compiled model with command script CMD
-
- Senior Member
- Posts: 215
- Joined: Sun Oct 21, 2018 7:09 am
- Vensim version: DSS
-
- Senior Member
- Posts: 215
- Joined: Sun Oct 21, 2018 7:09 am
- Vensim version: DSS
Re: How do I use the compiled model with command script CMD
I just noticed that even if I'm doing it manually, whenever I close Vensim window I need to recompile the model. so maybe it's the expected behavior.
Edit: I realized that I can write everything in a single CMD (without having 'No_Interaction' or 'Load_Model') to avoid recompiling the model. Something like this worked perfectly:
Edit: I realized that I can write everything in a single CMD (without having 'No_Interaction' or 'Load_Model') to avoid recompiling the model. Something like this worked perfectly:
Code: Select all
SIMULATE>DATA|data_v01.vdfx
SIMULATE>RUNNAME|Powell_Gaussian_v01
SIMULATE>OPTPARM|Powell_Settings_Gaussian.voc
SIMULATE>PAYOFF|Payoff_Gaussian.vpd
MENU>RUN_OPTIMIZE|o
MENU>EXIT
SIMULATE>DATAdata_v02.vdfx
SIMULATE>RUNNAME|Powell_Gaussian_v02
SIMULATE>OPTPARM|Powell_Settings_Gaussian.voc
SIMULATE>PAYOFF|Payoff_Gaussian.vpd
MENU>RUN_OPTIMIZE|o
MENU>EXIT
SIMULATE>DATA|data_v03.vdfx
SIMULATE>RUNNAME|Powell_Gaussian_v03
SIMULATE>OPTPARM|Powell_Settings_Gaussian.voc
SIMULATE>PAYOFF|Payoff_Gaussian.vpd
MENU>RUN_OPTIMIZE|o
MENU>EXIT
Re: How do I use the compiled model with command script CMD
The other option is to package the model as a vpmx along with the compiled .dll.
/*
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
*/
-
- Senior Member
- Posts: 215
- Joined: Sun Oct 21, 2018 7:09 am
- Vensim version: DSS
Re: How do I use the compiled model with command script CMD
Thank you, Tom. Unless I'm missing something, I haven't figured out how to generate .out files through dll yet:
viewtopic.php?t=8521
viewtopic.php?t=8521