Messages from list : cormas@cirad.fr

Choose a topic among the following archives :

two problems

New Message Reply Date view Thread view Subject view Author view

Subject: two problems
From: Romain Lorrilliere (romain.lorrilliere@ese.u-psud.fr)
Date: Tue Feb 28 2006 - 14:56:27 CET

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

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