Page 1 of 1

Setting Time Bounds from Command Scripts

Posted: Thu Aug 20, 2009 9:50 am
by drw
From a command script is it possible to change the time bounds for a model such as INITIAL TIME? It would be great to avoid having to do this manually!

For example, we have a master energy model by country which we replicate for all countries whenever the model is updated and we have a command script to do that and update spreadsheet aliases (see example script below). However, is it possible to then change the INITIAL TIME to another year (say 1990) through the command script?

Example Script for one country

FILE>COPY|G:\US.mdl|CAN.mdl
SPECIAL>LOADMODEL|G:\CAN.mdl
SIMULATE>SPREADALIAS|?Input=CAN_Input.xlsb

Thanks for any help.
Dave

Posted: Thu Aug 20, 2009 11:10 am
by bob@vensim.com
You can use SIMULATE>SETVAL>INTIAL TIME=1997

etc to set time bounds for a simulation. You could also put the time bounds in a spreadsheet, or create a .cin file with the time bounds and use that.

Posted: Thu Aug 20, 2009 1:12 pm
by drw
Thanks a lot Bob - works a treat!

I didn't appreciate you could treat 'Initial Time' as an equation though. But using it this way I can then pass the value for 'initial time' direct from the main control panel of our Excel files. A far more elegant solution.

Thanks again
Dave