question

Murphy avatar image
0 Likes"
Murphy asked Murphy commented

agv deadlock


1726728511596.png

Hello, I bulid a simple model, the agv was deadlocked at CP4 in the graph, when TaskExecuter1 request the CP4 and it had allocated by TaskExercuter2, Did it can re-request another CP? When the distance looks the same.

agv-deadlock.fsm


FlexSim 24.2.0
agvdeadlock
1726728511596.png (259.2 KiB)
agv-deadlock.fsm (38.7 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 Murphy commented

The "On AGV Allocation Failed" event can tell you whether the failure represents a deadlock and if so give you an array of the involved TEs and CPs.

You can use this information to write code that handles the deadlock. Overwriting the return value of the event (option in Event-Triggered Source, return value specified in Finish activity) with a 1 will tell FlexSim that the siuation was handled and suppress the deadlock erro message.

I modified your model so that the AGV whose final destination is not the CP that couldn't be allocated is preempted and searches for a new path while the blocking CP is forbidden to be used through the usage of routing constraints.

agv-deadlock_1.fsm

Be very careful when trying to implement such a logic in a more complex model. It works here because the AGV is guaranteed to find an alternative path that is free. If no path is found you would again be presented with an error. Or worse, if an alternative path is found that also results in a deadlock right away, an infinite loop of the logic would crash FlexSim.

In general, I would advise to first try and prevent deadlocks before they happen by modifying the network or how AGVs find their path before resorting to handling the issue when it does occur.


agv-deadlock-1.fsm (42.3 KiB)
· 4
5 |100000

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

Murphy avatar image Murphy commented ·

Ok, thanks you suggest and I noticed if I set Deallotaion Types in agv network, like Fig1. it's will be avoid deadlock in some extent, but the model collided in this setting. Is there any good solution?

1726793586767.png

Fig 1

1726793726838.png

Fig 2


0 Likes 0 ·
1726793586767.png (60.0 KiB)
1726793726838.png (202.2 KiB)
Felix Möhlmann avatar image Felix Möhlmann Murphy commented ·
The simple solution for this model is to just make the paths go one-way. Every other possible option I can think of does functionally the same. Just in a more complicated and potentially less efficient way. My original answer included, which was mostly meant to showcase the ability of handling deadlocks.
0 Likes 0 ·
Murphy avatar image Murphy Felix Möhlmann commented ·
OK,thanks you share!
0 Likes 0 ·
Show more comments