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.