question

David Wang avatar image
0 Likes"
David Wang asked fiz commented

Distance between two Control Point in AGV Network

I'm trying to write my dispatching rule in Flexsim. So I need to know the distance between two control point from the path. I am curious is their any function from Flexscript can achieve my goal.

For instance I want to get the distance between A10_37 and A10_38.I have tried the function function_s("getDistance"). It does'n work.

1688212302449.png

test_control_area.fsm


FlexSim 23.0.9
flexscriptagvnetworkcontrolpoints
1688212302449.png (16.3 KiB)
test-control-area.fsm (140.6 KiB)
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 fiz commented

You are looking for the command cpdistance()

capture.png


capture.png (10.6 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.

fiz avatar image fiz commented ·

Hi Felix. Say for example if I would like to know the effective distance that an AGV has to travel from 1 cp to another and the path between them is not a 2 way path , cpdistance() does not give an accurate representation


1728292764745.png

for example the cp on top is closer to the agv as compared to the cp's at the bottom, but it will require the agv to travel further as it has to make a "u turn" to reach the cp. hence is there a way to find the effective travel or effective distance between 2 cp?

0 Likes 0 ·
1728292764745.png (16.9 KiB)
Felix Möhlmann avatar image Felix Möhlmann fiz commented ·
cpdistance() does return the "effective" distance between two CPs. And this distance might differ depending on the direction you are querying (A to B or B to A) if there are one-way paths.

If you want to know how far an AGV has to travel to reach a given CP, you can use distancetotravel().

0 Likes 0 ·
fiz avatar image fiz Felix Möhlmann commented ·
The above method works, thank you!
0 Likes 0 ·