Programming Dominant / Recessive Genes
I'm creating an A-Life simulator, something similiar to predator-prey models.
Each of my 'creatures' have several, mmm not really genes, more like characteristics.
abilityDigestMeat
abilityDigestPlant
camoflauge
confidence
eyeSight
fertility
lifeSpan
metabolism
sneak
stamina
strength
quickness
herdInstinct
most of them have values of 0-1 or 1-100 or something like that. all floating point values.
The whole point is that the weak will die and the strong survive. At the moment when two creature mate i use two randomly chosen points to decide who's characteristics are getting passed to the child.
So for the 13 different characteristics above say the two randomly chosen points are 4 and 8.
characteristics 1-4 are taken from parent 1
5-8 are taken from parent 2
and 9-13 are taken from parent 1
But i've been thinking this isn't really accurate. How would i implement dominant traits? Should the value of one characteristic be taken wholly from one parent...or a combination of both? Or for some would only the better one suffice?
I'd like to know what some of you think about this. Should i just keep what i have done already...or change it entirely?
Thanks
--edit--
Okay well i have to get off the net now. I'd still really appreciate any input on this and i'll check back tomorrow...even links to references you might know about (i've found loads of stuff on pred-prey models but nothing on dominant traits).
Thanks again world![grin]
[Edited by - LifeOfTamir on October 15, 2004 11:43:36 AM]
"Without the 0, alot of big numbers would just sit around looking rather stupid"
Dominant/recessive genes (alleles, actually) are only relevant when the creature has a pair of chromosomes (it then determines which phenotype will be shown when 2 different alleles of the same gene are present).
Your model only takes into account one chromosome, and so the question of dominant/recessive genes is irrelevant.
I suggest your read a bit about basic genetics (I don't have any references at hand, but I'm sure google can provide you with plenty) if you want to create a more "accurate" model.
Your model only takes into account one chromosome, and so the question of dominant/recessive genes is irrelevant.
I suggest your read a bit about basic genetics (I don't have any references at hand, but I'm sure google can provide you with plenty) if you want to create a more "accurate" model.
Currently, what i think would happen, is things like abilitydigestplant and abilitydigestmeat will go up to 100, same with quickness,camoflauge,eyeSight,lifeSpan,stamina and strength. the rest will just rest on a goodish value.
perhaps have a "point" system, where each point is worth 100/numberofpoints? Then if there is too many, the effects are diminished.
For resessive genes, take your 4 chromosomes from the parents (2 chromezomes * 2 parents). with those, take your cromizomes from your first parent, coin flip; if it comes up heads, take the dominent, otherwize, take the recessive. do the same for your other one. Also remember too change a random gene(s), by random amounts.
You might also want environmental effects to effect on them too (so something like grothrate would be (gheight - cheight) / (grate - (cfood / nfood))
where gheight is the genetic predisposion for height, cheight is the current hieght, ect.
You could also have a state machine, with variables which change the probability of instincts (like from seeing prey, to pre-wired-state chase_prey) from happening (so you would have something like hungry_hunting, full_hunting, ect. Also, variables would change with state (so if your in state panic, your needtosleep variable would go down).
This would be a very interesting project.
From,
Nice coder
perhaps have a "point" system, where each point is worth 100/numberofpoints? Then if there is too many, the effects are diminished.
For resessive genes, take your 4 chromosomes from the parents (2 chromezomes * 2 parents). with those, take your cromizomes from your first parent, coin flip; if it comes up heads, take the dominent, otherwize, take the recessive. do the same for your other one. Also remember too change a random gene(s), by random amounts.
You might also want environmental effects to effect on them too (so something like grothrate would be (gheight - cheight) / (grate - (cfood / nfood))
where gheight is the genetic predisposion for height, cheight is the current hieght, ect.
You could also have a state machine, with variables which change the probability of instincts (like from seeing prey, to pre-wired-state chase_prey) from happening (so you would have something like hungry_hunting, full_hunting, ect. Also, variables would change with state (so if your in state panic, your needtosleep variable would go down).
This would be a very interesting project.
From,
Nice coder
Click here to patch the mozilla IDN exploit, or click Here then type in Network.enableidn and set its value to false. Restart the browser for the patches to work.
Quote: Original post by Nice Coder
perhaps have a "point" system, where each point is worth 100/numberofpoints? Then if there is too many, the effects are diminished.
I'm not really sure i understand this. Could you possible ellaborate?
Quote:
This would be a very interesting project.
I know, i'd like to add so many more things then what i currently have but i'm doing this for an Msc project and they've given us a pathetically short amount of time. I've been warned to stay small and specific...which i've failed to do. I've got 2 weeks left and i've been told i should focus on the GA side of things for now. But i would like to come back to this once i don't have the threat a deadline hanging over me.
Quote:
You could also have a state machine, with variables which change the probability of instincts (like from seeing prey, to pre-wired-state chase_prey) from happening (so you would have something like hungry_hunting, full_hunting, ect. Also, variables would change with state (so if your in state panic, your needtosleep variable would go down).
Hmm...i do have states but states that have an effect on instincts i do not have. That's a very interesting idea. something i'm going to have to look into, after the stupid deadline of course[headshake]
@eyal: Yeah i remember what your talking about...It brings up memories of A-Level biology. But that's the problem i have, that my creatures have abilities not really genes. I am tempted to change the way they work but this late in the game it could be risky. Plus, for example, how would you use genes to determine how good your eyesight is? If you were using genes that would ony leave the possibility of say Short-sightness, long-sightness, and normal. I'm using the 'ability' eyeSight to determine how far they can see, not how well....if that made any sense.
--edit--
See you again tomorrow!
[Edited by - LifeOfTamir on October 16, 2004 10:29:58 AM]
"Without the 0, alot of big numbers would just sit around looking rather stupid"
What I think Nice Coder meant, is that if there are no negative things about the ability to digest meat for example, all animals will evolve to digest meat. You have many similar properties there like eye sight etc. Only a few like herding both have negative and positive connotations applied to them. Of course, you can make the ability to digest meat opposite to the digestion of plants if you wish, even though that is not a completely realistic model. However, it probably works for a game simulating gene pools.
What you could do (which really is an eleboration of Nice Coder's point system), is to let all abilities take energy. Energy would then be derived from food, and the animal's efficiency in acquiring food would determine its allowance for nice abilities like good eyesight or advanced digestion systems capable of supporting many different kinds of food. You could let one digestion system be free, but increase the energy required if the animal evolved multiple digestion abilities.
What you could do (which really is an eleboration of Nice Coder's point system), is to let all abilities take energy. Energy would then be derived from food, and the animal's efficiency in acquiring food would determine its allowance for nice abilities like good eyesight or advanced digestion systems capable of supporting many different kinds of food. You could let one digestion system be free, but increase the energy required if the animal evolved multiple digestion abilities.
It's not necessarily true that all the creatures will evolve to digest meat. I have included something which indicates they're preferrence over food. This can change over time but if a herd of creatures all learn to prefer vegetation over meat then the ability to digest meat does not become a factor for them and it could go down, as well as up.
But for everything else you said i agree. Only herd and metabolism and both negative and positive connotations. I figured it would be interesting because it would cleary show over generations an increase in abilities. I'm not so sure now.
damn, times up...i'll be back later to discuss your idea though.
But for everything else you said i agree. Only herd and metabolism and both negative and positive connotations. I figured it would be interesting because it would cleary show over generations an increase in abilities. I'm not so sure now.
damn, times up...i'll be back later to discuss your idea though.
"Without the 0, alot of big numbers would just sit around looking rather stupid"
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement