question

Yokota T avatar image
0 Likes"
Yokota T asked Yokota T commented

How to implement item sorting by AGV using only 3D model settings

Hello all,

I am currently working on a transport model for an AGV.

agv_distribution.fsm

agv-model.png

I want to implement a process that the AGV picks all items in Queue1 when it arrives at Queue1 and distributes them to different destinations for each Type. If the AGV has Type 1 items, move to "Destination_Type1" and unload all Type 1 items, then move to "Destination_Type2" and unload all Type 2 items.


I would like to know if there is a way to implement such a process using only the settings of the 3D model, without using any process flow or scripts.


At first, I thought that if I selected "Prioritize of distance" in the Queue Strategy of Task in TaskExecuter, I could get the desired behavior. However, when I actually tried it, I found that if the Type of the last item loaded is 2, the movement to "Destination_Type2" is prioritized. (I have understood the logic behind this behavior by checking the "activetasksequence" and "tasksequencequeue" attributes.)

agv-model-result.png


Thank you.

FlexSim 23.0.9
agvtasksequencetasksequence queue
agv-model.png (137.0 KiB)
agv-model-result.png (203.6 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

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Yokota T commented

The Queue Strategy is only used when the task executer chooses a new task sequence to begin/resume from its task sequence queue.

After the loading the final item the task executer does not choose a new task sequence. So the last item loaded is always unloaded first.

To work around this, you can customize the Break To function. When a task executer starts a Break task, this code is executed and searches for other task sequences in the task queue that fulfill the specified condition (in the default case, any task sequence without completed tasks). If no such task sequence is found, the code returns NULL and the current task sequence resumes with the next task.

You can use this by generating a 'dummy' task sequence and return that when the code would normally return NULL. The task executer then starts and immediately finishes this dummy task which means it will then use the Queue Strategy to determine which task sequence to start/resume next.

agv-distribution-fm.fsm


· 3
5 |100000

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

Yokota T avatar image Yokota T commented ·

@Felix Möhlmann, Thank you for your prompt reply. I understand the workaround mechanism you suggested.

Just to confirm, if I do not use the process flow, am I correct in assuming that the only way is to edit the code directly?

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Yokota T commented ·
Yes and no. It doesn't have to be the Break To function (could also use triggers on the task executer for example) but I don't see how this could be done without some manual coding.
0 Likes 0 ·
Yokota T avatar image Yokota T Felix Möhlmann commented ·

I understand. The answer is sufficient for the present situation. Thank you very much.

0 Likes 0 ·