question

Pieter Cecat avatar image
0 Likes"
Pieter Cecat asked Adrian Haws commented

Push items from queue to two different sinks

Hi everyone

I recently joined this forum in an attempt to learn more about FlexSim. I started building my own production planning model [time unit = hours | planning horizon = 6 months] and already encountered my first problem. As I cannot seem to find the solution by using the options from the pick list, I suppose there is some custom coding necessary. I personally don't think it is really complex, but as I have little experience in doing this, I am counting on some help.

I am trying to push items from a queue to 2 separate sinks (see below). This has to happen at predefined times, more specifically after every month (= 720 hours). I already defined a global integer variable for Time (initial value set to 0) as I suppose this will be needed to specify the delay between two months. In other words, inventory accumulates throughout the month, and a certain quantity is released at the end of every month to fulfill that period's total demand (= fixed + random). Then, inventory is increased again by the next month's production, in order to fulfill the next period's demand as well as possible backorders from previous periods. Backorders (=unfulfilled orders) thus have to be automatically added to the next period's demand.

Items should be pushed to the first sinks based on a global lookup table which contains 6 values, each column corresponding to a certain month's fixed demand. The monthly number of items pushed to the second sink on the other hand, should be random and based on a normal probability function with specified mean and standard deviation (e.g. mean = 25 | st dev = 2). The priority rule regarding which sink's demand to fulfill first could be random.

2 seperate sinks

However, perhaps it is easier to combine these 2 sinks (see below). The number of items to be pushed to the sink at the end of each month should then be equal to the fixed number from the global lookup table, augmented with a random number based on the normal distribution with known parameters.1 combined sink

I personally think the second option is easier in order to count the backorders and add them to the next month's demand.

Final remark:

It would also be great if I could use the same random numbers that were generated for the random demand (based on the normal distribution with known parameters) as the monthly release quantity of a 'source' somewhere else in my FlexSim model. I suppose it is possible to write these 6 generated random numbers to a table and access them from there, but don't know exactly how to do this.

Thank you in advance for all your time and support. I strongly appreciate it!

Kindest regards

Pieter

FlexSim 16.0.6
sinkrandom streampush
jhzud.png (4.6 KiB)
vowka.png (5.2 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

Adrian Haws avatar image
1 Like"
Adrian Haws answered Adrian Haws commented

Pieter,

First, thank you for describing your model clearly. Process Flow is a great tool for executing custom logic in one place without the need for custom code. I've created a sample model using Process Flow that performs what you've described. Items are created in the queue, then pushed to a list. There is then a separate source that creates one token which loops through every 720 seconds. Labels are created on that token to set the demand based on fixed demand, random demand, and backorders. Backorders are defined as demand - items pulled from list. I've also included another source with quantity defined from a global table.

Let me know if you need any clarification. Model is attached.


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