the command "SIMULATE>SIMULATE>SETVAL"

Use this forum to post Vensim related questions.
Post Reply
niain
Junior Member
Posts: 5
Joined: Mon Apr 24, 2017 11:46 am
Vensim version: DSS

the command "SIMULATE>SIMULATE>SETVAL"

Post by niain »

I developed a Java project ,and I want to use the command "SIMULATE>SIMULATE>SETVAL"to change a Lookup. The help document give an example "SIMULATE>SETVAL|mylookup((0,0),(1,1),(2,2),(5,5))",but there are many (x,y) that I want to change,it's impossible for me to type it by hand.
How can I solve this problem?
Administrator
Super Administrator
Posts: 4589
Joined: Wed Mar 05, 2003 3:10 am

Re: the command "SIMULATE>SIMULATE>SETVAL"

Post by Administrator »

Where do you have the x,y pairs stored?
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
niain
Junior Member
Posts: 5
Joined: Mon Apr 24, 2017 11:46 am
Vensim version: DSS

Re: the command "SIMULATE>SIMULATE>SETVAL"

Post by niain »

Administrator wrote:Where do you have the x,y pairs stored?
An two-dimension Array。
Administrator
Super Administrator
Posts: 4589
Joined: Wed Mar 05, 2003 3:10 am

Re: the command "SIMULATE>SIMULATE>SETVAL"

Post by Administrator »

Why not run a loop to construct the string to pass to Vensim?

something like

Code: Select all

strVensimCommand = "SIMULATE>SETVAL|mylookup(";

for ( i = 0 ; i < UpperBound ; i++ )
{
        strVensimCommand = strVensimCommand + "(" + arrayX[i] + "," + arrayY[i] , "),";
}
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
niain
Junior Member
Posts: 5
Joined: Mon Apr 24, 2017 11:46 am
Vensim version: DSS

Re: the command "SIMULATE>SIMULATE>SETVAL"

Post by niain »

Administrator wrote:Why not run a loop to construct the string to pass to Vensim?

something like

Code: Select all

strVensimCommand = "SIMULATE>SETVAL|mylookup(";

for ( i = 0 ; i < UpperBound ; i++ )
{
        strVensimCommand = strVensimCommand + "(" + arrayX[i] + "," + arrayY[i] , "),";
}
oh,that's a good idea ,thank you very much. :D :D :D
Post Reply