Darwinbots Forum
Bots and Simulations => Bot Tavern => Topic started by: Motor.On on December 17, 2007, 08:22:43 PM
-
Well, after messing around with two different alga (both based on alga_minimus and probably some others for little tidbits of code), I was wondering how I would make a plant whose top cell floats and then has cells tied to it who simply dangle below (the sim would be with gravity of some nature). Ideally, the top cell would be able to create both cells below it and other plants, while the lower cells would simply collect energy.
here's what I've come up with for maintaining a certain depth, I'm not sure if this is the best way, but it certainly creates a solid layer of floating alga when these genes are added to alga_minimus
cond
*.aim 314 !=
start
314 .setaim store
stop
cond
*.depth 5000 >
start
2 .up store
stop
cond
*.depth 3500 <
start
0 .up store
stop
So, any ideas for how I would create the different identities for the two types of cells, and how I could just generally go further with this one?
Thanks
-
Add something like:
start
*.eye5 0 >
*.robage 1 =
and
.tie inc
stop
This will cause new baby bots to form ties with the parent. If the baby is otherwise stupid and does nothing, it'll just collect energy. Of course, you might have some suprises when you end up with a huge and crazy web. So you'll want to limit the reproduction to bots with only one tie, and that is not a head.
-
Thanks a lot.
Here's what I've got so far:
'Kelp that maintains depth and creates other strands of kelp
'Address 50 is cell type
def type 50
'type = 1 : head
'type = 2 : tail
start
*.eye5 0 >
*.robage 1 =
*.numties type <=
and
.tie inc
stop
'head
'depth maintenance
cond
*.aim 314 !=
*.type 1 =
start
314 .setaim store
stop
cond
*.depth 5000 >
*.type 1 =
start
2 .up store
stop
cond
*.depth 3500 <
*.type 1 =
start
0 .up store
stop
cond
*.nrg 5000 >=
*.type 1 =
*.numties = 1
start
50 .repro store
stop
cond
*.nrg 1000 >=
*.type 1 =
*.numties != 1
start
50 .repro store
stop
'tail
cond
*.nrg 500 >
*.type 2 =
start
50 .sharenrg store
stop
cond
*.nrg 1000 >=
*.type 2 =
start
50 .repro store
15 .aimdx store
stop
'body management
cond
*.body 10000 >=
*.nrg 1000 < or
start
100 .fdbody store
stop
cond
*.body 1000 <=
*.nrg 4000 >=
start
100 .strbody store
cond
*.nrg
cond
*.waste 50 >
start
-4 .shoot store
.waste 50 dec
stop
end
Now, I'm not sure how I tell a new cell which type it is, I know that I make the "tail" cells create more tail cells, and the head create a tail and then more heads, but beyond that I'm basically lost as to how to do the rest
further ideas?
thanks
-
Use the out/in variables to program a bot. When a baby is born, it checks its in to get information from its parent. The parent can program it to either be a new tail cell, or to be a whole new bot.
-
I'm going to have to work more on this tomorrow, but here's what I've got so far:
' Alga Treedepthicus
'
' Vegetable
'
'Kelp that maintains depth and creates other strands of kelp
'Allocate Address 50 as the identifier for cell type
def type 50
'type = 1 : head
'type = 2 : tail
'Gene 1 - Make head if out is head
cond
*.in1 1 =
*.type 0 =
start
1 .type store
stop
'Gene 2 - Assign Type
cond
*.type 1 <
start
2 rnd .type store
stop
'Gene 3 - Delete assignment for tail cells
cond
*.type 2 =
start
1 .delgene store
stop
'Gene 4 - Assign Tail offspring
cond
*.type 1 <
start
2 .type store
stop
'Gene 5 - make ties
start
*.eye5 0 >
*.robage 1 =
*.numties type <=
*.type 1 !=
and
.tie inc
stop
'==================HEAD==================
'-------DEPTH MAINTENANCE--------
'Gene 6- Maintain Downward aim
cond
*.aim 942 !=
*.type 1 =
start
942 .setaim store
stop
'Gene 7 - Lower Depth
cond
*.depth 5000 >
*.type 1 =
start
10 .dn store
stop
'Gene 8 - Upper Depth
cond
*.depth 3500 <
*.type 1 =
start
0 .dn store
stop
'-------REPRODUCTION-----
'Gene 9 - Make other head
cond
*.nrg 20000 >=
*.type 1 =
*.numties 1 =
start
50 .repro store
1 .out1 store
stop
'Gene 10 - Make tail
cond
*.nrg 10000 >=
*.type 1 =
*.numties 0 =
start
50 .repro store
stop
'==================TAIL=============
'Gene 11 - Share Energy
cond
*.nrg 5000 >
*.type 2 =
start
50 .sharenrg store
stop
'Gene 12 - Make more tail
cond
*.nrg 10000 >=
*.type 2 =
*.numties 2 <
start
50 .repro store
15 .aimdx store
stop
'============MAINTAIN SIZE===========
'Gene 13 - Make less body
cond
*.body 10000 >=
*.nrg 1000 < or
start
100 .fdbody store
stop
'Gene 14 - More Body
cond
*.body 1000 <=
*.nrg 4000 >=
start
100 .strbody store
I can't get the waste disposal gene to work right, I'm not sure what I did to screw it up, but this basically does what I wanted, the head floats at the right level and creates more heads and a tail, which continues to grow. I've got to get the energy sharing down better, but that's ok. I'm going to run it overnight and make sure it doesn't explode.