Support for breeding

One party initiates the breeding; the other party exerts most of the
energy if its breeding key matches. It is that party's responsibility to
set up the newborn agent's connection (but the father can pass it an
arbitrary message). Newborn is spawned immediately but can be
renegotiated on first connect.
This commit is contained in:
Petr Baudis 2011-12-08 03:14:57 +01:00
parent b693b5d6f4
commit 23f2fce7ff
6 changed files with 100 additions and 9 deletions

14
README
View file

@ -27,6 +27,10 @@ The following inputs (in no particular order) are supported:
BUMP
if received, the agent's move failed
(or attack of non-existent agent, etc.)
BRED <id> <father_info>
a new agent has been spawned, connect using agent_id <id>;
<father_info> is arbitrary string passed from the father,
can be used for genetic recombination
DEAD
if received, the agent is dead!
energy <points>
@ -57,6 +61,9 @@ The following outputs are supported:
attack_dir <x> <y>
<x> and <y> are integer offsets relative
to the current position; may be just {-1,0,1}
breed_dir <x> <y> <info>
<info> is arbitrary string passed to the "mother"
(to be passed to the child)
secrete <phid> <phintensity>
produce a pheromone; pheromones are initially
associated with an agent and trailed at tiles
@ -77,6 +84,10 @@ these commands instead:
<rate> between 0 and 1.
defense <rate>
<rate> between 0 and 1.
breeding_key <value>
<value> is arbitrary integer number; default is 0;
breeding succeeds only between individuals with key
that is near enough (abs(key1-key2) < kappa).
In general, higher rate means higher energy maintenance of the
appropriate actuators.
@ -88,4 +99,5 @@ phase:
If the id corresponds to a disconnected agent, the connection
is immediately attached to that agent. Combining this with other
negotiation commands is undefined.
negotiation commands is undefined, except for newborns - in that case,
negotiation commands must follow after agent_id.