question

Borja Lorenzo avatar image
0 Likes"
Borja Lorenzo asked Borja Lorenzo edited

Create AVG routes with loops in Process Flow using Resources or Lists

Hello,

I have a simplified model that I am working on. I am assigning stop logics to the AMR TaskExecuter 3 so that it goes to the nodes and waits there for a while. The source is activated based on a calendar.

The problem I am having is that when I make the loop after the Delay, the label in the first Acquire of DeliveryPoint is of type node... but when it acquires the next node, it converts it to an Array, and I have problems with the variable types to read the data.

Could an Array be created in the Acquire of DeliveryPoint Assign to Label? I don't see the option in the contextual menu.

I think this is the problem, but I'm not 100% sure.

I have also worked on the idea with a list. I want the loop to end when the available nodes are exhausted, to provide the output both in the pull activity and in the Acquire. But in the Resource method, I only return the last acquired one, not all of them in the array. In the list method, I get an error in the activity of moving to the sink... but not all of them are returned either. I can't push it when I've already used them because it wouldn't allow me to output when it has gone through all of them. I want to set up the loop to avoid having to repeat activities


Thank you in advance for your comments.

simplificacion-control-area-in-astar-1_4.fsm

FlexSim 24.1.1
agvnetwork nodesacquire resourcelabel arraylooping
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
1 Like"
Felix Möhlmann answered Borja Lorenzo edited

If you create the label that a resource gets assigned with an empty array as the value, the label will stay as an array when acquiring resources.

To return all resources assigned to an array label, choose the "Release All" option in the Release activity.

1738221067679.png

You are currently pushing the token to the list after the loop ends. You should instead be assigning all pulled networks nodes to an array label and then push that array back.

1738221163600.png

In both cases, resource and list, new elements get added to the front of the array. So you would "token.PuntoEntrega[1]" to refer to the newest point. This also means that before returning/pushing the values, the arrays need to be reversed or the network nodes will be acquired/pulled in the wrong order in the next loop.

With all that said, this approach is only useful when there are more than one vehicle doing the loop and only one should stop at each station. In that case you could use a batch activity to wait until all vehicles have finished the loop before refilling the list.

With only one, I would just use a Run Sub Flow activity to visit each NN in order.

simplificacion-control-area-in-astar-1-5.fsm


· 1
5 |100000

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

Borja Lorenzo avatar image Borja Lorenzo commented ·

Hello Felix,

Sorry for the delay in responding. I wanted to review and study the recommendations. I proposed the RunSubFlow solution after posting the question, and after your confirmation, I decided to go with that method. However, I found it very interesting to study and internalize the solutions of Resources and Lists. Your suggestions work perfectly.

I would like to point out and add that:

In both methods, despite reversing the order of the Array before pushing the values to the Resources or List, the order in which they entered was not sufficient for the new reassignment to be progressive, as the second train would take the second value pushed by the first train. In this scenario, delivery point 1 was not assigned first because it was 3rd in the Resources list. To solve this, I created an expression in the case of Resources, and in the case of the list, I added a new field to the Decision Point group (parallel solution) to identify each queue with a number and use it as a sorting criterion in the extraction.

I am sharing the simplified model, in case it can help someone else as it helped me to better understand how the properties of these Process Flow activities work.


Added to this model is another simplified example of control areas. This point is addressed in another published question, for which I leave the link: Area Control in Astar with Label Filtering - FlexSim Community
Thank you very much for your help, Felix.
simplificacion-control-area-in-astar-flujos loops Resources_List_RunSubFlow 20250131_7.fsm

0 Likes 0 ·