Magi

Contact info
Word
Research
   Publications
Studies
Free Software
Hobbies
Articles
Photography
About me
   Curriculum Vitae

©Marko Grönroos, 1998

USENET News comp.ai.alife

Säie: C++ alife design principles?

Seuraava säie: Interpreting Kitano
[Muut säikeet] [Muut uutisryhmät]
From: Marko Gronroos <magi AT iki PISTE fi>
Newsgroups: comp.ai.alife
Subject: Re: C++ alife design principles?
Date: 30 Oct 1997 13:55:31 +0200

Erik Max Francis <max AT alcyone PISTE com> replies:
> Object oriented design tends to lend itself quite well to artificial
> life simulations (though it tends to lend itself to most situations).
> Your question is a little too general to address right from square one,
> but as a C++ programmer and artificial life enthusiast I'd be glad to
> discuss design with you.
(the reply wasn't for me, but..)

I would like to discuss on what sorts of class hierarchies people have
used for genetic representation in C++.
      Mine is as follows:

Genstruct ("genetic structure")
   ^
   +---- AtomicGene
   ! ^
   ! +---- BooleanGene (typical 1-bit gene)
   ! !
   ! +---- FloatGene
   ! ! ^
   ! ! +------ BinaryFloatGene (a Gentainer, contains BooleanGenes)
   ! ! !
   ! ! +------ FloatFloatGene (contains native float)
   ! !
   ! +---- IntGene
   ! ^
   ! +------ BinaryIntGene (a Gentainer, contains BooleanGenes)
   ! !
   ! +------ IntIntGene (contains native int)
   !
   +---- Gentainer ("genetic container", contains any Genstructs)
                        ^
                        +---- Genome
                        ! ^
                        ! + DiploidGenome
                        !
                        +---- BinaryFloatGene (see above), contains BooleanGenes
                        !
                        +---- BinaryIntGene (see above), contains BooleanGenes
                        !
                        +---- NeuralEncoding
                        ! ^
                        ! +---- MillerEncoding
                        ! !
                        ! +---- KitanoEncoding ...
                        !
                        +---- MyProblemSpecificGeneticStructure ...

The transparency of the Int and Float gene classes makes in possible
to use either binary encoding or Evolution Strategies-like floating
point encoding. All Genstructs have local mutation and recombination
rate coefficients. The mutation, recombination, etc. methods can (of
course) be overloaded. Inversion or translocation are not currently
supported, although trivial to implement (less trivial to use
efficiently). An individual has exactly one genome, therefore genetic
regulation has to be implemented using a separate instance of a GRN
class for each regulating unit (cell). I use a class inherited from a
generic neural network class for this purpose.

Other separate classes are

            Individual
            Population
            GAEnvironment (which is usually overloaded for each application)

and many others, for example the evolution and selection strategy
classes. There is of course a mother-class called Object.

The ontogenesis of an individual starts basicly by sending an "init"
message to the genome (each gene has an address label and you can send
messages to the genes), which then reads (or activates) other relevant
genes and constructs the attributes for the individual.

This hierarchy seems to be "rather general". Any suggestions are welcome!

This will be briefly described in an appendix of my master's thesis,
which will appear in spring '98. The software will be available soon
after that.

----
-- Marko Grönroos, magi AT iki PISTE fi (http://www.iki.fi/~magi/)
-- Genetic algorithm researchers do it with the fittest individuals --
----

Seuraava säie: Interpreting Kitano
[Muut säikeet] [Muut uutisryhmät]