Darwinbots Forum
Bots and Simulations => DNA - General => The Gene depository => Topic started by: Shen on April 18, 2005, 10:11:51 PM
-
' - MultiBot Reproduction Genes -
'
' These genes will give you a 2 cell MB
' with one defined as the head and the
' other the tail. Its very basic with
' plenty of possibility for improvement.
' - The Way it Works -
'
' When a MultiBot gains enough energy to reproduce (*.nrg 5000 >), Gene 4 activates and deletes its tie.
' Now that it has no ties (*.numties 0 =), Gene 3 activates making the bot reproduce and define itself as the unfixed Tail.
' The child (*.robage 0 =) makes itself the unfixed Head and ties to its Tail.
' When the tie has hardened (*.multi 1 =), both bots align their ties.
' - Custom Variables -
' *.job is the job of that MB cell
' 1 is Head, 2 is Tail
'
' *.fixtie used for straightening the tie.
' 0 is fixed, 1 is unfixed
def job 50
def fixtie 51
' - Gene 1 -
' Fix the Tie
cond
*.multi 1 =
*.fixtie 1 =
start
1 .tienum store
628 .fixang store
150 .fixlen store
30 .stifftie store
0 .fixtie store
stop
' - Gene 2 -
' Head ties to Tail and gets ready for fixing
cond
*.robage 0 =
start
1 .tie store
1 .job store
1 .fixtie store
stop
' - Gene 3 -
' Lone bot repros the Head bot and gets ready for fixing
cond
*.numties 0 =
*.robage 0 !=
start
50 .repro store
2 .job store
1 .fixtie store
stop
' - Gene 4 -
' Start Repro Loop
cond
*.nrg 5000 >
*.multi 1 =
start
1 .deltie store
stop
end
-
Just an addition to the first post. This repro loop is only three genes but is more complex in the way it works and could be of less use in a real bot. But nevertheless its pretty nifty. :)
' - MultiBot Reproduction Genes -
'
' These genes will give you a 2 cell MB
' with one defined as the head and the
' other the tail. Its very basic with
' plenty of possibility for improvement.
' - The Way it Works -
'
' When a MultiBot gains enough energy to reproduce (*.nrg 5000 >), Gene 3 activates and deletes its tie.
' Now that it has no ties (*.numties 0 =), Gene 2 activates making the bot reproduce and define itself as unfixed.
' Next cycle Gene2 activates again because *.numties 0 = takes a cycle to detect the birthtie. This causes the parent to tie and program child
' When the tie has hardened (*.multi 1 =) both bots align their ties and define there jobs.
' *.job is the job of that MB cell
' 1 is Head, 2 is Tail
' -1 and -2 are used to fix the tie
def job 50
' - Gene 1 -
' Fix tie and assign jobs
cond
*.multi 1 =
*.job 0 <
start
1 .tienum store
628 .fixang store
150 .fixlen store
30 .stifftie store
*.job abs .job store
stop
' - Gene 2 -
' Lone bot repros the Head and gets ready for fixing
cond
*.numties 0 =
*.robage 0 !=
start
50 .repro store
1 .tie store
1 .tienum store
.job .tieloc store
-1 .tieval store
-2 .job store
stop
' - Gene 3 -
' Start Repro Loop
cond
*.nrg 5000 >
*.multi 1 =
start
1 .deltie store
stop
end
-
huh make the coding in a different color please I cant tell what is talking and what is coding :blink:
-
Dude. It's all code apart from the first 2 lines.
BTW Welcome to DarwinBots :D
-
wow, no really , the first time I was introduced to code I knew right away code is NOT ENGLISH. Everything that looks like MATH is code. Welcome anyway.
-
Of course Bots' posts always seem like not-English to me :D