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.

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.

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