question

Jungeun W avatar image
0 Likes"
Jungeun W asked Jungeun W commented

reorder task to task executer

Hi

I have 14 AGVs connected to the dispatcher, with looped AGV path.

I want to let AGV receive task by shortest distance queue strategy.


More specifically, if AGV is passing specific points with unloading state, task be reassigned by shortest distance strategy again.


How to let dispatcher assign task again as AGV pass specific control point? All 14 AGVs would move independently.

plz help! Thx!!

FlexSim 21.1.5
tasksequencetaskexecuterassigntask
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 Jungeun W commented

You can copy the AGV's current task sequence to the queue of the dispatcher and dispatch it again. Before that, the AGV should receive a new, preempting task sequence, to overwrite the previous one.

/**Custom Code*/
TaskExecuter te = param(1);
AGV agv = AGV(te);
Object currentCP = param(2);

// Save current time (used to prevent infinite loops)
te.LastUpdate = Model.time;

// Get Task Sequence
treenode TSNode = te.find(">variables/activetasksequence/1");
TaskSequence TS = TSNode;

// Create a copy in the queue of the dispatcher
treenode TSCopyNode = createcopy(TSNode, Model.find("Dispatcher1>variables/tasksequencequeue"));
TaskSequence TSCopy = TSCopyNode;

// Give self new task (to abort travel)
te.DontRepeatWaypoint = 1;
TaskSequence abort = TaskSequence.create(te, 100, PREEMPT_AND_ABORT_ACTIVE);
abort.addTask(TASKTYPE_TRAVEL, currentCP, NULL, 999);
abort.dispatch();

// Dispatch copied sequence
TSCopy.dispatch();

To apply this to multiple control points in the network, I would suggest to use the way points.

ReassignTasks.fsm


reassigntasks.fsm (34.1 KiB)
· 5
5 |100000

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

Jungeun W avatar image Jungeun W commented ·

1669700915165.pngHere is my AGV Path with 14 AGVs and 2 reorder-task points(red circled points).

Let upper straight line be line1 and lower straight line be line 2 which are separated by 2 reorder-task points.

If AGV unload item to line 1, it should directly receive loading-item task from line 1. As there is no task from line 1, it pass through reorder-task point and simultaneously receive task from line 2. AGV should not stop unless it is blocked by another AGV which is located in front of it.


I changed the number of te.DontRepeatWayPoint from 1 to 2, but it didnt work as I expected.. What's the matter of it..?

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Jungeun W commented ·

Your picture didn't upload successfully, so I can't comment on that.

From your description I am not sure why the reorder points are needed. If you are using a dispatcher, in your example the AGV would receive a task from line 2 if those are the only ones available when it finishes its current job.

In general, keeping the AGV moving at all times while looking for work is pretty much exactly what the AGV Process Flow is designed to do. So I would recommend you utilize that instead of a dispatcher as it will greatly simplify the required steps.

https://docs.flexsim.com/en/22.2/WorkingWithTasks/AGVNetworks/UsingAGVProcessFlowTemplate/UsingAGVProcessFlowTemplate.html

0 Likes 0 ·
Jungeun W avatar image Jungeun W Felix Möhlmann commented ·
I try to make it but how to let AGV move in nonstop way? I found that after agv unloading item, it became idle state, and then start to move. i want to get rid of the idle state..!
0 Likes 0 ·
Show more comments