Messages from list : cormas@cirad.fr

Choose a topic among the following archives :

RE : two problems

New Message Reply Date view Thread view Subject view Author view

Subject: RE : two problems
From: Christophe Le Page (christophe.l@chula.ac.th)
Date: Wed Mar 01 2006 - 04:04:14 CET

 

Romain,

 

The way it is now implemented, Cormas is looking for the existence of « pov
» protocols (categories of methods) in each Entity class to build the
correspondence with the symbols defined from the “Observation of the Space”
interface.

In this particular case (actually, it is the same for the “probes”
associated to each entity), Cormas does not allow taking advantage of
inheritance: you have to duplicate the super class method into the two
subclasses.

 

Clp

 

-----Message d'origine-----
De : owner-cormas@cirad.cirad.fr [mailto:owner-cormas@cirad.cirad.fr] De la
part de Romain Lorrilliere
Envoyé : mardi 28 février 2006 20:56
À : CORMAS
Objet : two problems

 

Dear colleagues,
in my model, I have two problems?
I have two kind of located agent, and the both are specialization of a super
class where lot behaviours are defined.
By example the "pov" is define in the super class.

    The first it's a problem of "pov".
The "pov" is defined in the super class by this instruction:

"---------------"

  povTurtle
     ^self class name

"---------------"

In both located agent I have defined the symbol. But each time when I open
my model I lost this symbol and I must define it again.

I don't understand why my model forgets the symbols of my "pov"

    The second it's a problem of polymorphism.
When I want use the polymorphism for apply a method to all instances, my
model can't to do. The super class didn't now the instances of the both
specialized class, and I must have made methods to do that:

"---------------"

updateTurtleNat
 
|turtlNat|
    turtleNat := OrderedCollection new.
    turtleNat := self index: self theTurtleNatFemales in: turtleNat.
    turtleNat := self index: self theTurtleNatMales in: turtleNat.

    self theTurtleNats: turtleNat.

"---------------"

index: turtle in: turtleSet
    turtle do:[:t| turtleSet add: t].
    ^turtleSet

"---------------"

Do you know why ? I knew that the polymorphism is a characteristic of object
language like SmallTalk.

Thanks for reply.

Romain L.

-- 

Lorrillière Romain

UMR 8079 Laboratoire Ecologie, Systématique et Evolution

Bât. 362

Université Paris-Sud

91405 Orsay cedex

France

tel : 01 69 15 56 85

fax : 01 69 15 56 96

mobile : 06 81 70 90 70

email : romain.lorrilliere@ese.u-psud.fr

New Message Reply Date view Thread view Subject view Author view
 

Back to home