question

mark zhen avatar image
0 Likes"
mark zhen asked Felix Möhlmann commented

How to use the status of agv to determine decide.

@Felix Möhlmann

I want to add some functions to this model. There are requirements to be passed at two points at the same time. Is it possible to add some priority to judge. For example, whether it is a load state, if yes, it passes first, or if the process is later, it passes first, etc.agv-traffic-control.fsm

FlexSim 23.0.15
agvnetworksprioirty
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 Felix Möhlmann commented

In the zone properties you can define a Queue Strategy that controls which token gets to enter the zone first if there are multiple waiting. The Queue Strategy takes the form of an SQL ORDER BY clause that can depend on labels on the token. So whatever you want to sort the allocation order by must be present as a label on the token before it enters the Enter Zone activity.

capture1.png

In the example I assign the "HasItem" in the Create Tokens activity. If the AGV has loaded an item it has priority to enter the zone. Note that TaskExecuter3 still goes first because it arrives at the area before the others.

agv-traffic-control-2.fsm


capture1.png (7.0 KiB)
· 9
5 |100000

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

mark zhen avatar image mark zhen commented ·

Thank you very much! This is what I want. In addition, I also want to do this, but I still have to perform another function. I added two labels, x and y item, to the model. When executing the priority, consider y first. If both sides are y items, compare the values in yitem. The larger the value, the later. Should I write token.AGV.??agv-traffic-control-2.fsm

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann mark zhen commented ·

To values to order by have to be assigned to the same labels on all tokens. If I understood your example correctly then "Type" correlates to whether "xitem" or "yitem" is used.

In the attached model I thus assign the "Type" to the token and a "Rank" label that either takes the value of "xitem" or "yitem" depending on the type.

These are then used in the Queue Strategy. You can add as many clauses as you want. They are evaluated in order from left to right.

ORDER BY HasItem DESC, Type DESC, Rank ASC

With this expression an AGV with an item has priority over empty ones. If both have an item, the higher "Type" has priority. If both have the same type, the lowest "Rank" can enter first.

agv-traffic-control-3.fsm

0 Likes 0 ·
mark zhen avatar image mark zhen Felix Möhlmann commented ·
please explan custom code!!
0 Likes 0 ·
Show more comments