question

Ely K2 avatar image
0 Likes"
Ely K2 asked Jeanette F edited

How to combine tokens from different sources in process flow

I need to combine tokens from mulitiple sources and cannot figure out how to do so. For Example:

I have one source creating tokens of "People" and one creating three sections of "vaccines". How do I take the person token (1) and combine with one of the three available shot types (A, B or C). The person can only have one shot. and then release one new token that has their two labels. Such as person 1 gets shot A and the two tokens combine and releases a token labeled 1A. Thanks!

FlexSim 19.2.4
tokensbatchcombiningsourcescomining
· 2
5 |100000

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

Joerg Vogel avatar image Joerg Vogel commented ·
A batch activity can combine tokens. You let enter three and a single batched token leaves the activity. If you need to collect your tokens from different activities then you preempt those tokens into the batch activity.

Alternatively you can collect just the data and then you can let exit not necessary tokens to sink activities or you destroy them.

0 Likes 0 ·
Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Ely K2, was Roi Sánchez's answer helpful? If so, please click the red "Accept" button at the bottom of one of their answers. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

Roi Sánchez avatar image
0 Likes"
Roi Sánchez answered Roi Sánchez commented

Hello @Ely K2, I attach you a model with a possible concept solution to what you need. I basically used a list to push vaccines to it and let people tokens to pull their needed vaccine type from it. As far as I understood, you also need to know how to "batch" information regarding a personId label and its vaccineType so I used an Assign Labels activity to do it.

If this is not what you are looking for, could it be possible for you to upload the model so as to fully understand what you need?

21.1 tokens concept vaccines.fsm


· 5
5 |100000

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

Ely K2 avatar image Ely K2 commented ·

Hello @Roi Sánchez . Thank you for your response. While your example model was very informative, I am not sure if it will fit in the way I need. I tried to upload the model and pictures but it was 'denied' so I will keep trying to add those but will explain further for now:

I have vaccine shipments coming from separate facilities (represented as sources). These tokens are then separated (Decide activity) to different regions. Next the shipments are separated by vaccine type (Decide: AZ or Pfizer). I then used a (Batch) to separate the vaccine shipment token (one token) into 100 single vaccines (100 tokens still with the vaccinetype label).

On the opposite side of my process flow I have a (Source) to create tokens representing people. The people are assigned one of the following labels: NeedVaccine, Need1Dose, Sick, or Vaccinated). Based on their label they will need to:

NeedVaccine: get one shot [*Need Vaccine Status label to change to Need1Dose] go to a delay, and then receive a second shot of the same type [*Need Vaccine Status label to change to Vaccinated] , move to vaccinated delay, move to sink

Need1Dose: get one shot of previous vaccine, [*Need Vaccine Status label to change to Vaccinated] move to "vaccinated" Delay, Move to Sink

Sick: Move to "Sick" Delay, [*Need Vaccine Status label to change to Need1Dose] move to get one dose, [*Need Vaccine Status label to change to Vaccinated] move to "vaccinated" Delay, Move to Sink

Vaccinated: Move to Sink

....

My issues start to arise when trying to give a vaccination of a type (ex AZ or Pfizer) from one activity to two groups (needvaccine) and (need1dose). Additionally I will need to label the token with the person's age group and vaccine type to ensure they are getting one of the shots they qualify for and their second dose is of the same type as the first.

I will eventually expand this model to include multiple regions and vaccine types with different conditional parameters, but I am welcome to any suggestion to improve this model for better compatibility/function.

Apologies, I am a novice FlexSim user and all of the tutorials, websites, and videos I have gone through do not seem to go into the depth/complexity I need.

Thank you.

0 Likes 0 ·
Roi Sánchez avatar image Roi Sánchez Ely K2 commented ·

As far as I see, without taking a deeper look at your model, I guess your ploblem has to do with the Batch activities. Sometimes, you are batching tokens that are all referred to people and sometimes tokens that all of them are referred to vaccines. It is hard to control the tokens this way.

Thats why I use a list to deal with these circumstances. The person token tries to pull its needed vaccine type (if needed) from a list and so on. I encourage you to take a look at my previous attached model and try to understand how the lists work in FlexSim.

0 Likes 0 ·
Ely K2 avatar image Ely K2 commented ·

Attached is the model, thanks!

Flexsim model image.PNG

Vaccine Model 3.fsm

0 Likes 0 ·
Ely K2 avatar image Ely K2 commented ·

Hello @Roi Sánchez

I took your advice as to looking at using the List function rather than the Batch function. In the example model you provided, you showed a way to create a custom label, however it does not seem to pull any of the text labels (only the numeric values). When I tried to apply this to my models I kept receiving errors. As you can see below in the screen shot, when I run your model the vaccine Type is not carrying into the new label. the 2_0 should read 2_B. Is there a way to apply this concept to a string of text as compared to simply integers? Thank yo.

1624620696925.png


0 Likes 0 ·
1624620584596.png (59.0 KiB)
1624620595369.png (59.0 KiB)
1624620696925.png (59.0 KiB)
Roi Sánchez avatar image Roi Sánchez Ely K2 commented ·

If you want to compose a string made of strings you just need to use the "+" command:

string myFirstString = "Hello";
string mySecondString = "World";
strint finalString = myFirstString+mySecondString;
return finalString; //HelloWorld
1 Like 1 ·