Question: What does distance mean in NetLogo ?

338 views
Skip to first unread message

vidus...@gmail.com

unread,
Dec 16, 2021, 9:50:12 AM12/16/21
to netlogo-users
Hi All 

I have a confusion about distance in NetLogo. 

In my understanding, NetlLogo distance calculates distance between the patch centre of start patch to the centre of destination patch. So when agent moves, the distance is one patch distance (please correct me if I have misunderstood this).

In my model, environment is created by importing 3km * 3km forage availability raster using GIS extension. Based on the patches forage value agent selects and then move to a suitable patch and updates distance travelled by taking sum of distance travelled every time step. 

My question is - If the world is resized to match the raster extent, is this distance a distance in km ? If not, how to convert that ? 

Thank you

Kind Regards
Vidushi   

Wade Schuette

unread,
Dec 16, 2021, 12:16:10 PM12/16/21
to vidus...@gmail.com, netlogo-users
I suspect that Netlogo reported distances are always in Netlogo coordinates, so a distance of 1 is 1 patch.
I suspect you can compute the exact relationship for a small region of the Earth ( flat earth approximation ) from looking at
the ratios in

gis:set-transformation gis-envelope netlogo-envelope

Regardless I'd double check my work by finding two points in your map that you know the kilometer distance
between and seeing if your multiplicative factor times the NetLogo reported distance is the same number.

Or conversely, figure out the factor by using the ratio of the distance in real world between those two points
and the distance reported in NetLogo between them.

Of course, if the section of the world you are mapping is large enough that curvature of the earth matters,
so you're into spherical geometry you'd have to figure out the latitude and longitude of each point and
some subroutine that computes the great-circle distance between those two points.

Wade


--
You received this message because you are subscribed to the Google Groups "netlogo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netlogo-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netlogo-users/0a39b915-f001-4a43-bb84-0fe786af2550n%40googlegroups.com.

Michael Tamillow

unread,
Dec 16, 2021, 2:33:55 PM12/16/21
to Wade Schuette, vidus...@gmail.com, netlogo-users
Both turtles and patches inherit from "agents". The description for distance is:

distance agentTurtle Command Patch Command

Reports the distance from this agent to the given turtle or patch.

The distance to or from a patch is measured from the center of the patch. Turtles and patches use the wrapped distance (around the edges of the world) if wrapping is allowed by the topology and the wrapped distance is shorter.

ask turtles [ show max-one-of turtles [distance myself] ]
;; each turtle prints the turtle farthest from itself



Vidushi Patel

unread,
Dec 16, 2021, 11:29:43 PM12/16/21
to Michael Tamillow, Wade Schuette, netlogo-users
Thank you All that helped clarify my confusion. 
Thank you for the suggestion Wade. I will check with the known points to make sure I am using the right distance. 

Kind Regards

Vidushi


Vidushi

Reply all
Reply to author
Forward
0 new messages