Messages from list : cormas@cirad.fr

Choose a topic among the following archives :

Re: bug in recursiveNeighbourhood: n

New Message Reply Date view Thread view Subject view Author view

Subject: Re: bug in recursiveNeighbourhood: n
From: Pierre Bommel (pierre.bommel@laposte.net)
Date: Wed Jun 01 2005 - 14:30:01 CEST

Hello Stefano and Bruno,

To change the super class of a class, you need to open a browser on
your class, then
simply change the name of the super class. Ex :

CormasNS.Models.SylvoPastJeu defineClass: #Massif
        superclass: #{CormasNS.Kernel.SpatialEntityAggregate}
by
CormasNS.Models.SylvoPastJeu defineClass: #Massif
        superclass: #{CormasNS.Kernel. EntitySet}

And accept.

Bon courage les gars !

        Pierre

Le 23 mai 05, à 07:22, Stefano Farolfi a écrit :

>
> Hello everybody,
> I need some technical help, does someone know how to change the
> superClass
> of a class already created? I am trying to change a
> SpatialAgregateNotConnex
> into a Spatial EntitySet. I tried to change the attribute "superClass"
> in
> the class definition and the hyerarchy changed, but the Cormas space
> representation still asks to this aggregate method of its old super
> class
> ( SpatialAgregateNotConnex ) and it sends me an error message...
> Thank you in advance for your help, if someone already had this
> problem,
> I wish you a nice week,
> Bruno Bonte
>
>
> Dr. Stefano Farolfi
> Cirad Tera Green
> Ceepa University of Pretoria
> 0002 Pretoria
> South Africa
>
> Tel. ++27 12 420 4659
> Fax: ++27 12 420 4958
> ----- Original Message -----
> From: "Pierre Bommel" <bommel@cirad.fr>
> To: "Hoekstra, J. (Jeljer)" <jhoekstra@feweb.vu.nl>
> Cc: <cormas@cirad.fr>
> Sent: Monday, August 23, 2004 6:00 PM
> Subject: Re: bug in recursiveNeighbourhood: n
>
>
>> Hello all,
>>
>> This error was already notified and corrected by Stan
> (http://cormas.cirad.fr/forum/cormas/archives/0104.html).
>> In Cormas2004 version the body of this method is now quite different :
>> recursiveNeighbourhood: radius
>> "Returns a collection of the cells include into the radius.
>> radius = Integer > 0"
>>
>> | allCells layers |
>> allCells := OrderedCollection new.
>> layers := self allLayersTo: radius.
>> layers do: [:layer | allCells addAll: layer].
>> ^allCells
>>
>> and it is much more quick than previously.
>> This is one of the new features that I didn't describe in the "what's
>> new"
> page...
>> Best regards,
>>
>> Pierre
>>
>> "Hoekstra, J. (Jeljer)" a écrit :
>>
>>> Hi all,
>>>
>>> I found an error in recursiveNeighbourhood: n (version 2003, perhaps
> also in 2004). It does some double counting. The bug is fixed by
> changing
> newVoisins in peripherie in the last line of the loop.
>>> The bug free version of recursiveNeighbourhood: n is added below.
>>>
>>> cheers,
>>> Jeljer
>>>
>>> recursiveNeighbourhood: n
>>> | ensemble peripherie newVoisins |
>>> ensemble := OrderedCollection new.
>>> ensemble add: self.
>>> peripherie := OrderedCollection new.
>>> peripherie add: self.
>>> n timesRepeat:
>>> [newVoisins := OrderedCollection new.
>>> peripherie do: [:p | p neighbourhood do:[:v| (newVoisins
>>> includes: v)
> ifFalse: [newVoisins add: v]]].
>>> "peripherie do: [:p | newVoisins addAll: p neighbourhood]."
>>> peripherie := newVoisins reject: [ :i | ensemble includes: i ].
>>> ensemble addAll: peripherie "newVoisins"].
>>> ^ensemble
>>
>> --
>> ***********************************
>> 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
>> ***********************************
>>
>>
>
>
        Pierre Bommel
        SHIS QI 26, Conjunto 15, Casa 18
        71670-150
        Brasilia DF
        tel: (00 55 61) 367 3405

New Message Reply Date view Thread view Subject view Author view
 

Back to home