how to setup source

how to setup source

amtory
Not applicable
145 Views
4 Replies
Message 1 of 5

how to setup source

amtory
Not applicable

[ FlexSim 23.1.2 ]

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.

0 Likes
Accepted solutions (1)
146 Views
4 Replies
Replies (4)
Message 2 of 5

moehlmann_fe
Enthusiast
Enthusiast
Accepted solution

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

0 Likes
Message 3 of 5

amtory
Not applicable
Sorry, Can you give me the file for reference?

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

Thanks!

0 Likes
Message 4 of 5

moehlmann_fe
Enthusiast
Enthusiast

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
Message 5 of 5

natalie_white
Not applicable

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