How to customize Barrier in A* network to allow for multi direct

How to customize Barrier in A* network to allow for multi direct

hicham_elbaz6949F
Advocate Advocate
219 Views
10 Replies
Message 1 of 11

How to customize Barrier in A* network to allow for multi direct

hicham_elbaz6949F
Advocate
Advocate

[ FlexSim 24.2.2 ]

I am trying to create a rule for controlling forklift traffic in a warehouse aisle.

1737657475800.png The aisle is unidirectional by default but can temporarily allow two-way traffic under certain conditions. Specifically, I want to implement the following logic:

  1. When there are no forklifts in the aisle, it can become two-directional to allow a forklift to enter from the opposite direction. like number 2 above
  2. Once a second forklift enters the aisle, it should revert to being unidirectional again to avoid congestion or deadlock with two way. like number 1 above
  3. Here is another example answer by @Jason Lightfoot but this one is using time which is not the case here. @Felix Möhlmann do you have suggestion or solution to this problem. Thank you!

Here is my model loading-1.fsm

0 Likes
Accepted solutions (1)
220 Views
10 Replies
Replies (10)
Message 2 of 11

moehlmann_fe
Participant
Participant
Accepted solution

You could use the same logic I utilize in the article I just posted to let turning cars wait for oncoming traffic. A control area is placed over the aisle. When a request is made, the logic determines in which direction the transporter wants to travel based on its current position. If the area is empty or currently in the correct 'mode', the transporter can enter. Otherwise it has to wait until the area becomes empty.

For this to work properly, you have to make sure that the transporters never turn around inside the aisle and that they leave enough space for other transporters to exit while waiting to be allowed to enter. In the attached model I force them to drive a small loop at the end of the aisle to achieve this.

loading-2.fsm

0 Likes
Message 3 of 11

hicham_elbaz6949F
Advocate
Advocate

Thank you @Felix Möhlmann for your answer. I am going trough the code right now. Interesting model you did post! your approach is definitely going to work if only all pick are in the same Aisle which not the case for mine. The picks always start from the beginning of the Aisle I am doing that by pulling

1737952560480.png

so we always start picking from the beginning of the Aisle. once it finish the available parts in Aisle 1

  1. If it is done it can go to unload either option 2 if no one is in the Aisle, and if there is one it will take option 3 normally.
  2. If the pick if not done the forklift need to picks from Aisle 2 as well after finishing picking parts from Aisle 1 it will do the same thing which is option 2 if no one is in the Aisle and start picking from start point blue. and if there is one it will take option 3 normally.

1737952527332.png

For the Travel location do I need to change X location depends on each Aisle or there an easy way to do that?

1737952941208.png

Here is the example model loading-2.fsm

0 Likes
Message 4 of 11

moehlmann_fe
Participant
Participant
You can of course check the "Mode" of the area outside the request event. After the transporter leaves the aisle, check if it can travel back through it (correct mode or no mode set). If not, send it around the long way by either utilizing an extra travel task to a waypoint to force it to use the long path. Or place a barrier/object in the aisle that you only activate while the transporter is calculating its path.
0 Likes
Message 5 of 11

hicham_elbaz6949F
Advocate
Advocate

@Felix Möhlmann Now it is working properly when I have 2 transporters in Aisle but when I am adding 3 transporters is not working. at time 76 you can see the transporters 3 when there transporter 2 behind it goes to the end of Aisle. but middle transporters 2 goes toward transporter 1 which is not correct bs it is behind. is there a way to logic to work this way. once transporters 2 finish from Aisle 1 it should go like transporter 3 (end of Aisle) always while picking. here is the model loading-2.fsm

1738096460331.png

and for Travel location I using look up using global table it worked, but if there is a way an easy to way to do such as knowing Aisle from storage

1738096753668.png

1738096773701.png


0 Likes
Message 6 of 11

moehlmann_fe
Participant
Participant

You need to split the pick operation by aisle so you can make checks inbetween and decide where to travel before starting the picks for the next aisle (and whether to reverse the pick order for that aisle).

I changed the logic to pull all pallets at once and create an array with one entry per aisle which then contains the pick information for that aisle.

In the subflow example I don't make any checks yet. It currently just forces the transporters to travel to the end of the first aisle after they are done there and then pick from the second aisle in the reverse direction.

The actual logic would be more like: Check mode of area for current aisle -> Travel to respective end of aisle. If there is another aisle, check its mode -> Travel to closest allowed end of that aisle and possibly reverse the pick order -> Do the picks for the next aisle.

loading-3.fsm

There are two ways of getting the aisleID from the rack. Note that in the default addressing scheme the aisleID (and zoneID) are set as "arbitrary" meaning their value is a string and thus can't be used to refer to a row without also adjusting the row headers.

// Use any slot to read the aisleID from
rack.bays[1].levels[1].slots[1].aisleID; // Look up id from tree getvarnode(rack, "aisleID").value;
0 Likes
Message 7 of 11

hicham_elbaz6949F
Advocate
Advocate

@Felix Möhlmann Thank you for the input! for referencing AisleId I did change the scheme address AisleId to number then used "getvarnode(token.Destination, "aisleID").value" which still shows as string not sure if this is a bug or not. I end up using label token.AislePicks[1][4] which shows the Aisle as number

1738175566554.png

For the logic when saying the check the "mode of area for current aisle" you mean CurrentTrafficMode label right? I tried referencing this label many ways keep showing error. "token.AGV.TrafficMode"

it will be no reversing in the logic just always start from first bay ASC order the first transporter who get in the Aisle get priority to use it so if the second transporter is coming to same aisle as transporter 1. transporter 2 should go the way around. then when finishing picking transporter will go to the end of Aisle.

loading-4.fsm

0 Likes
Message 8 of 11

moehlmann_fe
Participant
Participant

"current.CurrentTrafficMode" works in the "Object" Process Flow, because that is an instanced Process Flow, where 'current' refers to the instance object. In a General Process Flow it refers to the flow itself.

I have expanded the example to a point where it works in a somewhat sensible manner. I don't know if this is exactly what you are after. But you should hopefully be able to adjust the logic to your liking from this point.

loading-5.fsm

0 Likes
Message 9 of 11

hicham_elbaz6949F
Advocate
Advocate

Thank you @Felix Möhlmann this is really help I have been trying to make logic in "get areas to block" label once one transporter is assigned the other automatically reroute. as once the first transporter is in the aisle the other ones going to same aisle will go way around. Do you have any suggestions? Thank you!


1738681780972.png

0 Likes
Message 10 of 11

moehlmann_fe
Participant
Participant

If I understand you correctly then the difference would just be that the aisle must be empty (mode == 0) for the forklift to be allowed to use ít for the return trip.

loading-6.fsm

Be aware though that timing can always become an issue with the current logic. The mode is checked before the travel starts. If the mode changes afterwards, the transporter will not reroute.

0 Likes
Message 11 of 11

hicham_elbaz6949F
Advocate
Advocate

Thank you @Felix Möhlmann yes definitely time is an issue here. I will go through it and see how it will be. if you have other suggestions that will be helpful. Thank you again for helping!

0 Likes