question

Mehak V avatar image
0 Likes"
Mehak V asked mary commented

release item from queue on an specific time with specific order

Dear All,

I have a model where I want to release item on an specific time with specific order from queue. e.g. item 3138 at 9.00:10, item 3133 at 9:12:13 and so on. I have store release time and item order in Global table 1.

process-item-on-specific-time.fsm

FlexSim 7.7.4
FlexSim 17.0.4
process timedelaymessage triggeron exit
· 1
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
1 Like"
Jeff Nordgren answered mary commented
@Mehak V

Attached is your model with the changes that I've made.

I changed your global table so that the "Label" is a numeric field rather than a string field. Numerics are much faster to process and easier to work with. I also added a field called "Model Run Time", which is the representation of the actual model run time for the Process Times you have in the table. Again, those are string fields which are much harder to deal with in code than are numeric fields and using strings in code is much slower because everything is converted to numbers in the long run anyway.

All the code is in Queue1. In the OnReset trigger is where the first message is sent back to the queue to release the first flowitem. Then in the OnMessage trigger, the proper flowitem is found in the queue and released. And another message is sent with a delay time between the next flowitem to be released and the current time.

Take a look at the model and see if it is doing what you were wanting it to do. If you have any questions, please let us know.

process-item-on-specific-time-fs1.fsm


· 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.