Bots and Simulations > DNA - General

Ties help

(1/4) > >>

HazD:
Hi guys, I read the wiki on ties and it went straight over my head    
so I was wondering if you could give me a more in-depth explainations of them please.
Especailly anti-birth ties that was added in one of my bots by elite.


--- Code: ---' Birthtie begone!

cond
*.robage 2 <
start
.tie *.robage -1 mult 1 add mult inc
.deltie inc
stop
--- End code ---

because rather than just using it, I would like to understand it as well.

thanks

Numsgil:
Maybe you could tell me what you do understand and we can go from there.

HazD:
I understand .tienum and some of .deltie, thats about it  I think

Elite:
OK, firstly: Birth ties

When a bot is born, a special tie links it to it's parent. This tie will dissapear eventually. However, a combat bot is more efficient if it doesn't spend it's first few cycles connected to it's parent.

An anti-birth-tie gene deletes the birth-tie so that the bot can go do more important things

You cannot delete the birth tie directly using .deltie, so instead, you fire a new tie at your parent that replaces the birth-tie, and delete that.

The gene I gave you is kinda SGified so I'll give you a simpler one:


--- Code: ---cond
*.robage 0 =
start
.tie inc
stop

cond
*.robage 1 =
start
.deltie inc
stop
--- End code ---

There you go - it does the same as the old gene but is easier to understand

Here is an annotated version of the genes:

(You can use ' to comment out code so the program doesn't try to read it, but you probably already know that  )


--- Code: ---cond
*.robage 0 =
' When you are born (when your age = 0)
start
.tie inc
' Tie to your parent, using inc to store 1 in .tie (inc costs less) by increasing .tie by 1
' This replaces the birth tie with a new tie that has the ID of 1
stop

cond
*.robage 1 =
' When you are 1 cycle old
start
.deltie inc
' Delete the tie
' Stores 1 in deltie to delete the tie with an ID of 1
stop
--- End code ---

The gene I gave you is these genes compactified into one gene using 'conditionless coding'. I recomend using these new ones in place of the one I originally gave you.

Following me so far?

HazD:
Ah... I understand that now but what about feeding ties How do they work?

Navigation

[0] Message Index

[#] Next page

Go to full version