AnswerHub Upload Issue
Our AnswerHub community currently has a bug that prevents you from attaching your model or other files to your questions. AnswerHub is aware of this issue and they are working on a fix. Until we receive their patch, you can upload your models and other files to FlexSim's file share site. Include the file name in your question so that we know which upload to reference.

question

Ashlee W avatar image
0 Likes"
Ashlee W asked Ashlee W commented

Paste distribution from Excel: Getstream parameter error

Could someone please help me figure out what is going on with my FlexSim 2022 model?

I am trying to paste a distribution in from excel using the same format it uses when it creates the distribution itself but I keep getting an error saying the parameter for getstream is wrong. It works if I remove the getstream from the distribution altogether but I would like it to use that.

When it creates the distribution is it writing a script that begins with "Object current = param(1)" which is what appears in the arrivals table. But the proper distribution appears in the text box below, which is the same format I have used to create the table I want to paste in from Excel. See the pic below. The top works and is what Flexsim creates. Bottom is what I want to paste in.

Model also attached.

WaitingRoom.fsm

capture.png

FlexSim 22.1.0
exceldistributionspatient arrivalsgetstream
capture.png (4.5 KiB)
waitingroom.fsm (888.0 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

·
Matthew Gillespie avatar image
0 Likes"
Matthew Gillespie answered Ashlee W commented

There's actually several lines of code in that table cell when you choose a distribution. If you click on the Edit Code button next to the cell when you click on it, or you click Ctrl-A to select everything in the cell before copying the cell, you'll see the full code looks like this:

Object current = param(1);
treenode activity = param(2);
int rowNumber = param(3); //The arrival entry row number
int cycle = param(4); //The current cycle through the arrivals table (first iteration cycle = 1)
treenode processFlow = ownerobject(activity);
/***popup:StatisticalDistribution*/
return
/***tag:distribution*//**/poisson/**//**/(/**/
/***tag:par1*//**/10.0/**/
/***tag:par2*//**/, getstream(activity)/**/
/***tag:par3*//**//**/
/***tag:par4*//**//**/
/***tag:par5*//**//**/
/**/)/**/;

Whereas in the text box below it you just see:

poisson(10.0, getstream(activity))

Most of the stuff in that multiline code snippet is just meta text to make it show up right in the distribution popup. It basically boils down to this:

treenode activity = param(2);
poisson(10.0, getstream(activity))

So the easiest thing to do to get a single line to paste in from Excel is to change activity to param(2) like this:

poisson(10.0, getstream(param(2))
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Thank you! That worked great!!
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.