I've written something in the wiki.
To reiterate:
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)
yeah man.
so I'm wondering then why one couldn't simply add additional
weighted data in the Fittest function:
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
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