Reading a single variable during a game

Use this forum to post Vensim related questions.
Post Reply
miller2158
Junior Member
Posts: 7
Joined: Tue May 12, 2009 10:18 pm

Reading a single variable during a game

Post by miller2158 »

I am using VB to control a game (really a simulation with discrete time stops) so that I can process data/results from the current time step. I then will rewrite the .cin/.gin file and run the next time step. I have some complex decision processes that are much easier to code and run in VB. My issue is that I can't figure out how to read a single variable value from my current time step without dumping the .vdf file and picking out my single value.

I have no user interface with the game, I am only using VB to control it.
Administrator
Super Administrator
Posts: 4838
Joined: Wed Mar 05, 2003 3:10 am

Post by Administrator »

vensim_get_val will get you what you want.

http://www.vensim.com/documentation/html/26215.htm

Tony.
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

You can also use the vensim_start_simulation, vensim_continue_simulation and vensim_finish_simulation instead of sending the command MENU>GAME- this will be faster and probably easier to code. No need to use .gin files in this case just use SIMULATE>SETVAL (the variables being set do need to be gaming variables, and the simulation needs to be a game.

Faster still would be to write your logic as an external function, though this is trickier than calling the Venapp if you are working in VB.
Post Reply