Darwinbots Forum
Code center => Bugs and fixes => Bug reports => Topic started by: Welwordion on November 23, 2007, 07:41:36 PM
-
cond
*.robage 200 =
start
20 .repro store
stop
end
tested it in 2.43s did not work tested it in in 2.43 did work (and now I will stop test developing my bots in 2.43s ^^)
-
Hey, don't give up already!
Try removing the '='.
New rules in 2.43s; no logic operators.
-
^^ good to know how exactly does that work? I mean > and < are also logic operators right?
And also there was some statement about conditionals within a genes body what does that mean?
And what are the operators True and False?
82) Conditionals are now allowed in the body of genes and can impact the success of memory operations within the gene body.
83) The commands True and False have been added.
-
Eric or Nums can probably explain the details about the new way the DNA works, but I did a little testing here with your bot, and found I could as well delete the Cond statement instead of the = operator. Strangely, removing the cond statements didn't have any effect on my evobots, but removing the logic operators on them did.
-
Hey, don't give up already!
Try removing the '='.
New rules in 2.43s; no logic operators.
Wh... what no logic operators, I hope you misunderstood something, this could mean the end of well functioning of many bots, certainly the majority of F1 and F2 and SB and MB(well mine the only that functions properly, right now), I got to check mine bots now, almost any bot uses logic operators.
^^ good to know how exactly does that work? I mean > and < are also logic operators right?
Yes, correct, there are some more, I am not too sure about the statement of testlund, if it is true it is really drastic.
And also there was some statement about conditionals within a genes body what does that mean?
And what are the operators True and False?
I think he means a gene in a gene with conditionals in gene body, hm wait I am goning to check that one, wasn't his already possible.
This is what I think.
In fact making an if insida an if.
if (true) {if (true){}}
Cond
Start
....Cond
....Start
....Stop
stop
82) Conditionals are now allowed in the body of genes and can impact the success of memory operations within the gene body.
83) The commands True and False have been added.
The operators true and false, it is really a rather small fix.
Normally you have, well I take your gene.
*.robage 200 = gives a true when the bot is 200 cycles old(atleast it is supposed to do.)
1 gives always a true.
cond
1
start
20 .repro store
stop
Will always execute.
-
The changes to the way DNA works should be backwards-compatible for hand authored bots. It's only evo bots, with their rather peculiar mix of nonsensical DNA, that would be broken.
If that first gene isn't working, it's a bug.
-
The changes to the way DNA works should be backwards-compatible for hand authored bots. It's only evo bots, with their rather peculiar mix of nonsensical DNA, that would be broken.
If that first gene isn't working, it's a bug.
Yes, there is somehow *.robage doesn't come over 200.
Still what has changed, wasn't it something like the stack is being reset at a cond statement, that case some hand-made bots could have a problem, just a few but there are some.
-
There are two stacks. One is what we usually mean when we say "stack". It holds numbers. That one isn't affected. The other is a boolean stack that handles conditions. That's the one where changes have been made. A cond resets the boolean stack (I think), but doesn't affect the integer stack.
-
Yes, correct, there are some more, I am not too sure about the statement of testlund, if it is true it is really drastic.
I expressed that a little bluntly, but the fact is that removing every logic operator on my Chainbot restored it to functionality, the same with my tiebot (both coming from the same zerobot ancestor), but it could very well be that I also caused some change in the bots behavior that I'm unaware of.
But removing some logic operators on hand written bots should stop some of there functionality, for instance the Animal Minimalis shouldn't be able to reproduce when it's above 10000 energy if it didn't have the '>' operator.
-
Allow me to inject some clarity.
As Nums says, the new conditional paradym should be 100% backward compatable with hand authored bots. People can code their bots as they always have without caring about or understanding this change if they like. In particular, ALL EXISTING HAND AUTHORED BOTS SHOULD CONTINUE TO WORK AS THEY DID BEFORE. If they don't, it's a bug.
The change in question is restricted in present versions to allowing the execution of conditionals in the gene body (the part after start). There have been no changes to the conditional portions of genes (the cond part). In particular, stores are still disallowed in the cond section. Anyone wanting to better understand the new paradym should look here (http://www.darwinbots.com/Forum/index.php?showtopic=2299&hl=).
As Nums says, the gene in the first post of this topic should work perfectly as coded. The new conditional paradym is orthoginal to this discussion. It has no bearing on it. If the gene does not workas coded, it is a bug. I will look into this and keep this bug open until I do.
Testlund is, um, mistaken. Conditionals should not be removed from hand authored bots. They do what they have always done. They just do it in more places (they now work in the gene body and if present, impact what happens in the gene body). Removing the "=" in the cond section of the gene above has nothing to do with the new paradym. What it does is cause the gene to always fire since there is now no conditional logic in the cond portion of the gene, so it defaults to true.
If you have an evolved bot which evolved in a version prior to 2.43r, they way you preserve that bot's logc is to remove all conditionals from the BODY of it's gene(s). In particular, if you managed to evolve a bot with a cond section that actually works, you SHOULD NOT tinker with it. (And if you have actually managed this, you have won the Conditional Logic Prize).
A "cond" statement does indeed reset the boolean stack. Nums is correct again. It is important to note however, that a "start" does not.
True and False mearly push true or false onto the boolean stack. I've updated the Wiki on these.
-
Ok. Maybe I've crippled my tiebot then. Are you saying all 'cond' statements and 'logical operators' together form the conditionals and that they should be removed if they are in the body of the gene, which if I understand it correctly should be between a start and a stop command? Nums said just remove all logical operators and in my Chainbot you edited you removed all cond statements and logical operators.
Here's what my original tiebot looks like:
1 mod mult & cond
floor add angle >=
or
or
& ~ store
and
cond
start
xor
mult %=
dec
add 3 start
angle 21 ~ 1 & mult *.setaim -6 sqr *13 - << mod >
and
xor
-5 17 =
>=
!=
floor angle rnd store
31 store
>> 5 <
>
mult 1 add else
and
store
cond
>
>
and
*.up mult angle | *345 !~=
angle dec
angle ^ -1 div >
- div xor
store
*.shoot << 2 angle =
store
6 * >
dist else
angle and
cond
~ add store
start
*.up dec
store
or
18 ++ store
dec
xor
mult *.up *.hitsx mult inc
add and
& ceil <
store
!%=
add - store
.dn store
.up store
store
<<
-
And here's my new attempt to fix it:
1 mod mult & cond
floor add angle & ~ store
cond
start
mult dec
add 3 start
angle 21 ~ 1 & mult *.setaim -6 sqr *13 - << mod -5 17 floor angle rnd store
31 store
>> 5 mult 1 add else
store
*.up mult angle | *345 angle dec
angle ^ -1 div - div store
*.shoot << 2 angle store
6 * dist else
angle ~ add store
start
*.up dec
store
18 ++ store
dec
mult *.up *.hitsx mult inc
add & ceil store
add - store
.dn store
.up store
store
<<
In any case the bot seems to work well.
-
It's' unlikely that your zerobots were using conditions, so removing ALL the conditional operators fixes the problem of them suddenly working now
Of course, your DNA is now much shorter, so you might want to add in some 0s at the end or something to give them some more wiggle room.
-
I have tested the gene in the first post in this topic and can find no bug. The gene seems to work, the bot reproduces successfully at age 200. I have also verified that the .robage memory location is working correctly.
Note that several things must be true for a bot to successfully reproduce:
They must have body > 2.
They must be older than 10 cycles.
There must be room in front of the parent for the offspring to appear. A bot right up close facing another bot (or a shape) will be prevented from reproducing.
If you still feel there is actually a bug, please post a sim which demonstrates it. Thanks.
-
They must be older than 10 cycles.
Is that new?
-
They must be older than 10 cycles.
Is that new?
How did I know you were going to catch that?
It's like maybe a year old. I added it a while ago on a private fork when I was playing around with ways to limit explosive reproduction spiking CostX and well, it sort of "accidentially" made it into the main line. I've thought about removing it, but well, forgot it was there frankly. It has been removed in 2.43t.
-
How did I know you were going to catch that?
I have excellent backseat programming skills