question

ernesto daniel AG2 avatar image
0 Likes"
ernesto daniel AG2 asked Jeff Nordgren commented

how to create flow items based on a global table?

hello all, I made a model that based on a global table in the "Demand" column, in the output queues manages to limit the maximum content in that amount what I would like is to create that same amount of flow items from the "source" with its corresponding color with the same values of the global table, even I have not been able to achieve it in hours.

i attach my model

Thank you

separacion.fsm

FlexSim 18.2.0
simulation
separacion.fsm (23.1 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

Jeff Nordgren avatar image
0 Likes"
Jeff Nordgren answered Jeff Nordgren commented

@ernesto daniel AG2,

Attached is your model with code that I added in the OnReset trigger of Source1. This code will read the Global Table and put the values into the Source1 arrival table. Is this what you were looking to do?

Thanks.

separacion-jn1.fsm


separacion-jn1.fsm (127.8 KiB)
· 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.

ernesto daniel AG2 avatar image ernesto daniel AG2 commented ·

@Jeff Nordgren

yes! thanks jeff, I was trying for hours without having results Exactly what I wanted,

I thank you very much

Another question, the arrival of source1 at queue1 is what I am looking for

in the same model, how could flowitems enter the processor1 in a random way, satisfying the demand?

0 Likes 0 ·
Jeff Nordgren avatar image Jeff Nordgren ernesto daniel AG2 commented ·

@ernesto daniel AG2,

I hope that I am understanding your question. You want the number of flowitems in GlobalTable1 to be generated randomly and not to exceed the "Demand" value. Is that correct? If so, attached is the modified model that will do what I described above. I added a column to GlobalTable1 called "Created". I use this so when a particular type of flowitem has been created, it will increment the Created value for that type until the Demand amount has been reached. Once all the flowitems for each type have been created, I Stop Source1 to prevent further flowitem creation.

I changed the OnReset trigger of Source1 to clear the values in the Created column of GlobalTable1. And I changed the code in the OnCreation trigger of Source1 to figure out what type of flowitem(s) are to be created for the correct Demand quantity.

Take a look at the model and see if this is what you had in mind.

Thanks.

separacion-jn2.fsm

0 Likes 0 ·
separacion-jn2.fsm (22.7 KiB)
ernesto daniel AG2 avatar image ernesto daniel AG2 Jeff Nordgren commented ·

thank you @Jeff, that's exactly what I was looking for, that for hours I tried and could not do it

Thanks for supporting me

regards!

0 Likes 0 ·
Show more comments