Darwinbots Forum

Code center => Darwinbots Program Source Code => Topic started by: Botsareus on April 22, 2005, 06:11:30 PM

Title: Order of mutation
Post by: Botsareus on April 22, 2005, 06:11:30 PM
Check this idea out (I used it for pusherbots)

a means add stuff

b means clone stuff

c means remove stuff

A string is equal "b1-a2-c2" This string is a new thing in the robots dna thatspecifys the order of mutations.
Lets say the rates request for  3 add , 5 clone , and 10 remove
Therefore: It creates a "mutation opperations list" as follows:
Quote
baaccbaccbccbccbcc

Now from left to right of the above it does:

clone . add . add . remove . remove . clone ...

Get it?

Should I add this in when I do over the mutation for DB?
also should I add more "clone code" to Db?
Title: Order of mutation
Post by: shvarz on April 22, 2005, 06:53:16 PM
Bots, maybe I am missing your point again, but it seems to me that you want to have more than one mutation in each offspring.  This is not smart, because that would actually lead to less-adapted bots.  I am really tired of repeating this, but here we go again: For any normal evolution, the average number of mutations an off-spring receives must be less than one.

Most of mutations are harmful.  That's just the way it is, you have to accept it.

Quote
Harmful mutations result in organisms less likely to survive, and so these mutations tend to be eliminated from the population (group of organisms in a species). Beneficial mutations also tend to be eliminated by chance, but less often, and tend to be preserved. As these accumulate, the species can gradually adapt to its environment. Neutral mutations are generally eliminated, curiously, but sometimes can spread to the whole population. We then say that the mutation has fixed in the population. The rate of evolution is the rate at which mutations fix in the population. These can be either beneficial or neutral mutations.

If the offspring have on the average one harmful mutation each, then the population will degenerate; this is called "error catastrophe." This puts a bound on how many non-neutral mutations can occur per generation. It cannot be much more than about one per generation, and in fact, it must be significantly less, since most non-neutral mutations are harmful.
Title: Order of mutation
Post by: Numsgil on April 22, 2005, 07:33:15 PM
Quote
Should I add this in when I do over the mutation for DB?
also should I add more "clone code" to Db?
Bots, I would strongly suggest not even touching the mutations code.  Most of your ideas do not seem grounded in reality.  That is, you don't seem to understand how real organisms evolve, where change comes from, and the rate of change.

I would strongly suggest finding a good bio book and reading up.  I think if you go through the mutations code with your current mind set and knowledge level you'll make things worse.

I think the current mutations code is servicable, if not a bit incomplete.  A Chi-Squared type table for converting sysvar to sysvar for like commands and things would be extremely useful, as well as ways to turn on/off or strengthen/weaken the probalities of certain sysvars.

That is, giving more control over mutations to the user, not really changing the ways mutations work.
Title: Order of mutation
Post by: Botsareus on April 26, 2005, 04:48:17 PM
Ok Never mind , I wont evolve any good bots for Db, you guys do what ever you want with Db , I am just here because reading and replying to posts is fun...

(Right now I am working on pusher bots anyway)

Under all simulations I have (insane by a biologist point of view as I can see) mutation rates, well I'll see what happens with pusherbots , if it is going to be worth posting , I would post it on my website...

I hate the compile and the execute parts of the dna because every little element is different, its so annoying.
And forget about mutations... forget about mutations (you guys won't like it anyway) ,.. but: I have to include clone for each type of type of data , add remove change , all must be specific and independent of each other , it ends up being us much work as compile only more because you have to add randomizations everywear.

(Funny, I better not tell in college what I am good at, ill just say I know some vb , thats all , I dont want to see no reactions of no proffesors brainwashing them about the evolutions stuff)  Hey I am not  enstein I dont have the modevation he has when he pulls out all his paper work and presents it to the scientific comunity like its gold.
The knowledge I gain from my little computer science experience and my ideas it seems will go with me to the grave, like hell I dont want that to happen but I guess I ran out of choices.

Below: stuff NOT out of real life , its from a combinations of calculations I did in my head right now , and stuff I learned from computer simulations

Maybe if the organisms become completely meat sims when they reproduce (that is, both of the daughter cells die if the mutation is bad) then, of course, it is nice to skip mutations once in a while.(Numsgils translation for the tired:
If mutations cause a lot of death then it is better to skip generations for muations once in a while.

But if you have a situation where the organism is going to reproduce anyway, even if its mutations are bad, then its actually good to have constant mutations.  That is, the faster a mutation can become good or some crazy system will evolve that, by its uniqueness beats the competition, the better. You really need to see how Pusherbots (my project I've mentioned before) works to understand this paragraph (or a poor excuse for a paragraph until Num here fixed it). (Numsgil fixed poor sentence structure.  Remember, sentences have predicates and nomitaves, and they should follow a logical order.)

Finally, when you have a parent that DOES NOT MUTATE WHEN IT GIVES BIRTH, as long as it does not lose a lot of resources, then it doesn't hurt it if the child dies 99% of the time.

Computer code needs a high rate of change for it to produce good results.  In code below:

Quote
turnstop
skip 3 , memory(0) > 3
   memory(1) mod memory(0) , 2
   skip 1 , memory(1) = 0
      turnleft  
   skip 1 , memory(1) = 1
      turnright
memory(0) setmemory memory(0) + 1
skip 1 , memory(0) < 7
   memory(0) setmemory 0

If all mutations do is change one number, I.e. 1 to 2 , or 7 to 8 , or 3 to 4, then the code will still be doing the same thing, or perhaps even worse.

But what if new code was produced in the same quantity as above?  I think one of the following results:

Hey maybe a computer does not exsist in real life, its all in my head.

Rearticulated by Numsgil for better responses.
Title: Order of mutation
Post by: Numsgil on April 26, 2005, 05:35:51 PM
Quote
Ok Never mind , I wont evolve any good bots for Db, you guys do what ever you want with Db , I am just here because reading and replying to posts is fun...

First off Bots, stop being passive aggressive.  It's just annoying.

Second, you're missing the big picture!  Yes, if you have mutation rates set astronomically high then you are more likely to find some useful mutations.  It's a simple numbers game.

However!  It becomes harder for the mutation to spread through the rest of the population since it is increasingly likely to break as the new mutant bot reproduces.  Remember that mutations are mostly harmful.  That wonderful new uber mutation will appear and disappear without doing you a bit of good.

Children need to be almost identical to the parent if natural selection is going to work.  Even in sexual reproduction, the child is basically identical to the combination of the parents.

Imagine if your kids mutated alot.  Imagine if a cat gave birth to dogs.  It doesn't matter how good a cat the cat is, or how poor a cat the cat is, the dogs are going to be dogs.

Lower mutation rates assure that if a useful mutation is discovered, the mutated individual has a chance to reproduce and spread the mutation to future generations.  Especially in a complex sim like DB you need to have a strong correlation between parent and daughter cells.
Title: Order of mutation
Post by: Botsareus on April 26, 2005, 05:41:31 PM
[span style=\'font-size:21pt;line-height:100%\']CHARTS[/span]



=========
Dont mind the next 2 posts:
Title: Order of mutation
Post by: Numsgil on April 26, 2005, 05:57:40 PM
Charts?
Title: Order of mutation
Post by: Botsareus on April 26, 2005, 06:00:46 PM
lol , charts is a good term , why not call it charts, I wanted to arrange it like in microsoft excel, did not work.

Anyway Num , I got to go , my parants want me to help with the cleaners...
Title: Order of mutation
Post by: Botsareus on April 28, 2005, 02:09:28 PM
Talk about flipflopping: I will make my own virsion of Db and post on my website anyway, If no one likes it then dont use it, (hard thing will be staying in touch with all the updates you guys do, Solution: keep the original files , compare originals to darwin Bots new files , change my virsion with changes in new files, fix errors)

=====
Also I might upload the new smexe , I seen some pritty cool msdos errors:
Quote
goprep # Hh $#
MFC inaccessible
Abort, Fail
somthing like that.
Title: Order of mutation
Post by: Numsgil on April 28, 2005, 06:53:48 PM
We should keep all versions together, it'll only create confusion and counter effort when we try to combine them again.  The way the code is segmented it should be easy to change A without effecting B.
Title: Order of mutation
Post by: PurpleYouko on April 28, 2005, 07:25:28 PM
Quote
We should keep all versions together, it'll only create confusion and counter effort when we try to combine them again. The way the code is segmented it should be easy to change A without effecting B.
I will definitely second that!
You should see the trouble that Num and I have trying to keep our source code synchronized.
Basically every time I modify a single peice of code, I email to change to him.
We absolutely have to keep the code up to date on both sides or it soon becomes completely impossible to re-integrate it.

It certainly makes it easier for each of us to concentrate on a certain area of the program and try our best not to modify any code that is common to both our projects without letting each other know immediately.

It isn't easy  :(
Title: Order of mutation
Post by: Botsareus on April 29, 2005, 02:17:44 PM
well I dont have the right modem and the time to keep emailing you guys all my changes, when I will change it I will change it all at once and send the code to my website.

Check this out:

Make aimshot shoot more then one place like in real sells , its kinda like multi-aim-shot every time .aimshoot is called on a different angle. ex:

20
.setaim
store
-1
.aimshoot
store
120
.setaim
store
-6
.aimshoot
store

this results in a robot that shoots in two directions at once.

***
I am still not done with pusherbots so if you guys want to add multi-aim-shoot yourselfs go ahead.
***

How will multi-aim-shoot not be overpowered?

ans:

* you cant aim less then 15 degrees difference so
 if you shoot at 10 degrees you cant shoot at 11 degrees at the same time.

* if you shoot more , you waste more energy. A robot shooting 24 different shots will die almost instantly.
Title: Order of mutation
Post by: Botsareus on April 29, 2005, 02:19:45 PM
I seen real cells use multi-aim-shot its possible , no joke.
Title: Order of mutation
Post by: PurpleYouko on April 29, 2005, 02:25:38 PM
Quote
20
.setaim
store
-1
.aimshoot
store
120
.setaim
store
-6
.aimshoot
store

Even with the hypothetical sysvar, .aimshoot, your example will not and cannot work.
Remember that each sysvar represents a single memory location in the robot.
For your example to work, it would be necessary to save multiple values into the same memory location in a single cycle.
If these commands were in the genome then only the last instance of each one would be implemented.
.setaim would contain the value 120. (20 would be overwritten and lost)
.aimshoot would contain -6. (-1 would be overwritten and lost)
Only a single instance of each of these sysvars (memlocs) would ever be processed so the robot would still only shoot once
Title: Order of mutation
Post by: Botsareus on April 29, 2005, 02:27:08 PM
I beat I can find a way arround that;
Title: Order of mutation
Post by: PurpleYouko on April 29, 2005, 02:27:28 PM
And incidentally, regular shots have a spread of about 20 degrees anyway. They don't shoot straight out. They have a random offset from the robot's aim angle.
Title: Order of mutation
Post by: Botsareus on April 29, 2005, 02:29:20 PM
yes I know , its not a straight line.

DoH I forgot I am BlinD aNd I am seeing them shoot straight lines...
Title: Order of mutation
Post by: Botsareus on April 29, 2005, 02:30:46 PM
sounds like have to add another one without your approval.
Title: Order of mutation
Post by: PurpleYouko on April 29, 2005, 02:34:30 PM
It could be done, but not without making enormous changes to the source code.
The only way around it would be to completely change the way that DB parses the DNA.
First, you would have to add a new stack to keep track of requested shots.
Next you would have to remove all shot calls from the regular robot code and shift those calls into DNA parsing.
Next you will need a loop that reads back the shot requests from the shot stack and sends the code to the right routines to make the shots.
The next problem you will have to face is how to integrate secondary shots like -2s, poison and viruses into your new system. These are generated in a different way in response to stimuli which can only be accessed in the main loop of the program and not from DNA parsing.

To be honest, it would be almost as quick to write an entirely new program as it would to make those kind of changes.
Title: Order of mutation
Post by: PurpleYouko on April 29, 2005, 02:36:31 PM
Quote
sounds like have to add another one without your approval.

Go right ahead and add whatever you like. You don't need my approval to make changes to the source code. It's free source so go ahead. Knock yourself out.  :lol:

I am just pointing out the pitfalls.
Title: Order of mutation
Post by: Botsareus on April 29, 2005, 02:39:31 PM
:) thx PY,

I thought that having an idea of a new program - then changing the idea into actual code was the hardest thing to do.

Changing an exsisting source code with a few minor changes is the second hardest thing thats for sure
Title: Order of mutation
Post by: PurpleYouko on April 29, 2005, 02:43:43 PM
Actually Bots, I would have to disagree.

I think making large changes in an existing code with complex interactions is much harder writing new code.
The difference is that you get instant gratification when it works properly instead of having to build the entire program first.
Title: Order of mutation
Post by: Botsareus on April 29, 2005, 02:46:43 PM
and to think, I am not even in collage yet, and I am talking about programing like that with guys in the feild... B)
Title: Order of mutation
Post by: Numsgil on April 29, 2005, 03:15:04 PM
Technically neither of us are in the programming field.

Aimshoot already exists (but you knew that, right?)  It lets you specify an angle to fire your shot from.  I'd have to look it up again to see exactly how it works, but I think I put an netry on the wiki.

I don't like the idea of multiple shots in a single cycle.  It would make new bots way too powerful compared to older bots.  I'm all for giving the bots easier use of existing functions and even a few new functions, but we have to keep things balanced.
Title: Order of mutation
Post by: PurpleYouko on April 29, 2005, 05:22:24 PM
You can shoot a normal shaot and a virus in the same cycle.
Does that count?  :rolleyes:
Title: Order of mutation
Post by: Botsareus on April 30, 2005, 01:57:48 PM
WHAT? ITS IN THERE ALREADY?

O well , saves me trouble.

Good Job guys...