Darwinbots Forum

Bots and Simulations => DNA - General => Topic started by: AZPaul on March 24, 2005, 03:13:16 PM

Title: 5 Questions re DB opns
Post by: AZPaul on March 24, 2005, 03:13:16 PM
Howdy 'gin folk,

Some simple inquiries to facilitate my understanding:

1.  Console

Usefull debug tool. Console window says "type help." Do that...nothing happens.
Can we see a bot's specific memory values thru console? Also, would like ability to expand that window some to see more.  My DNA is (as am I) quite verbose.

2.  Specific to memloc/memval

Do we have to "shoot" .eye5 to gain these values? I've looked for an example, not extensively tho since I'm being somewhat lazy this week, and can't find one.  If I shoot a memloc thru .eye5 does the target bot have to "shoot" back the memval? (I hope not). Any code example (some specific bot in the library)?

3.  Criteria for "Saving Best Bot"

Is this based soley on # offspring produced (I would assume) and what is the tiebreaker when you have 30 bots with same # of prodgeny?

4.  Organism vs DNA save

Say what? So once the best is saved I have to go back retrieve it into a sim and capture the DNA? The DNA is the organism, yes? Why not just save the bot's DNA in the usual .txt format? There is a reason, I'm sure. What is it? What am I missing?

5.  DNA limits

In building my base evo sim bots I am throwing all code efficiency to the cows.  I am purposely breaking gene conditionals into separate genes using switches/triggers for control. When .sexrepro is working well enough the gene swap routines will produce copious variability. I have a base herbivore now that goes out looking to cuddle up to a mate (proximity sets off the .repro gene) and I haven't even built in the sex selection criteria yet. She just gets close enough to any other of her species and drops the kid. Already up to 30+ genes. What are the limits? # of genes? overall DNA length?

OK, I lied, again. 6 questions.

6.  Racial memory

The racial memory is passed onto junior one location per cycle after the 20-cycle birth tie is severed?  Even if mom & junior are in the process of swimming away from each other? Is this intended to be the "nurture" side of the "nurture vs nature" duality? No, I'm not complaining. I can make use of this.  Just curious.

I gotta tell ya, I love this thing. Not just the academic exercise. It's down right fun.

One of the first areas to be "mutated" is often that "break birth tie" logic (at least that's the one most immeadiatly visible). The result can be hilarious (I'm easily entertained).  I had a cluster of 16 cells all linked and thrashing about like a tenticled anemone enveloping one of those cabbages (alga_minimalis).  Even though no mutated code showed any coordinated action, when a delta came up to take a nibble the "arms" seemed to fold around it and each cell shot the ever-livin bejesus out if it. One dead delta. This happened atleast a dozen times.  Eventually, about 6 deltas all found it all at once and ripped it to shreds. The thing lasted a good 20,000 cycles.

Enough for now. Gotta go.

Thanks, as always.

-P
Title: 5 Questions re DB opns
Post by: Numsgil on March 24, 2005, 03:47:02 PM
I'll answer what I can, but some of this I never use, so I don't know how it works.

1.  What are you typing exactly.

Type exactly what I put on the line beneath this one and hit enter
help

that should tell you all about various console commands.

The widow that shows DNA should have a slider on it.  It's uinfortunate that each bit is given it's own line.  Makes the DNA very long.

2.  Okay, memval works exactly like the ref variables.  It returns whatever is in the memory location memloc of the robot in eye5.  There aren't any shots involved, it's all automatic.

memloc likes to reset in 2.35, so make sure you're resetting it the turn before you're reading it.  I have this at the start of my DNA, takes care of everything:

cond
*.memloc .yourvalue !=
start
.yourvalue .memloc store
stop

where .yourvalue is the memory location you want.

3.  Yep, most numerous offspring, though I'm playing with the idea of returning the bot who has the most vested energy between it and it's offspring.

So it's whichever species can retain the most energy, not necessarily number of individuals.

But that's all for later of course.

4.  No idea.  I just copy and paste DNA from the console to a text file.

5.  In 2.35, the number of genes is like 300 I think and the DNA length is 1000 I think.  The DNA length in the newer version will be removed, but I think the gene limit is still there.

6.  
Quote
The racial memory is passed onto junior one location per cycle after the 20-cycle birth tie is severed

Close, it's:
The racial memory is passed onto junior one location per cycle after the 20-cycle if the birth tie isn't severed.
Title: 5 Questions re DB opns
Post by: AZPaul on March 24, 2005, 04:25:39 PM
Whoa, that was quick, Nums. Thanks.

1. Console

Yes, just

help

in the console window and I get zip. Not even character feedback.
The console is not "running" at the time.
Again curious, what are the "nose" and "hand" for?

2. Memloc/memval

Excellent answer! Just what I needed. You coded this just for me and my strange peccadillos, didn't you. Excellent answer, indeed.

3. Best bot offspring

So what does the code in 2.35 do now when there are numerous bots with the same # offspring?

4.  Organism vs DNA

Not that there isn't enough on the programmers' plates, but, maybe consider changing this. Unless there is real reason it is the DNA code we want to look at on these mutants. Might as well save a step and write best bot to .txt  

I'm not sure how an "organism" is defined in DB. We save the color, display size, that little gene display in the center, mem locations and values? Doesn't really matter. Unless there is some hidden need unknown to us both?

5. So after the 20-cycle period, [you]if the birth tie is still there[/you], the transfer will take place one location per cycle? I thought DB disolved the tie automatically at 20 cycles, no?

-P
Title: 5 Questions re DB opns
Post by: shvarz on March 24, 2005, 04:42:10 PM
4.  When you save organism, you save the whole thing, even if it is multicellular.  And I beleive you save everything, including all memloc values, energy and stuff.  For multibots you also save the relative positions of all bots in the organism.
Title: 5 Questions re DB opns
Post by: PurpleYouko on March 24, 2005, 05:08:45 PM
Quote
5. So after the 20-cycle period, if the birth tie is still there, the transfer will take place one location per cycle? I thought DB disolved the tie automatically at 20 cycles, no?

No you got that wrong.

Birth ties last 100 cycles.
Ties that robots attach themselves remain soft and pliable for 20 cycles before hardening.

 :D  PY  :D
Title: 5 Questions re DB opns
Post by: Numsgil on March 24, 2005, 05:21:08 PM
I don't know why you're console help isn't working.

Here's what it says:

Quote
This console works as an input/output interface for a single robot.
It could be used for robot debugging and manipulation.
One of the most useful features of the r.c. is that it shows
which parts of the dna are executed in each cycle. Just press the single
cycle button to try. To watch the entire dna, just click the button at
the extreme right in the console.

Other commands are:
printeye : prints the eye cells status
printtouch : prints the touch cells status
printtaste : prints the taste (hit) cells status
printmem (or ?) (.var|n): prints value of .var or location n
set (.var|n) value : stores value in variable .var or location n
energy e : sets the robot's energy at e
cycle n : executes n cycles
execrob : executes all robots without doing a cycle
showdna : brings up the robot details window showing the robot's dna

Are you typing it into the command line?

Here's what it looks like:

___________________________
|.............................................|
|.............................................|
|....DON't TYPE HERE................|
|.............................................|
|.............................................|
|.............................................|
|__________________________|
|......TYPE HERE........................|
___________________________
Title: 5 Questions re DB opns
Post by: AZPaul on March 25, 2005, 02:30:51 AM
Nums, PY, shvars,

Excellent, Gents. Excellent indeed.

One outstanding:  Best bot -- when multiple bots have the same # kids what criteria does the program use to select which one for autosave? The red one? Something with "42" in it since 42 is the answer to...well, you know.

As for the remainder:

Got it all. Everything is copacetic. I have seen the error of my ways. I am armed with copious correct information. I go forth now knowing that the true answers are mine. I am content.

For the moment.

Thanks, all, again.

-P
Title: 5 Questions re DB opns
Post by: PurpleYouko on March 25, 2005, 08:48:27 AM
The best bot issue has been raised a number of times before. It is really a big problem for us to actually figure out who the best bot really is.

There are chunks of code in the program that are made to find things like oldest survivor, most offspring, most health and a whole bunch of others. the trouble is that they are not linked to anything.

It may be an idea at some point to add a list of options to the menu so that you can specify which kind of best you actually want.

To be quite honest it isn't an area of the code that has received a great deal of attention. I have no idea what haopens in your scenario but I guess I can find out and let you know.

 :D  PY  :D
Title: 5 Questions re DB opns
Post by: shvarz on March 25, 2005, 10:20:56 AM
The only reasonable way to find the best bot is to look at the frquency of different genotypes.  The one most frequent is the best.  In case you don't know: The snapshot feature that PY made together with the excel sorting utility do the trick nicely.
Title: 5 Questions re DB opns
Post by: Old Henk on March 25, 2005, 11:27:32 AM
Quote
4.  No idea.  I just copy and paste DNA from the console to a text file.
You can also right-click a bot, and select "Save Robot DNA as".
This way, those "----------1, ----------2" lines aren't there.
Title: 5 Questions re DB opns
Post by: Botsareus on March 25, 2005, 11:32:19 AM
Shvartz: "excel sorting utility "

Shvartz , Witch virsion of excel you have? , Were is it?, I like to try this one...


P.S.
I think corrently the best bot looks at the robot with the most offspring, for my evo. sims I did resently it worked very well...
Title: 5 Questions re DB opns
Post by: shvarz on March 25, 2005, 12:05:59 PM
The file is right here: http://utenti.lycos.it/darwinbots/snapshot.xls (http://utenti.lycos.it/darwinbots/snapshot.xls)

I have Office 2003, but I am pretty sure it works in Office 2000 as well.  Don't know about earlier versions.

Choosing a bot with the most off-spring is a pretty good approximation for the most frequent genotype, unless there is something wrong with it's reproduction strategy (for example it can have a messed-up repro gene, which causes it to reproduce frequently, but give tiny amounts of energy to it's babies).
Title: 5 Questions re DB opns
Post by: PurpleYouko on March 25, 2005, 12:33:46 PM
But then I think it works on surviving decendents rather than total offspring so that filters out dodgy repro genes after a while.
Title: 5 Questions re DB opns
Post by: Botsareus on March 25, 2005, 12:37:47 PM
Good Point PY

Ok , thx shvartz
Title: 5 Questions re DB opns
Post by: PurpleYouko on March 25, 2005, 12:42:07 PM
Quote
I have Office 2003, but I am pretty sure it works in Office 2000 as well. Don't know about earlier versions.

Should work on pretty much any version. I wrote it in excel 2000 but there is nothing Earth shatteringly complex about the macros.
Title: 5 Questions re DB opns
Post by: AZPaul on March 25, 2005, 02:02:03 PM
Thanks folks, again.

I was just wondering how this feature worked in 2.35

It is not a major issue, PY, and no need to spend time searching through old code.

The issue is interesting, though.

The "goal" of evolution, if it can be said to have one, is procreation. Dawkin's Selfish Gene, if you will. Number of offspring is the prime key, of course. For programming efforts, though, the secondary and tertiary sort selection is a quandry.

Is longevity a proper second?  Is a slow breeder that lives long "better" than a fast breeder with limited life? I donno.

Most cumulative mutations? Maybe. That is of interest. That is the reason for the simulation isn't it. Most mutations from the start of the sim and still tied for top breeder? That may indeed be "best."

My input: # offspring
              # cumulative mutations
              # cycles (age)
              any bot with "42" in the DNA

Well, maybe not that last one.

-P
Title: 5 Questions re DB opns
Post by: Numsgil on March 25, 2005, 02:08:20 PM
I think this is a strong candidate for an outgrowth of the scripting stuff PY started.
Title: 5 Questions re DB opns
Post by: PurpleYouko on March 25, 2005, 02:24:17 PM
Right. The scripting could easily me modified to include that sort of thing. Then you don't have to worry about pausing the game up or anything. Just set the scripting editor to automatically save a snapshot file when a robot meets the criteria that you set.
Title: 5 Questions re DB opns
Post by: Numsgil on October 15, 2005, 12:16:21 PM
We all agreed it should be expanded and included.

And have since sat on it.  We need like a team of programmers (like 5) to really get the program moving as fast as the ideas are comming in.
Title: 5 Questions re DB opns
Post by: Ulciscor on October 15, 2005, 12:19:50 PM
I don't think I'm a good enough programmer to be of any help, personally.
Title: 5 Questions re DB opns
Post by: Numsgil on October 15, 2005, 12:23:56 PM
It's all a matter of practice.  I'd start off a new programmer on some task that isn't directly related to the engine, some small little piece.  They'd learn a bit about the program in the process, and try for something larger.

When I started programming, I just added a few commands and sysvars, and PY checked over my work when I emailed it to him.  I'm thinking this would work the same way.
Title: 5 Questions re DB opns
Post by: Ulciscor on October 15, 2005, 12:26:57 PM
Well I'm well eager to have a go, what could I do??
Title: 5 Questions re DB opns
Post by: Numsgil on October 15, 2005, 12:30:31 PM
OOh, yay!

Here's a good task:  I want to make sure that the stack is working right.  Endy was saying something about how the stack was behaving screwy in a recent post.  (I'll have to find it).

Using Visual Basic in debug mode, check to see if the stack is working properly.  That includes removing values, giving 0 if there are no legit values, dropping off older terms as the stack gets too large, adding values properly, etc.

All the code is contained in the module "DNA Execution".
Title: 5 Questions re DB opns
Post by: Numsgil on October 15, 2005, 12:31:25 PM
Here's his post (http://forum.darwinbots.com/index.php?showtopic=749&view=findpost&p=1089720).
Title: 5 Questions re DB opns
Post by: Numsgil on October 15, 2005, 12:44:17 PM
Also, this sounds alot up your alley:

Improved snapshot function (http://forum.darwinbots.com/index.php?showtopic=465).

I'm trying to pick things that won't interphere with porting the code to C++.
Title: 5 Questions re DB opns
Post by: Botsareus on October 15, 2005, 04:25:24 PM
ofcorse there are some programers that write bits and peaces for the program and they never get added .. uhm .. placment control .. uhm. So thouse programers move on to bigger and better things... like fixing bugs in the program... until it gets ported into c++
Title: 5 Questions re DB opns
Post by: Numsgil on October 15, 2005, 04:42:48 PM
Those progammers tend to dump their code into my lap, and expect me to magically integrate it into several thousand lines of code.

Scripts would probably be alot like the settings files.  You edit them in the program, or outside the program with notepad.

They would basically be a set of if-thens that effect the DB universe.

Like:

If robage > 8000 kill robot

etc, etc.  Basically anything the user can do to the bots should be able to be scripted.  Like:

if total_run_cycles mod 1000000 = 0 then friction = friction + 4

or somethng like that.
Title: 5 Questions re DB opns
Post by: PurpleYouko on October 16, 2005, 12:47:10 PM
We already have a simple script system that I added about 6 months back. At present it works only for stuff that happens during reproduction/mutation.

We can do stuff like...

If bot DNA contains no repro commands then kill bot.

You can find this stuff in the mutations panel in the options. It consists of 3 comboboxes with pulldown menus and a big window at the bottom. You can have up to 9 simultaineous scripts at the moment but they are kind of limited in scope.

I have some plans of my own to implement some way serious scripts as soon as I get the free time to work on the program again.
Title: 5 Questions re DB opns
Post by: Numsgil on October 16, 2005, 03:14:37 PM
Those mutation scripts may or may not work in 2.4.  You see, I rewrote the entire mutation/DNA execution code, so random thigns that were specifically added into that code may be, um...  not working.
Title: 5 Questions re DB opns
Post by: PurpleYouko on October 17, 2005, 08:53:39 AM
The scripts work on the returned value of the string variable "x" (I think), that lists the mutations. After that it just scans the DNA file.
As long as you haven't changed the text output from the mutations then they should still work.
Title: 5 Questions re DB opns
Post by: Numsgil on October 17, 2005, 01:11:49 PM
You mean like the mutation details?

Those are entirely rewritten, since the mutations themselves are entirely rewritten.

And DNA types have been rearranged.  About the only thing unchanged is how the DNA looks when it's not in the program.