Hi, I would use an ad-hoc solution, modeling the Plant tree structure as a document tree in Grafoscopio [1]. The root of the plant representation would be the root of the document, the branches and sub-branches would be nodes and sub-nodes in the documents, respectively. And each node would contain a dictionary with the properties I want to reflect for that particular node. The header of the node would be a shortcut to the more detailed representation in the node body (the dictionary). Because Grafoscopio notebooks are just plain STON text, you could store plants history on a DVCS (Fossil, Git) and reify that ad-hoc model with methods that capture what started just as dictionaries. [1] http://mutabit.com/grafoscopio/index.en.html Notice that Grafoscopio documents are programmable, so, while Grafoscopio provides a GUI for editing them, you could access the API and create them by scripting/coding. Also the long, painful, joyful Karma of my PhD is finishing with only public dissertation pending, so I will have more time to care for Grafoscopio source code and issues (hopefully I will send some updates, once the deserved quiet time after intense thesis writing have finished). Cheers, Offray On 16/1/19 4:15, Loïc Pagès wrote:
Dear Pharo users,
I develop software dedicated to the simulation of plant development and 3D architecture.
In the past, I used Java, but I am very interested in translating code in Pharo. I appreciated very much the language and the course.
I have a question for you all :
During plant development (ontogeny), new organs appear, that are gradually tranformed. For example, a bud can make a flower, and then a fruit.
Organs are conveniently modelled as classes. During the course, I learned that it was better to make several classes (bud, flower, fruit) instead of a "fat class" such as "reproductive organ" with many attributes and stages (bud stage, flower stage, fruit stage). I wonder how to transform an object into another one, to represent for example the fact that the flower may become a fruit.
Maybe a naive question ?
Thanks for your lights !
Loïc