Bots and Simulations > DNA - General
A condition in one gene is having effect on another?
Peter:
This is somewhat of a startup for a multibot. All the bot is supposed to do. Is just making a multibot with two bots in opposing directions.
Now it just reproduces and does nothing, if you remove that one line there is a bot directed in two directions.
Can someone explain me how this works.
If you don't understand it, load a sim with and without the line.
--- Quote ---cond
*.refeye *.myeye =
*.eye5 0 > // <remove this line and see
start
stop
//multi control center
cond
*.multi 1 =
start
50 .sharenrg store
150 .fixlen store
100 .stifftie store
628 .fixang store
stop
//if alone create a second part
cond
*.numties 0 =
*.robage 0 !=
start
50 .repro store
stop
//second part is recombining with it creator.
cond
*.robage 0 =
*.refeye *.myeye =
start
1 .tie store
stop
//if enough energie split.
cond
*.nrg 30000 >
start
.deltie dec
stop
--- End quote ---
EricL:
// is not really supposed to be used as a comment indicator. As it is, it only works on whole comment lines, not inline. That it works at all is an unintended side effect of another feature I.e. saving hashes into saved bot files.
The code ignores lines that begin with /? (where ? is any character except #) but it does not ignore them if they are inline. Look at the DNA of one of your bots in the properties dialog and you will see the code attempting to parse the comment.
The only official comment delimiter is '.
Endy:
Need to rewrite the birth tie gene, refeye isn't updated on robage zero so the values aren't equal. The inline comment isn't really a good idea. It can be done but it might mess up the stack some.
--- Code: ---//second part is recombining with it creator.
cond
*.robage 0 =
start
.tie inc
stop
--- End code ---
Peter:
I can't say I noticed anything. Anyhow with or without the //, the code acts the same. If you remove the '*.eye5 0 >' the bot acts different. How does that come.
--- Quote ---cond
*.refeye *.myeye =
'if you remove the line
*.eye5 0 >
' in between of here, the bots acts different
start
stop
'multi control center
cond
*.multi 1 = or
start
50 .sharenrg store
150 .fixlen store
100 .stifftie store
628 .fixang store
stop
'if alone create a second part
cond
*.numties 0 =
*.robage 0 !=
start
50 .repro store
stop
'second part is recombining with it creator.
cond
*.robage 0 =
*.refeye *.myeye =
start
1 .tie store
stop
'if enough energie split.
cond
*.nrg 30000 >
start
.deltie dec
stop
--- End quote ---
Endy thanks for the advise for that condition(tends to do it), but is there a reason why the bot acts different if you add a condition into another gene.
EricL:
By removing that line, you are changing the value of *.myeye from 1 to 0. As Endy said, since *.refeye is not updated on the first cycle of life, it will always be 0 when *.robage is 0. Thus, removing that line in the first gene has a direct impact on whether gene 4 fires or not and thus on whether the bot creates a tie to replace the birth tie or not and thus on whether the bot becomes a multibot or not.
Navigation
[0] Message Index
[#] Next page
Go to full version