swarm-modeling
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

measuring distance in grids


From: address@hidden
Subject: measuring distance in grids
Date: Fri, 11 Jan 2002 15:20:48 -0500

Paul,

Perhaps the grid position that includes the agent is not being used in the 
calculations?

Consider a grid with an agent having a vision range of r.  The diameter of the 
circle of the agent's vision range might be 2r+1, since the agent can see in r 
grid-units on all sides of the position in which it is located.  

2r+1 = r units on the left, r units on the right, plus 1 unit for the agent's 
current position.

Regards,
--Dave

----------
Dave Koelle
Founder, The BaseAgent Project
"Interactive software and robots for constructive learning and discovery"
http://www.baseagent.com
(In need of a Principle Investigator!)



-------- Original Message --------
Subject: measuring distance in grids
Date: Fri, 11 Jan 2002 13:44:52 -0600
From: Paul E Johnson <address@hidden>
Reply-To: address@hidden
To: address@hidden

I have a project where agents are in a grid and it is important to 
measure distance.  The authors of the original article I'm replicating 
do not define a distance metric, but I originally assumed the distance 
was Euclidean. That is, I guessed the distance between x=(x1,x2) and 
y=(y1,y2) would be measured

dist = sqrt[ (x1-y1)*(x1-y1)+(x2-y2)*(x2-y2) ]

but I get some funny results using that, and I'm starting to wonder what 
other metrics people might think are standard on a rectangular grid.

One I'm considering is "radial square" distance, where distance is the 
radius of the square centered on a point that touches another point. 
That means the distance from a cell to all immediate Moore neighbors is 
1, and for the next larger neighborhood, the distance would be 2. See 
what I mean?  Here, the distance from the center point 0 to a neighbor
is:
            3333333
            3222223
            3211123
            3210123
            3211123
            3222223
            3333333

Does anybody have an opinion?
-- 
Paul E. Johnson                       email: address@hidden
Dept. of Political Science            http://lark.cc.ukans.edu/~pauljohn
University of Kansas                  Office: (785) 864-9086
Lawrence, Kansas 66045                FAX: (785) 864-5700



                  ==================================
   Swarm-Modelling is for discussion of Simulation and Modelling
techniques
   esp. using Swarm.  For list administration needs (esp.
[un]subscribing),
   please send a message to <address@hidden> with "help" in the
   body of the message.
                  ==================================

--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .



                  ==================================
   Swarm-Modelling is for discussion of Simulation and Modelling techniques
   esp. using Swarm.  For list administration needs (esp. [un]subscribing),
   please send a message to <address@hidden> with "help" in the
   body of the message.
                  ==================================


reply via email to

[Prev in Thread] Current Thread [Next in Thread]