1
Bot Tavern / Rogue genes
« on: January 31, 2010, 12:12:58 PM »
I took a long break from darwinbots. Just reintroduced myself yesterday and I started a little bot to get re-familiarized with DNA programming. For the most part everything is working OK. Except there's a gene activating when it shouldn't. Here is the gene along with the other relevant ones:
Some defines
[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']
def specIDloc 972
def specID 310
def sthreshold 20 'Distance at which the effects of the tracking gene gets deactivated and the feeding gene activates
(These aren't contiguous)
This sets the species' ID
[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']
'Set spec
cond
*.robage 0 =
start
.specID .specIDloc dup .memloc store store
stop
The problem gene is in this section
[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']
'Scan eyes
cond
*.eyef 0 =
*.memval *.specIDloc = or
start
.up 10 *.velscalar sub sgn 0 floor mult dup inc inc
*.timer 9 mod 4 sub .focuseye store
stop
'Center eye5 on prey
cond
*.eyef 0 !=
*.memval *.specIDloc !=
*.focuseye 0 !=
start
*.focuseye 140 mult .aimdx *.robage sgn mult store
0 .focuseye store
stop
'Track prey
cond
*.eye5 0 >
*.memval *.specIDloc !=
0 *.focuseye =
start
*.refvelup 50 add .up .sthreshold *.eye5 sub sgn 0 floor mult store
*.refxpos *.refypos angle .setaim *.robage sgn mult store
stop
The problem is the track prey gene gets activated even when eye5 'sees' the same species (despite the *.memval *.specIDloc != condition), and starts to chase it.
The only thing preventing it from continuously tracking it's own species is that the scan eyes gene is still activated and changes the focuseye the next cycle. So it results in intermittent tracking (of its own species) every 9 cycles. This bot works fine for non-specs and even though it doesn't shoot it's own species (the feed gene doesn't activate for conspecs), it is a wasteful behaviour and I really can't see why this gene is activating. I've used to console to evaluate the conditions and in the cycle that the track gene gets activated it shows that *.memval = 310 and *.specIDloc = 310. Also is *.timer capped at 32000 like *.robage?
BTW: The eyes' position and width have been changed to provide even 360 deg. vision
Some defines
[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']
def specIDloc 972
def specID 310
def sthreshold 20 'Distance at which the effects of the tracking gene gets deactivated and the feeding gene activates
(These aren't contiguous)
This sets the species' ID
[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']
'Set spec
cond
*.robage 0 =
start
.specID .specIDloc dup .memloc store store
stop
The problem gene is in this section
[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']
'Scan eyes
cond
*.eyef 0 =
*.memval *.specIDloc = or
start
.up 10 *.velscalar sub sgn 0 floor mult dup inc inc
*.timer 9 mod 4 sub .focuseye store
stop
'Center eye5 on prey
cond
*.eyef 0 !=
*.memval *.specIDloc !=
*.focuseye 0 !=
start
*.focuseye 140 mult .aimdx *.robage sgn mult store
0 .focuseye store
stop
'Track prey
cond
*.eye5 0 >
*.memval *.specIDloc !=
0 *.focuseye =
start
*.refvelup 50 add .up .sthreshold *.eye5 sub sgn 0 floor mult store
*.refxpos *.refypos angle .setaim *.robage sgn mult store
stop
The problem is the track prey gene gets activated even when eye5 'sees' the same species (despite the *.memval *.specIDloc != condition), and starts to chase it.
The only thing preventing it from continuously tracking it's own species is that the scan eyes gene is still activated and changes the focuseye the next cycle. So it results in intermittent tracking (of its own species) every 9 cycles. This bot works fine for non-specs and even though it doesn't shoot it's own species (the feed gene doesn't activate for conspecs), it is a wasteful behaviour and I really can't see why this gene is activating. I've used to console to evaluate the conditions and in the cycle that the track gene gets activated it shows that *.memval = 310 and *.specIDloc = 310. Also is *.timer capped at 32000 like *.robage?
BTW: The eyes' position and width have been changed to provide even 360 deg. vision