Question

So, since the answer to this basically said that I really should look into encoding the genes of my creatures*, which I did!

So, I created the following neat little (byte[]-) structure:

Gene = { X, X, X, X, Y, Y, Y, Y, Z, Z, Z, Z }

Where

  • X = Represents a certain trait in a creature.

  • Y = These blocks controls how, if and when crossovers and mutation will happen (16 possible values, I think that should be more than enough!)

  • Z = The length of the strand (basically, this is for future builds, where I want to let the evolution control even the length of the entire strand).

(So Z and Y can be thought of as META-information)

(Before you ask, yes, that's a 12-byte :) )

My question to you are as follows:

How would I connect these the characteristics of each 'creature'?

Basically, I see it this way (and this will probably be how I will implement it): Each 'creature' can run around, eat and breed, basic stuff. I don't think (I sure don't hope so at least!) I will need a fitness-function per se, but I hope evolution, as in the race for food, partners and space will drive the creatures to evolution.

Is this view wrong? Would it be easier (do note, I'm a programmer, not a mathematician!) to look at it as one big graph and "simply" take it from there?

Or, tl;dr: Can you point me in the right direction to articles, studies and/or examples of implementation of this?

(Even more tl;dr; How do I translate a Gene to, say for example the Length of a leg?)

*Read the question, I'm building a sort of simulator.

Was it helpful?

Solution

I haven't seen metainformation like your Y and Z in a genetic algorithm's gene sequence before (in my limited exposure to the technique). Is your genetic algorithm a nontraditional one?

How many traits does a creature have? If your X's are representing the values of traits, and a gene sequence can have variable length (Z), then what happens if there are not enough X's defined for all the traits? What happens if there are more X's than the traits you have for a creature?

  • Z should be a fixed value.
  • Y should be parameters of your genetic evolution routine
  • there should be an X (or set of X) for every trait of a creature (no more, no less)

If the number of X's you have is fixed, then for each trait, you assign a particular index (or set of indexes) to represent that trait.

EDIT:

You should determine the encoding of your traits that X should represent: for length of a leg, e.g., you could have a few bytes represent the leg-length. If bytes 3-5 were the length of the leg, you could represent the length in your X-vector like this:

[...101......]

Where the dots are other trait representations. The above snippet represents a leg length of 5 (whatever that means). The below genome still has 5 as the leg length, but other traits filled out as well.

[001101011011]

OTHER TIPS

Looking at Mitchell, 1998, An Introduction to Genetic Algorithms, Chap. 3.3, I found a reference to Forrest and Jones, 1994, Modeling Complex Adaptive Systems with Echo. that refers to the software Echo that seems to do what you are looking for (evolving creature in a world). For the moment I can't find a link to it but here is a dissertation on implementing jEcho, by Brian McIndoe.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top