Cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to tell a Source when to output a specific entity from a table?

Assuming I have a table with different types of entities defined each with an attribute whos value is its ID. I have "attached" this table to my Source to spit out the different entities defined in the table.

 

Assuming a buffer downstream is allocated to each entity with a specific attribute value (ex. 5 different entities = 5 buffers = 5 lines in table), how would one make the source only generate the entities for which their respective buffer is empty?

3 REPLIES 3

Re: Is it possible to tell a Source when to output a specific entity from a table?

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

have a look into the help, how the source is produce MUs; after a MU has exited the source, the source creates an create event and insert it into the event list, so the source pushes the next MU from your list into the model, you cannot select a specific part from your table; to keep it simple use for each buffer one source and add exit controls to the sources; there you can wait, until the connected buffer is empty

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: Is it possible to tell a Source when to output a specific entity from a table?

Thank you so much for the help. A small additional question. If I create a source for each of my parts, is there any way that I can write a big Method which tells each of the different sources to produce an entity only if a certain object in the model is empty? I've been trying for a while but can't quite make it to work.

Re: Is it possible to tell a Source when to output a specific entity from a table?

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor
an easy way is not to use a source; instead create the parts with simtalk in the exit control rear (of the empty object). You need to create only one part at the beginning of the experiment to start the production.
Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net