Bots and Simulations > Evolution and Internet Sharing Sims

Survival-of-the-fittest evobot

<< < (6/11) > >>

Numsgil:
Yes, that's the fittest bot function.

Griz:

--- Quote ---Yes, that's the fittest bot function.
--- End quote ---
yeah great.
so how's it work? ;)
if score is based on # or offspring ...
what's this InvestedEnergy(t) about?

and I don't see where score enters into the fittest Function ...
all I see there is score(t, 1, 2, 0) ...
so how does the 'score' from the score Function get to that?

you saw the page on the wiki ...
http://www.darwinbots.com/WikiManual/index...e=Talk:King_Bot
can someone give some hints or clues there as to how this code works ..
and what one might do to alter how the score it calculated?
how to possibly add weighted values for say, kills, age, energy, or some
other criteria?

tnx

Numsgil:
I've written something in the wiki.

To reiterate:


--- Quote ---When I found this code several months ago (probably closer to 10 or 11) I wanted to modify it so that the king bot was the bot with the most "invested energy", by which I meant the total energy reserves, body reserves, shell, slime, etc. of it and all its descendants. That is where the InvestedEnergy(t) function came in.

However, for a reason I could never figure out the code didn't work. No bot was ever found to be the king for some reason (no bot was ever highlighted), so I changed InvestedEnergy(t) to return always 1 (and thus go back to the previous behavior of most offspring being King (each offspring is given a score of 1)).

To be honest the function is a mess, one of the few areas of the code (this and ties pretty much) that I have hardly touched to clean up. You can see the chaotic way in which Carlo (I assume it was him) coded much of the code.

The score function itself is recursive (it calls itself), which isn't a bad way to search through a tree (in this case, a phylogenic tree) mind you. However he threw 4 different ideas into a single recursive function. It searches for offspring, highlights offspring, draws family lines, and searches for the oldest ancestor. Granted they're somewhat closely related functions, but recursive functions are a headache enough in and of themselves without 4 different ideas thrown in there.

--Numsgil 17:58, 25 Feb 2006 (MST)
--- End quote ---

PurpleYouko:

--- Quote ---anyone know where in the DB code these might be found/modified?
--- End quote ---

Scripts are kind of interesting to set up.

The biggest problem I always come up against is that every robot has to parse every script in the active script list every time that they need to test the conditions against them.

This was relatively easy to set up for mutations because you only need to parse the scripts when a baby is born but for scripts in the main code, eaxh bot would have to check them all on every cycle and this could possibly cause a bit of a slowdown.

Then again maybe it ouldn't be all that bad.

Right now scripts are only parsed in the mutations module but expansions to the system will have to be called from the main code loop.

Griz:

--- Quote ---I've written something in the wiki.

To reiterate:


--- Quote ---When I found this code several months ago (probably closer to 10 or 11) I wanted to modify it so that the king bot was the bot with the most "invested energy", by which I meant the total energy reserves, body reserves, shell, slime, etc. of it and all its descendants. That is where the InvestedEnergy(t) function came in.

However, for a reason I could never figure out the code didn't work. No bot was ever found to be the king for some reason (no bot was ever highlighted), so I changed InvestedEnergy(t) to return always 1 (and thus go back to the previous behavior of most offspring being King (each offspring is given a score of 1)).

To be honest the function is a mess, one of the few areas of the code (this and ties pretty much) that I have hardly touched to clean up. You can see the chaotic way in which Carlo (I assume it was him) coded much of the code.

The score function itself is recursive (it calls itself), which isn't a bad way to search through a tree (in this case, a phylogenic tree) mind you. However he threw 4 different ideas into a single recursive function. It searches for offspring, highlights offspring, draws family lines, and searches for the oldest ancestor. Granted they're somewhat closely related functions, but recursive functions are a headache enough in and of themselves without 4 different ideas thrown in there.

--Numsgil 17:58, 25 Feb 2006 (MST)
--- End quote ---

--- End quote ---
yeah man.

 
so I'm wondering then why one couldn't simply add additional
weighted data in the Fittest function:


--- Code: ---For t = 1 To MaxRobs
   If rob(t).Exist And Not rob(t).Veg Then
     s = score(t, 1, 2, 0)
     If s >= Mx Then
       Mx = s
       fittest = t
     End If
   End If
 Next t
--- End code ---

iow ...
right after s = score(t,1,2,0) ...
is there any reason one couldn't add
s=s+ (that bot's energy or kills or slime; age; mutations)
or whatever one wished to look at, weighted accordingly?
ie ... #of offspring being more/less valuable than mutations
or kills or whatever?

if so ...
can you point me to what variables to call on for those ...
iow ...  
would  rob(t).age , rob(t).Mutations, rob(t).SonNumber, rob(t).Kills ... etc
be what I would look at?

or what you were looking at to add with you Invested Energy?

such ideas as number of offspring/age ... or kills/age might
give one a better idea of fittnes than simply # of offspring ...
or whatever one might wish to look at.

tnx

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version