question

Juliette C avatar image
0 Likes"
Juliette C asked Joerg Vogel answered

How to create an order?

simu-autosave.fsmI simulate a warehouse, different products are stored inside different racks.

Each day, 10 trucks come with an order (50 products max/truck) and each product are identify by an item.

I would like to create a list which contains the quantity order of a product for each truck and it will be the transporter that will prepare the order.

FlexSim 19.0.3
order list
simu-autosave.fsm (91.8 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

Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered

You push your available items to a global list. The list contains an expression field called as “myOrder” which you set to dynamic. The expression set a random value for example

duniform(0,1, getstream(current))

If you want to get 50 items you pull 50 of the global list

WHERE myOrder > 0

You find the pulled items in an result array. Please look into the Manual FlexScript Class Reference Array to get an reference to an item for example by pop, shift or splice.

Maybe you want to vary the amount then you can pull by a statistical distribution like duniform

duniform(41,50,3)

for a random range between 41 to 50.

The list must contain a really large number of entries (items) that you can get a complete order of 50 items. If you can’t get a total of 50 items you can repeat the pull several times with a smaller items to pull.

An alternative approach consists of a different evaluation of the list. Your entry expression contains random dynamic values that you use to order the list by this value ASCending or DESCending and you just pull 50 values without any WHERE filter.

5 |100000

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