question

night avatar image
0 Likes"
night asked night commented

How do I limit the number of items created by source?

I am aware that normally you would use either the arrival sequence or the arrival schedule to set the arrivals. Which makes use of the table.
But I would like to have random intervals but of a set number of flow items.
I am trying to do a simulation given a set number of flow items how long I would need to clear this amount by adjusting various elements such as including the number of workers, while keeping it realistic by having random intervals.

FlexSim 23.1.3
source
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

·
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered night commented

Either use the schedule or sequence to create a fixed number of items in bulk. Then distribute their arrival in the system by first running them through a processor with random process time.

Or use the inter-arrival mode and close the output of the source in a trigger (On Creation or On Exit most likely) once the target quantity of items has been created.

current.stats.output.value > x      // As condition in the "Close And Open Ports" pick option
· 3
5 |100000

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

night avatar image night commented ·

Sorry for the very beginner questions, I would not be using the schedule nor the sequence method since my items are in large shapes and large quantities. I am choosing the second method where I will close the output of the source in a trigger. So I have set a On exit trigger where I assume this is where I will stop the output if the items created have reached a number say 3 ( for testing). But currently I have a parsing error and from previous experience this means that the variable is wrong. How do i fix this then?1697186639677.png

0 Likes 0 ·
1697186639677.png (57.3 KiB)
Felix Möhlmann avatar image Felix Möhlmann night commented ·

Most objects in FlexSim track their input and output, the source included. The most straightforward way to read the number of outputs of an object is the expression I already included in my answer.

object.stats.output.value

Here "object" is a placeholder for a pointer reference to the object whose output you want to read. In trigger functions the object they are defined on can generally always be accessed through the variable current. The stop output option uses this as the default value for the Object field, for example, as shown in your screenshot (the output of current will be closed).

So to read the output value, you can swap in current into the expression above and use it as the condition to close the output.

current.stats.output.value >= 3
0 Likes 0 ·
night avatar image night Felix Möhlmann commented ·

Thanks, doing this I can limit the output, but the value has to be 1 less than the actual value i am going for. It also turns out that there was a similar question posted by someone. https://answers.flexsim.com/questions/64649/modify-the-source-output.html 1697195209718.png

0 Likes 0 ·
1697195209718.png (49.0 KiB)

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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