User Input

Subscribe to User Input 5 posts, 4 voices

 
?path=tsarnowski&height=32 Thomas Sarno... 27 posts I'm building out a sim where a user needs to input 3 price inputs per week for 4 weeks (I'm considering this one step within the simulation).  The simulation takes these 12 prices and computes profitability, etc.  Right now I have 12 input fields, each referenced by it's own forio variable.  Is there a) an easier way to input these 12 price fields and b) can I utilize an array so I don't have to keep track of 12 prices and perform operations on all to get a 4 week summary result?  Any examples you can point me to?

Thanks,
Tom
 
?path=wglass&height=32 Will Glass-H... Administrator 206 posts Hi Thomas,

A Forio array is perfect for this.  Define a range

R pricesegment = 1..12

Then define decisions and variables that will be automatically repeated over that range

D Price Input[pricesegment] = 100
V Sales[pricesegment] = 1000
V Revenue[pricesegment] = Price * Sales

All of the above have 12 different values.  For more info, see
http://forio.com/broadcast/docs/writing_models/modeling_with_arrays.htm

 
?path=billy&height=32 Billy Schoen... Administrator 255 posts Hey,

I have built for you a good example sim which you can copy from.

This model uses an array, and then 2 range controllers (1 for each range) and a decision input to set all 12 decisions

http://forio.com/simulate/billy/array-demo/run/

Billy
 
?path=mbean&height=32 Michael Bean Administrator 65 posts Billy's example can be copied into your own account from here:
http://forio.com/simulate/billy/array-demo/copy
 
?path=billy&height=32 Billy Schoen... Administrator 255 posts Hey,

Let me know how it goes, or if you need anything else.

Billy

Please log in to reply to topics.

Forums Support