question

Cenk ZR avatar image
0 Likes"
Cenk ZR asked Cenk ZR commented

How to control the source based on processing time conditions

Hello,

I have a simple model with a source, queue, processor, and a sink. The objects are getting the label "ProcessTime" on creation in the source. "ProcessTime" values are set according to lognormal distribution. The processor uses the value of "ProcessTime" for processing time. What I could not do but want to implement is that as follows: before releasing the next object, I want to sum the "ProcessTime" values of the objects that are currently on Queue1 and the "ProcessTime" value of the next object to be released. If this "Total ProcessTime" is under a limit (let's say 50), then I want to release the object and continue on processing. Otherwise, I want to wait for releasing the next object until this "Total ProcessTime" becomes under 50. If someone can help me with this problem, I would be appreciated. Thank you very much.

I am also attaching my flexsim file.

example.fsm

FlexSim 19.0.8
queuesourceconditional decideprocess timeclose and open ports
example.fsm (34.4 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

Braydn T avatar image
0 Likes"
Braydn T answered Cenk ZR commented

@Cenk ZR

I would write some custom code that iterated through the subnodes of the queue. The .subnodes command returns an array with all the subnodes of the item, which in your case would be the boxes in the queue. You could do a for loop that iterates through the array, sums the values, and then opens or closes the port. I would make this fire OnProcessFinish of the Queue. The first item in the array at will be the next item that is leaving the queue.

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

Cenk ZR avatar image Cenk ZR commented ·

Thank you very much for your help, it worked with custom code.

0 Likes 0 ·