Messages from list : cormas@cirad.fr

Choose a topic among the following archives :

Re: "Real distance" between two cells.

New Message Reply Date view Thread view Subject view Author view

Subject: Re: "Real distance" between two cells.
From: Pierre Bommel (bommel@cirad.fr)
Date: ven nov 23 2001 - 19:18:20 CET

Hello Damien,

Jourdain, Damien wrote:

> Dear all,
>
> Correct me if I am wrong! There is no way to calculate a "real" distance
> between two cells if we assume a certain scale for the environment. For
> example, if we consider a plot of 1ha, we can reasonably think that the
> distance between two adjacent point centers is 100 m.
>
> If I use the function distCenter: I have a distance between the two cell
> centers, but I think the result is dependant on the way the grid is
> displayed (I do not get the same result with a grid taking half the screen
> versus a grid taking all the screen).
Yes you are right : that's ugly ! This method will disappear in the next
version of Cormas2002 (very soon !). The model must be separate from the
display according to MVC architecture (M_odel separated from V_iew and
from C_ontroler).

>
> If I use the function distCell: I have an integer result corresponding to
> the number of cells , that just gives me an approximation of the real
> distance once those two cells are not on the same line or on the same column
> in the grid.
I personnaly think that it's a conceptual problem: The elementary unit
of your model is the SpatialEntity_Element (the cell), so distCell:
should return a number equals to the shortest way to go from cellA to
cellB. For instance, the distance shouldn't be the same if the connexity
is 4 or 8: in the first case: D(a,b)=|Xa-Xb| + |Ya-Yb| and in the second
case: D(a,b)=max(|Xa-Xb|,|Ya-Yb|).
You can also use the Pythagore theorem to calculate a distance
(squareroot((Xa-Xb)square + (Ya-Yb)square) but this kind of distances
works for continuous spaces: for the moment, we only use discrete spaces
in Cormas, and there is no straightforward way for your agents to go
from A to B. In my personal point of view, it shouldn't be at a superior
level.
The problem must be debate if we use irregular spatial entities whithout
unit... let's talk !

Cheers,

        Pierre

-- 
**************************************
* Pierre Bommel                      *
* CIRAD TA 60/15                     *
* 73, rue Jean-François Breton       *
* 34398 Montpellier cedex 5 France   *
* Phone: +33 (0)4 67 59 38 53        *
* Fax: +33 (0)4 67 59 38 27          *
* http://cormas.cirad.fr             *
**************************************

New Message Reply Date view Thread view Subject view Author view
 

Back to home