Support reconnecting to agents

Agents do not die immediately on disconnect anymore. Instead, agent_id
is sent at birth and can be sent during negotiation to attach to a
disconnected agent.
This commit is contained in:
Petr Baudis 2011-12-08 02:01:56 +01:00
parent 417a5235a0
commit 8ae6051e97
4 changed files with 52 additions and 7 deletions

19
README
View file

@ -20,6 +20,9 @@ CRLF ("\r\n"), not just LF ("\n")!
The following inputs (in no particular order) are supported:
agent_id <id>
unique id of agent; may be sent only once at the beginning
(you can use it to reconnect to the same agent later)
tick <ticknum>
BUMP
if received, the agent's move failed
@ -62,9 +65,10 @@ The following outputs are supported:
energy required is proportional to phintensity
After connecting, the client specifies its desired attributes,
in the same format as in normal output (line-based, terminated
by empty line), but with these commands instead:
When new agent connects, the client first enters the "negotiation"
phase, specifying its desired attributes, in the same format as in
normal output (line-based, terminated by empty line), but with
these commands instead:
move <rate>
<rate> between 0 and 1, describing probability
@ -76,3 +80,12 @@ by empty line), but with these commands instead:
In general, higher rate means higher energy maintenance of the
appropriate actuators.
Alternately, the client may send a single command in the negotiation
phase:
agent_id <id>
If the id corresponds to a disconnected agent, the connection
is immediately attached to that agent. Combining this with other
negotiation commands is undefined.