Batch in queue with process flow.

Batch in queue with process flow.

kari_payton
Not applicable
4 Views
6 Replies
Message 1 of 7

Batch in queue with process flow.

kari_payton
Not applicable

[ FlexSim 17.2.3 ]

In my model I have a forklift taking trash to a big scrap zone. I want the forklift to collect all items in the trash can (queue) and transport. However I'm having trouble implementing the logic.

I am trying to batch incoming items in the queue and send it to a list so the forklift knows what bins need emptying. Is it possible to batch objects created in process flow into a queue in 3D?

I also tried having the forklift request 100 items of scrap and only require 1 item. However it's only pulling 1 item and leaving the other 4 on the list, for example.

Accepted solutions (1)
5 Views
6 Replies
Replies (6)
Message 2 of 7

Jacob_Gillespie
Autodesk
Autodesk
Accepted solution

Here is a small sample model I made. I made it request 100 items but only require 1. The tricky thing is you can't pass an array into the load and unload activities.

batchforklift.fsm

Message 3 of 7

kari_payton
Not applicable

Thanks Jacob!

0 Likes
Message 4 of 7

jason_merschat1
Not applicable

Hi @Jacob Gillespie

This line is very interesting token.i == 1 ? token.pulled : token.pulled[token.i]

Can you explain what this is doing please?

Thanks, Jason

0 Likes
Message 5 of 7

joerg_vogel_HsH
Mentor
Mentor

it is the short structure of the statement if (logical condition) true instruction else false instruction.

logical condition ? true instruction : false instruction 
Message 6 of 7

Jacob_Gillespie
Autodesk
Autodesk

When you pass an array into the load or unload activity then only the first element of the array is used. So if the index (token.i) is 1 then I made it use token.pulled.

I did it this way because token.pulled is not an array if only one thing was pulled and so token.pulled[token.i] would throw an exception in this case.

Message 7 of 7

philboboADSK
Autodesk
Autodesk

This is known as the ternary operator.

I'm not sure why it isn't documented in the user manual.



Phil BoBo
Sr. Manager, Software Development
0 Likes