Welcome To Darwinbots > Newbie

Overall Concept

<< < (2/4) > >>

Trooper5445:
Thank you so much for your help. That has cleared it up for me a bit. I'll see what I can do to help my little bot.

Thanks for the prompt replies. I'll post in here if I have any more questions to avoid clutter.

Numsgil:
We like clutter

Trooper5445:
So I've been working on the little (creature? bot?) and this what I've come up with. It has some intresting behaviors but I'm having some problems.

A: I'm not sure my sex code is right
B: It is attacking its own species
C: Is the whole reproduction code I wrote even working?
D: Code seems very inefficient

Testing has found some intersting things though

A: Population expodes every 500 cycles or so. (So it seems some of the Reproduction code is working)
B: Low mutations
C: Normally Population multiplies by about 1.5 every population explosion, then loses half of the new population for a total gain of 25%.

Code:


--- Code: ---' L-Sesilia
' A robot that really doesn't want to do anything
' With help from the kind community (EricL, Shasta)
' Lazy Sessile

' Gene 9 - Sexual Reproduction if energy is less than 7500
cond
  *.50 1 =
  *.robage 500 >
start
  robbage 500 -
  -8 .shoot store

' Gene 8 - Reproduce asexually if energy is greater than 7500
cond
  *.50 1 !=
  *.robage 500 >
start
  25 .repro store
  robbage 500 -
stop

' Gene 7 - Set a varible for reproduction to be used later.
cond
  *.nrg 7500 >
start
  1 50 store
stop

' Gene 6 - Dispose of excess waste
cond
  *.waste 45 >
start
  -4 .shoot store
  *.waste .shotval store

' Gene 5 - Persue Food by acceleration
cond
  *.refye 5 !=
start
  5 .up store
stop

' Gene 4 - Avoid Friendlies, Spin Right if detected
cond
   *.refeye 5 =
start
  -104 .aimdx store
stop

'Gene 3 - Shoot if location 75 is not equal to zero
cond
*75 0 !=
start
-1 .shoot store
stop

'Set location 75 to 0 if nothing is seen
cond
*.eye5 0 =
start
0 75 store
stop

'Set location 75 to 1 if something is seen in eye5
cond
*.eye5 0 >
start
1 75 store
stop

end
--- End code ---

I was trying to base this on the fact that several animals reproduce sexually only when having problems surviving and when they are doing well reproduce asexually. Any help or comments are welcome.

EricL:
You have a few syntatical errors.  You might want to take a look at the bot's DNA as the simulator sees it by double clickign on a loaded bot in a sim and using the bot properties dialog to spot syntax problems.

Gene 9 (top gene, actually gene 1 as far as the DNA is concerned)  is missing a stop.  Also 'robbage' is not a sysvar.  Misspelling?  Note sure what you are trying to do with that line and same line in gene 8 (gene 2 as far as the DNA is concerned).

Gene 6 is also missing a stop.

It's coming along though.   Stick with it.  It gets easier!!

Trooper5445:
What I mean was robage which is a variable for age according to the wiki. http://www.darwinbots.com/WikiManual/index.php?title=.robage

Fixed the stops.

and rewrote Gene 9


--- Code: ---cond
  *.50 1 =
  *.robage 500 >
start
  robage 500 -
  -8 .shoot store
  50 .sexrepro
stop
--- End code ---

EDIT: It seems to be working. Its amazing to see population explode at 500 cycles. It goes from 5 (the intial) to around 60 in about 50 frames. By 1500 frames it is up to about 650 bots.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version