I have not explained well, I am trying to simulate like this:
1º Load model
result = vensim.command( "SPECIAL>LOADMODEL|C:\\Documents and Settings\\miriiam\\Escritorio\\PROYECTO\\mariaje\\MODELO\\ACI118MO00\\CIMD9.vmf" );
----ok----
2º store the initial values
result=vensim.get_data("base.vdf","precios[producto1,competidor1]","TIME",precioinicial1,tval,36);
cprecio1.setText(Float.toString(precioinicial1[0]));
----ok-----
3º simulate
result = vensim.command( "SIMULATE>RUNNAME|base" );
-------ok-------
4º Try to send values
PrecioInit1 = cprecio1.getText();
vensimCommand = "SIMULATE>SETVAL|precios [producto1,competidor1] = " + PrecioInit1;
result = vensim.command( vensimCommand );
-----failed-----
5º run
result = vensim.command( "MENU>RUN|O" );
6º store the result
tpoints = vensim.get_data( "base", "EBITDA[competidor1]", "TIME", EBITDA, tval, 36 );
My problem is in 4º point.
someone could help us??
Thank you very much
[Edited on 9-30-2008 by vero]
[Edited on 9-30-2008 by vero]
help with variables using .dll
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
The reason it fails is because "precios" is a gaming parameter (not a constant) and as you have not started a game, you cannot set the value. You can only set these once a game has started.
Those calls will work as soon as you have executed the following
result = vensim.command( "MENU>GAME" );
Now if you call
vensimCommand = "SIMULATE>SETVAL|precios[producto1,competidor1] = " + PrecioInit1;
result = vensim.command( vensimCommand );
It should work.
Those calls will work as soon as you have executed the following
result = vensim.command( "MENU>GAME" );
Now if you call
vensimCommand = "SIMULATE>SETVAL|precios[producto1,competidor1] = " + PrecioInit1;
result = vensim.command( vensimCommand );
It should work.