question

amtory avatar image
0 Likes"
amtory asked Natalie White commented

how to setup source

Hi! I want to set up sources and meet the following requirements:

1) one source create three types.

2) production batch 20-30.

3) A type next must create B or C type,

B type next must create A or C type,

C type next must create A or B type.

4) everyday A type create 1200-1500,

B type create 1000-1300,

C type create 700-1000.

FlexSim 23.1.2
source
· 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.

Natalie White avatar image Natalie White commented ·

Hi @amtory, was Felix Möhlmann's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.

0 Likes 0 ·

1 Answer

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

How I would build this:

- Determine the quantities of each type for that day at the start of each day. Store them in an array. (For example [1311, 1275, 797])

- Set the inter-arrival time so that the total number of items will be produced within the day.

- When setting the type for an item, look at the type of previous item (stored somewhere, probably a label) and choose the next type from the remaining eligible types. This is the somewhat tricky part since you also have to make sure that you do not get into a situation where the pending quantity of one type is larger than the sum of the other two.

- When the type is known, decrement the respective array by one. When all entries are 0, start over at the start of the next day.


While it is possibly to write this logic in triggers of a 3d source, I would personally use Process Flow. It visualizes the logic so it's easier to follow and also makes it easy to run the logic once per day by setting up a source to create a token at the start of each day.

1686296888741.png


1686296888741.png (71.3 KiB)
· 2
5 |100000

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

amtory avatar image amtory commented ·
Sorry, Can you give me the file for reference?

Because I just started learning flexsim, I haven't learned process flow yet.

Thanks!

-1 Like -1 ·
Felix Möhlmann avatar image Felix Möhlmann amtory commented ·

This looks very much like an exercise (correct me if I'm wrong). So I will not share the complete (see policy on academic integrity).

I get you started I will attach a model with the framework in place but without the actual code that determines which type is created next and at what time.

As I said, you don't have to use Process Flow. The same logic can be attached to a 3d source object. A message loop resets the quantity array label at the start of each day. The rest of the code would go into the innter-arrival time field.

custom_type_source_base_fm.fsm

0 Likes 0 ·

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.