question

Keter avatar image
0 Likes"
Keter asked Felix Möhlmann answered

How to use Navigator getcost to estimate two cp points?

Hello,

I want to estimate the route distance of two cp points through Navigator getcost. However, I got some error, hope I can get some instruction to solve the issue, thanks!

error.png

task-43-using-elevators-with-agvs-2-elevator.fsm

FlexSim 23.2.0
agvnavigatorcp point
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

You need to declare the variable "a".

Navigator nav = Model.find("AGVNetwork");
double a = nav.getCost(Model.find("ControlPoint12"), [Model.find("ControlPoint66"), 0], 0);
return a;

To get the distance between two CPs you can also use the command cpdistance().

5 |100000

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