question

Sahar A avatar image
0 Likes"
Sahar A asked Kari Payton commented

How to stop tokens from source after X tokens have been released?

I have a process flow that has an inter-arrival source and I need it to stop releasing tokens after X amount has been released (based on info in a table)? How can I do this but keep my simulation model running?

FlexSim 18.0.3
getdatastatconditional stopinter-arrival sourcespecific number of arrivals
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

Kari Payton avatar image
1 Like"
Kari Payton answered Kari Payton commented

@Sahar A I created an example of 1 way to do it. You can have a loop with a parent token that creates child tokens at time intervals. In the example I put a label on the source token called "count". After the inter-arrival time is completed a child token is created and sent to other "activities". Then in the decide it looks at the count label to see if it's < the number from the table. If yes then it goes through the loop again to make another token. This repeats until the count = the number in the table. Hope this helps.

loop.fsm


loop.fsm (20.4 KiB)
· 6
5 |100000

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

Sahar A avatar image Sahar A commented ·

thanks! That's perfect.

0 Likes 0 ·
Sahar A avatar image Sahar A commented ·

So what I need to do is exactly this but instead of just a number from the table, I need it to be < than the sum of a particular column in the table. Any ideas how I would do this?

0 Likes 0 ·
Cliff King avatar image Cliff King Sahar A commented ·

getdatastat() is a really cool command for returning a calculated value from a set of data! In your case, it would look something like this to sum the values in column 1 of a global table named "GlobalTable1".

getdatastat(STAT_SUM, gettablerows("GlobalTable1"), gettablenum("GlobalTable1", count, 1))
0 Likes 0 ·
Sahar A avatar image Sahar A Cliff King commented ·

Great, thanks Cliff, I found something about this & I tried to use this function before but failed. Do you mind explaining to me each component of the formula?

I understand that it gets the table rows for the table, but then what exactly does it do? (I'm new to this lol)

I guess I want to use this function in an if statement if (token.count < getdatastat...etc) Would that work? Thanks in advance :)

0 Likes 0 ·
Show more comments