question

Keter avatar image
0 Likes"
Keter asked Keter commented

Agent model not working on redirectCP

Hello,

I want to use agent system to redirect when two agv are at the same path as first file. However, the agent system I applied didn't work. Hope I can get some suggestion, thanks!


Ori_redirectagvtosiding-v21.fsm

redirectagvtosiding-v21 - agent_added.fsm

FlexSim 23.1.4
agvagent systemredirectcp
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 Keter commented

I think the agent system is not a good fit for what you are trying to do. Determining whether the TE actually needs to move to the siding when the proximity trigger fires is complex and, as you experinced, prone to errors and unforeseen issues.

Your original solution of reacting to a failed allocation is the much better approach. Since the agent model is saved in version 23.0 you can benefit from added functionality of this event. There are two additional parameters, one that denotes whether the failed allocation leads to a deadlock and the other stores an array of all involved task executers and control points/areas.

So you can set the source to only create a token if the situation actually represents a deadlock, make one of the TEs move to the siding and, importantly, override the return value of the event with a 1 to suppress the error message about the deadlock. A 1 as return value essentially tells FlexSim that you have handled the situation.

redirectagvtosiding-v23.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.

Keter avatar image Keter commented ·

Apprecite the instruction! Then, is it possible to use agent system to trigger PF flow for redirecting?

Therefore, I can set redirectCP earlier.

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Keter commented ·
Technically yes, you can create a token in any activity from code. But I would still advise against using the agent system. I would instead react to an AGV allocating a CP at the start of the two way path (at either side). By checking its destination (or through other means) you determine in which direction it travels along the path. The created token would then in a zone until the AGV leaves the path by deallocating a CP at the other end. If in the mean time a second AGV enters the path from the other direction, you can check the zone content, see that there is an oncoming traveller and redirect one of them to the siding.
0 Likes 0 ·
Keter avatar image Keter Felix Möhlmann commented ·

Thanks for the advice!

0 Likes 0 ·