Gene

From WikiManual
Revision as of 02:32, 22 September 2005 by 66.91.141.218 (talk) (1 Genes - The Darwinbots Language)
Jump to: navigation, search

1 Genes - The Darwinbots Language

1.1 Overview Darwinbots uses a simplified programming language, which admits no conditional jumps or cycles.


The idea is that of programs made up by daemons, that means closed parts waiting silently until a particular event happens, and then activating to perform some task. These parts are called 'genes'. A robot's program, a DNA, is made only by a sequence of genes, all waiting for their own particular event to activate them. This event is specified at the head of the gene. If a gene is activated, then his body is executed. A gene's body consists in a straight sequence of instructions, without cycles or jumps, doing some operations on the robot's memory. After the body execution is complete, the gene turns silent again, until something wakes it up again.


1.1 The Code A gene looks like this (keywords in bold):

cond :head start marker

activation conditions

start :body start marker

task to perform

stop :gene end marker


cond

start

stop


and a complete dna will look like

gene

gene

.....

gene

end DNA end marker


1.1 Flow control:


cond: marks the beginning of the gene, and also the beginning of his activation condition.

start: marks the beginning of the body part of the gene

stop: marks the end of the body part of the gene, as well the end of the whole gene.

end: marks the end of the dna.


How the DNA works