How to use Navigator getcost to estimate two cp points?

How to use Navigator getcost to estimate two cp points?

oceanbluesky1993
Contributor Contributor
100 Views
1 Reply
Message 1 of 2

How to use Navigator getcost to estimate two cp points?

oceanbluesky1993
Contributor
Contributor

[ FlexSim 23.2.0 ]

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

0 Likes
Accepted solutions (1)
101 Views
1 Reply
Reply (1)
Message 2 of 2

moehlmann_fe
Enthusiast
Enthusiast
Accepted solution

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().

0 Likes