question

Marzanne avatar image
0 Likes"
Marzanne asked tannerp converted comment to answer

Batching and Resources: Can I sink one token from a batch and continue?

I am working on the left side of the attached process flow model: processflowbatching.fsm

The process flow has three different loops, each with up to 6 stops. I have only been working on the blue loop so far (stop 1 and 2 are the most up-to-date), the rest should follow all the same logic once I figure it out. The batch activity at the beginning of the loop will batch up to 6 tokens (usually 4 tokens), and I would like to create logic that does the following:

  1. Only one resource is acquired per batch (currently, four resources are acquired for the four tokens in the first batch).
  2. One of the tokens is processed at Stop 1, goes through the sink, and the remaining tokens travel with the resource on to Stop 2.
  3. Once all of the tokens are processed, the resource is released.

Creating a connection from a sink to a decide activity seems to be impossible, so I'm thinking that I might have to use some combination of label assignment and conditional decides.

I am also up to suggestions on how to remove all of the connections between the activities in my process flow-- I know it's kind of overwhelming with all of the arrows, but I've tried using lists, global tables, etc. and I can't quite figure out the logic to push and pull tokens without the manual connections.

Thanks in advance for any advice or recommendations you might have!

FlexSim 19.0.0
batchingresourcesrelease tokenbatching grouping
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

Joshua S avatar image
0 Likes"
Joshua S answered

I'll keep looking at your model. One way to condense it so it is easier to look at it is to create 1 delay activity per group of Stops. Replace the delays code with this:

  1. Object current = param(1);
  2. treenode activity = param(2);
  3. Token token = param(3);
  4. int stream = getstream(activity);
  5. double randomnum = uniform(0, 100, stream);
  6. double total = 0.0;
  7. for(int i=1;i<=Table(token.TableStop).numRows;i++)
  8. {
  9. total+=Table("token.TableStop)[i][1]*100;
  10. if (randomnum<=total)
  11. {
  12. return Table(token.TableStop)[i][2];
  13. }
  14. }
  15. return 1;

You would have a label on the token called "token.TableStop" that would be a string value referencing the correct table. Your tables would also have the Percentage in the first column, and the delay time in the second. If the delay time is a distribution, then select the second column and convert the data type to flexscript.

· 4
5 |100000

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