XiomaraG avatar image
XiomaraG asked Jason Lightfoot commented

Loading items by type from a queue to a truck

Hi, everyone!

I'm currently working on a simulation where a different truck assigned to a customer arrives at our warehouse every hour. During that hour, the truck is supposed to pick up specific items from a queue for that particular customer. The queue is already programmed so the items that are here corresponds to the customer assigned to that hour.

For instance, between 8 and 9, the queue exclusively prepares products of type 9 and there's a truck type 9 that picks them up. Initially, I thought the truck arrivals to align with this process in the following manner:


The triggered event is the entry to the queue where all the items of that type are ready to be collected. For the Decide I thought setting this condition:


Basically if it comes to the queue a product that doesn't match with the customer assigned to the truck, the latter just leaves. The problem is that the first bus leaves but when the next one arrives (product "Cliente" 10), it doesn't pick up the products that are ready:

That's why when I'm going to check the statistics, at 3600 s there's no product sent.


I think there's a problem with the conditional or its position in the process flow. I also tried with lists as you can see:

However there are some errors:
So my question is:
1. ¿could you help me develop a simple way to do this? The important thing is that when the next truck arrives it picks all the products corresponding to its customer and waits for an hour until the other truck comes.
I've been working really hard but there are lots of new concepts that are a bit difficult to understand for me.

Thanks in advance for all your help!!

FlexSim 22.2.0
1701307573212.png (17.7 KiB)
1701307788144.png (24.6 KiB)
1701307905953.png (267.8 KiB)
1701308455957.png (29.2 KiB)
1701308489842.png (26.0 KiB)
1701308775857.png (55.5 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.

Joerg Vogel avatar image Joerg Vogel commented ·
From classic 3D point of view, your customer is pulling products of his type. Your queue sends on behalf of this request products to the customer. If the option Use Transport is active in sending queue, the queue can request a transport upon a pointer to a dispatcher or taskexecuter (truck). If you want to request a distinct truck then you can evaluate the local variables in source code header of Use Transport source code editor window and return a pointer or reference.
0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ commented ·

Hi @XiomaraG, was Jason Lightfoot'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

Jason Lightfoot avatar image
Jason Lightfoot answered Jason Lightfoot edited

I'd use lists but it looks like your pull from list SQL expression is referring to truck2 - and not the puller. Try making the truck the puller and refer to the puller.Cliente in the WHERE clause of the query.

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

XiomaraG avatar image XiomaraG commented ·

Hi @Jason Lightfoot I've prepared an example.fsm of what I'm trying to do. There are two possible options:

1. The truck comes each hour and the transporter takes all the product according to the truck's type "Cliente" and load these items in the truck
2. The truck comes at the beginning and waits during an hour while the transporter loads each product in the truck.
However as you can see, the truck is somehow entering to the list, I don't know why.
Thank you so much for your attention and time!

0 Likes 0 ·
example.fsm (63.6 KiB)
Jason Lightfoot avatar image Jason Lightfoot ♦ XiomaraG commented ·

You query would need to be:

WHERE Cliente == {Table("TypeSchedule")[Model.dateTime.hour+1][2]}

These braces {} tell FlexSim to interpret that part of the expression as FlexScript and not a query clause. But what happens to backorders at the change of hour ? You'd need the list to re-evaluate backorders on a global event that happens every hour (in the list properties Advanced tab)

Then you're acquiring an abstract resource and trying to give it a load task. The resource should, I guess, be the forklift - so it should reference that.

You should do some of the tutorials before posting more questions. We encourage students to look through the training materials of their academic institution and those in the online help.

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.