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: Olivier BARRETEAU (barreteau@montpellier.cemagref.fr)
Date: mar nov 27 2001 - 17:09:33 CET

I agree with Pierre that this notion is highly conceptual and dependent on
the modeller's point of view. The discreteness of space used with Cormas is
also to be taken in account.

But I think a set of distances (at least the existing #distCell, depending
on the chosen topology, but also Pythore's one and why not others according
to various needs and creations of Cormassers) should be proposed at the
superior level, and might be selected from within topology menu.

cheers

Olivier

A 19:53 23/11/01 +0100, Christophe Le Page a écrit :
>From a very practical point of view, an analysis of what is currently
 Wed 28 Nov 2001 08:40:24 +0700
available in Cormas2001:
>
>#distCenter: is useful when you just need relative measurements of
>distance, like when looking for shortest way. For instance when you
>need to let an agent move cell by cell from a departure cell to a distant
>destination cell, you can write something like:
>
>moveTowards: destinationCell
>| max step d |
> max := self patch distCenter: destinationCell.
> step := self patch.
> self patch neighbourhood do: [:c |
> d := a distCenter: destinationCell.
> d < max ifTrue: [max := d. step := c]].
> self leave.
> self moveTo: step
>
>!!! Note that this is only valid for closed boundaries conditions !!!
>
>#distCell: is based on a recursive neighbourhood algorithm, which makes
>it time-consuming but valid in both toroidal and closed boundaries
conditions,
>and robust when resizing the spatial grid window...
>
>But as Pierre has mentionned, this should be discussed to had better
>solutions in the next release !
>
>clp
>----- Original Message -----
>From: Pierre Bommel <bommel@cirad.fr>
>To: Jourdain, Damien <D.JOURDAIN@CGIAR.ORG>
>Cc: <cormas@cnusc.fr>
>Sent: Friday, November 23, 2001 7:18 PM
>Subject: Re: "Real distance" between two cells.
>
>
>> 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