Author Topic: Survival-of-the-fittest evobot  (Read 15995 times)

Offline Griz

  • Bot Overlord
  • ****
  • Posts: 608
    • View Profile
Survival-of-the-fittest evobot
« Reply #45 on: February 26, 2006, 10:18:35 PM »
I don't suppose there's a reverse function for:
rob(t).AbsNum is there?
like the arctan of tangent.

iow, knowing the robot ID number, how might I find the bot number (t)
that the prog uses?  the 't' of t=1 to MaxRobs for that bot ID.
the intial generation is easy, as they are the same. ;)
that faked me out when I went looking for the offspring numbers.

I wonder if one could have the prog write a file ...
for t = 1 to MaxRobs
write t, rob(t).AbsNum
next t

how might I go about doing that?
what's the correct syntax?

I know, I know, RTFM ...
too bad I don't have one. ;)
I can go look at how the 'save all bots' routine works I guess ...
it's just that I do have a limited amount of time to play at it ...
so any hints/tips/pointers would be apprecieated.

tanks
不知
~griz~
[/color]
   "The selection of Random Numbers is too important to be left to Chance"
The Mooj  a friend to all humanity
[/color]

Offline Griz

  • Bot Overlord
  • ****
  • Posts: 608
    • View Profile
Survival-of-the-fittest evobot
« Reply #46 on: February 26, 2006, 11:21:23 PM »
Nums ...
here be the breakdown on Invested Energy

the score, which determines the fittest bot ...
turns out to be the addition of the nrg and
body*10 of the offspring, but does not include
the  nrg and body of the parent.

however, for those without offspring ...
the score seems to be that of the bot's
own nrg and body *10.

is this how you intended it to work?

so we have:

fittest bot #19
rob(fittest).body * 10.....3709.250  
rob(fittest).nrg...............4965.802  
........................................________
fittest bot points.............8675.052

offspring 1 (#35)
rob(35).body * 10...........6252.351
rob(35).nrg.....................4239.496
........................................________
InvestedEnergy(35).........10491.847

offspring 2 (#63)
rob(63).body * 10............3799.280  
rob(63).nrg......................5194.024 :
......................................... _______
InvestedEnergy(63).........8993.304

the score from the fittestFunction:
score(fittest, 1, 2, 0)........19485.151

so it seems to work assuming you want
Invested Energy to be that stored by it's
offspring and not the bot itself.

we can always add weighted points for
other things such as kills, age, slime or
whatever.
« Last Edit: February 26, 2006, 11:28:11 PM by Griz »
不知
~griz~
[/color]
   "The selection of Random Numbers is too important to be left to Chance"
The Mooj  a friend to all humanity
[/color]

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Survival-of-the-fittest evobot
« Reply #47 on: February 27, 2006, 01:27:33 AM »
Alright, here goes.  Point out if I missed anything.

To find a bot with a certain absnum you'd need to search all the bots in the bot array.  You're not even guarenteed that the bot exists, however, so watch out for that.

Something like this:

for t = 1 to MaxRobs
if rob(t).absnum = Number then return t, or do a jig, or whatever
next t

Your last post, about Invested energy.  That was not my original intention.  I was hoping to have the bot itself and its descenddants equally weighted.  In the end I don't know that it matters.  Feel free to take whatever I had and run with it.  It's not like it's a critical part of the program, it allows a great deal of consequence free experimentation.

As to creating a new form, the best way is to play with the controls yourself.  To create a new form, go to the main menu: project->new form.

Play around with creating and moving around various text fields, labels, etc.  Looking at other forms, especially the options form, will get you an idea as to how the different things all work together.  Double click on a control to go to the code that controls what happens when you change the value in a field.

When you have a form more or less up and running, I'll help you incorporate it into the main code.

When it comes to actual VB syntax, it's just been too long.  I haven't really done any VB coding since October.  This is a good resource, if you're a good searcher you should find an article on just about anything you could ask a question about.  It'll be far more helpful than I ever could.

Offline Griz

  • Bot Overlord
  • ****
  • Posts: 608
    • View Profile
Survival-of-the-fittest evobot
« Reply #48 on: February 27, 2006, 10:38:15 AM »
Quote
When it comes to actual VB syntax, it's just been too long. I haven't really done any VB coding since October. This is a good resource, if you're a good searcher you should find an article on just about anything you could ask a question about. It'll be far more helpful than I ever could.
great.  thanks.
will see what I can finger out ...
then when it comes to utilizing it within DB, will pick your/PY's brains. ;)

I'll put what I learn [if anything] ;) in some form on the wiki ...
as an aid to others who might wish to get into the VB and DB codes.

Quote
Your last post, about Invested energy. That was not my original intention. I was hoping to have the bot itself and its descenddants equally weighted. In the end I don't know that it matters.
I don't think it does, other than when it comes to scaling or assigning the weights
to other factors one may wish to consider so they are of the same magnitude.
so ... just trying to get a sense of what range of numbers might be returned.
obviously, if a bot has many decendants which are thriving ... it's score is going
to be high and it is a good candidate and one which we want to capture.
Quote
Feel free to take whatever I had and run with it. It's not like it's a critical part of the program, it allows a great deal of consequence free experimentation.
exactly. and making it as 'open' as possible for the user ...
is a good thing, ime.
one may wish to have the bot that is saved as 'fittest' to be one
that has not only survived and prospered, but one that has some
useful mutations. iow, it doesn't do a lot of good to auto-save the
fittest bot if it is going to turn out to have the exact same DNA with
no mutations as the 20 it has saved before, so giving the number of
mutations some weight in the selection process might be of some use.
and who knows what else the user might desire to look for?
greatest slime producers, most kills, etc.  whatever.
so, finding a way to make it more versatile for the user is, imo
a good thing.
the more user friendly, the better.  
within reason.
when possible. ;)
不知
~griz~
[/color]
   "The selection of Random Numbers is too important to be left to Chance"
The Mooj  a friend to all humanity
[/color]

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Survival-of-the-fittest evobot
« Reply #49 on: February 27, 2006, 12:44:21 PM »
Keep me posted on your progress ;)

Offline Griz

  • Bot Overlord
  • ****
  • Posts: 608
    • View Profile
Survival-of-the-fittest evobot
« Reply #50 on: February 27, 2006, 05:20:27 PM »
Quote
Keep me posted on your progress ;)
ah ... I see.
well I won't bother you with it ...
you probably have important things to do.
« Last Edit: February 28, 2006, 09:41:53 AM by Griz »
不知
~griz~
[/color]
   "The selection of Random Numbers is too important to be left to Chance"
The Mooj  a friend to all humanity
[/color]