Bots and Simulations > The Gene depository

Preditor effectivness gene for evo sims

(1/5) > >>

EricL:
The sysvars .totalbots and .totalmyspecies (new in 2.43b) allow for mutation disabled, hand coded preditors in an evo sim to regulate the population of the evo bots through prediation while regulating their own numbers.

One challenge in using prediation in evo sims is how to scale the 'lethalness' of the preditors as the popualtion of the evo bots grows and reduce their effectiness as the population shrinks.  One easy way to do this is simply to scale the population range over which the preditor begins hunting using the rnd command.  The following gene is a simple modification of the velocity matching and shooting gene from Animal_Minimalis.  

cond
*.eye5 0 >
*.refeye *.myeye !=
*.totalbots 1000 500 rnd add >
start
*.refveldx *.body mult 1000 div .dx store
*.refvelup *.body mult 1000 div 30 add .up store
-1 .shoot store
stop

Note the line in bold.  The gene will never fire and thus the bot will never hunt when the popuatlion of the sim as a whole is below 1000.  It will always hunt when the population is above 1500 and its effectness as a hunter will vary between 1000 and 1500 total bots, becoming increasingly more effecient as the population increases in this range.

For completeness, here is a sample preditor population control gene.  It prevents reproduction when the preditors are more than 5% of the total population.

cond
*.nrg 10000 >
*.totalmyspecies 100 mult *.totalbots div 5 <
start
50 .repro store
stop

Jez:
I thought we couldn't do calculations in the conditions section of the gene? Or has that changed now and I'm just living in the past?!!

EricL:

--- Quote from: Jez ---I thought we couldn't do calculations in the conditions section of the gene? Or has that changed now and I'm just living in the past?!!
--- End quote ---

You can't do store, inc or dec outside the body (or else) portion of a gene.  Everything else you can do in the cond no problem.

Numsgil:
It was part of the DNA changes I made for 2.4

Ispettore:
Is it possible to put the ratio myspecie\totalspecies in hunt genes?

Navigation

[0] Message Index

[#] Next page

Go to full version