question

Nicholas Grazioli avatar image
1 Like"
Nicholas Grazioli asked Jason Lightfoot commented

AGV path cost multiplier doesn't work in some cases

Hi,

I am working with custom cost paths using the functionality introduced in flexsim 2022, the cost multipliers.

I noticed that the behavior of the AGVs is changed by enabling the "Show AGV Routing Accessibility".

If I start the model without the "Show AGV Routing Accessibility" enabled I see the correct behavior (the AGV1 uses the corridor below to reach the destination - first screenshot), but if I start the model with the feature enabled from the destinatin Control Point the AGV1 uses the corridor above as if the cost multiplier was not enabled (second screenshot). I think that this could be a bug.

1651652169321.png1651655038708.png

In the attached model you can see this behavior.


Cost_Multiplier_Bug.fsm

FlexSim 22.0.3
agvnetworkagv pathroute costcost multiplier
· 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.

Jason Lightfoot avatar image Jason Lightfoot ♦♦ commented ·

Hi @Nicholas Grazioli, was Phil BoBo'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

Phil BoBo avatar image
0 Likes"
Phil BoBo answered Phil BoBo commented

Attached is a simpler sample model demonstrating the issue.

agv_cost.fsm

"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."

AGV Network (flexsim.com)

It appears that what is happening is that the drawing of routing accessibility displays the cost without the multiplier, which is caching off that un-multiplied cost into the routing table. Thus, subsequent routing is using the routes without the custom path cost multipliers.

You should turn off Show AGV Routing Accessibility before running your model.

Show AGV Routing Accessibility is designed to be a debugging tool to get information about the dijkstra's algorithm results. You shouldn't be running the model with that setting on.

Nevertheless, I'll add a case to the dev list to look into this further and determine if we should change how this works.


agv-cost.fsm (33.4 KiB)
· 3
5 |100000

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

Nicholas Grazioli avatar image Nicholas Grazioli commented ·

Thanks so much for the support.

I have another model that has the same behavior explained above without using "show AGV routing accessibility" (multipliers are not used), unfortunately I can't post this model because it was built with a custom module and I was unable to replicate it in a normal Flexsim model.

I thought the two problems might be related.

Investigating the problem I found (through debugging) that the "customPathCost" code present in the AGVNetwork is called only for the final path or segment (where the destination control point is located). This happens both in my model where I have not activated "show AGV routing accessibility", and in the base model when the function is active.

1651757782883.png

1 Like 1 ·
1651757782883.png (39.1 KiB)
Phil BoBo avatar image Phil BoBo ♦♦ Nicholas Grazioli commented ·

I don't quite follow. You say "(multipliers are not used)" and then talk about the customPathCost being executed.

It is not unusual for the customPathCost to only be executed for part of the entire route. As mentioned above, the route costs are cached so if a given path has already been calculated, it will just use the previously cached value.

Also, using the FlexScript debugger for determining whether this code is executing may not always work properly, depending on the context of how it is called. Using a print() command within the code is more reliable.

There's not much more I can tell you without being able to replicate it in a small sample model without your custom module.

One last word of advice would be that you right-click on a path and select Refresh Path Links > Entire Network in order to clear the cached routing tables each time before running your model when you are actively changing your paths and their cost multipliers in your model.

0 Likes 0 ·
Phil BoBo avatar image Phil BoBo ♦♦ Nicholas Grazioli commented ·

When using custom path multipliers, if you add a Conditional Rule to your AGV Network, then it will have separate routing tables based on the status of the rules:

1652114699487.png

This will make everything about custom path multipliers work better, including displaying the routing accessibility.

This will cause distance queries to use a separate routing table from travel queries and will be less likely to have conflicts between the routing table caches because you aren't using the same routing table for everything.

0 Likes 0 ·
1652114699487.png (238.5 KiB)