question

Kenny12392757 avatar image
1 Like"
Kenny12392757 asked Jeanette F commented

What is the DEFAULT AGV traffic control logic and dispatching method in Flexsim?

  • I found that Flexsim seems to use the Dijkstra algorithm, which selects the shortest path when moving, and there is no certain priority (heap structure) for selecting the shortest path. I don't know if this is correct.
FlexSim 22.2.0
agvagv pathagvcontrol
· 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.

Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Kenny12392757, was anthony.johnson's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

anthony.johnson avatar image
2 Likes"
anthony.johnson answered

https://docs.flexsim.com/en/22.2/Reference/Tools/AGVNetworkTool/AGVNetwork/AGVNetwork.html#customizationDelegate

The AGV system uses a "lazy" dijkstra's algorithm to cache routing tables, stored by destination. When you reset your model, all cached routing tables are cleared. Then when an AGV must travel to a certain destination, if that destination does not have a cached routing table, it will build a table on-the-fly using dijkstra's algorithm, and then store it off for later reuse. This table defines 'cost' and 'next' routing values for getting from every point in the AGV path network to that destination point. A destination may actually have multiple routing tables, where each table is uniquely addressed by a tuple key based on conditional rules.

The AGV system also allows for more dynamically built tables, where a route to a destination is resolved using the A* algorithm and is completely recalculated on every travel operation. This mode is enabled either when the shouldBuildCustomRoute hook returns 1, or when you have defined dynamic routing constraints in the system.

https://docs.flexsim.com/en/22.2/Reference/Tools/AGVNetworkTool/AGVNetwork/AGVNetwork.html#cost

By default, the cost to travel a section of path is equal to the distance of that section. Alternately, if you select Divide By Speed, it will divide the distance by the speed a given AGV will travel along that path. The result is that the AGV will travel the fastest route instead of the shortest route.

You can also select Multiply By Custom Path Cost and enter a path-dependent expression. The algorithm will then multiply the cost by the result of the expression. The most common use for this would be to put labels on various paths in your network that give certain paths priority over other paths. The algorithm will then favor traveling on certain paths over others. Here, an expression result of 1 would use the standard cost, an expression of 3 would triple the cost, and so forth. Note that, if the expression result is 0, it will use the standard cost. Also, if you use A* mode, the path multiplier should always be greater than or equal to 1. This is required for the A* heuristic to guide the algorithm properly to the destination.

Path-based costing is assumed to be static. When the system needs a routing table to a destination, it will only build it once and cache it off. Subsequent routing will use the cached table. This means that you can't simply change path-dependent costs during a simulation run and assume they will work. It will use whatever the path-based costs were the first time the table was built, not on subsequent changes. However, you can use path-dependent costing, in conjunction with conditional rules, to achieve this goal.

The system creates a tuple by evaluating each conditional rule at the beginning of a travel task. The tuple is a key into a map of routing tables. The system will use a cached table if the table for the given tuple key already exists. If the table does not yet exist, the system will build and cache a new route. Thus, if you want your path costs to be dynamic, you can associate a given path cost configuration with a conditional rule. To use that configuration, set all the path cost values to the configuration, then turn on the conditional rule. Then once the routing table has been calculated, reset the path costs back to their default values, and turn the conditional rule off.

https://docs.flexsim.com/en/22.2/Reference/CodingInFlexSim/FlexScriptAPIReference/AGV/AGV.AllocatableObject.html#Property-routingConstraint

The routingConstraint property takes one of the values of AGV.RoutingConstraint. Setting this value makes the AllocatableObject into a dynamic barrier for routing purposes. The default value (AGV.RoutingConstraint.None) means AGVs can travel through the object. Setting it to some other value, e.g. AGV.RoutingConstraint.Blocked, will cause AGVs to route around the object, depending on the value you use.

Note that this supplements your use of conditional rules on paths. The difference is that conditional rules work with routing table caching, while routingConstraint does not. If there is any object in the model with a routingConstraint set to something other than AGV.RoutingConstraint.None, then the AGV network will ignore any cached routing tables and recalculate paths anew. As such, using routingConstraint can have significant impacts on run speed because it must recalculate the path on every travel operation. Nevertheless, it can be useful when the potential number of dynamic barriers is so large that route caching (and creating all the conditional rules) is impractical.

When routing constraints are set and the AGV network is building routes dynamically, it will switch to an 'A* mode', using the A* search algorithm to quickly find the path from the source to the destination. As soon as it finds the best path, it will shortcut the search algorithm, not filling out the routing table fully as it usually would when executing standard Dijkstra's algorithm. This is done to make the path search as efficient as possible when using dynamic barriers.

5 |100000

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