Distributed running of Physis requires data exchange about digital organisms
between nodes. The communication is carried out via a very simple text-based
protocoll. This protocol should be efficient, language- and platform-independent,
and to some extent readable for humans.
-
Efficiency: This point doesn't need comments. A research tool like
Physis won't ever be fast enough.
-
Language-independency: It's is still an open question that should
we port Physis to another language. C++ or Objective-C for example. In
order to preserve the possibility the protocol shouldn't use language-specific
features like Java object-serialization. Plain ASCII text seems to be a
right choice. And an other significant gain: several different nodes can
work together (e.g. a machine running native code generated from C++ source
is able to connect to another with a Java VM).
-
Readability: Since it's a scientific research tool the system should
be observable on every level even this low-level communication has to be
followable by human beings.
The protocol should provide the same functionality as the DigitalOrganism
interface thus it enables communication in two ways. There are basically
requests followed by responses. There is only one server and one client.
The client sends a request and waits for the answer.
Requests
Requests correspond to method calling. A valid request begins with a
name indicating a methodname.This is always followed by a number, the
index of a digital organism. The parameters are optional and separated
by a + sign. The whole request is closed by a . sign. General rule that
all lines contains only one atomic piece of data. Arrays should be decomposed
to its elements. When sending arrays as parameter the first number is the
length of the array. The type of the parameters doesn't need to be encoded
because the client knows what it gets as an answer.
Example:
recalcbonus
13
1.13
.
which means recalculating the bonus_multiplier for the 13th organism,
or
vivify
4
12
32
43
11
32
13
13
+
42
.
which vivifies the 4th organism with the encoded codetape and inherited
length.
Responses
Responses equal returning data after a method call. They don't need
any identifier and index. The separator and terminator are used the same
way.
Example - returning the fitness:
0.78912341276
.
Helsinki August 3, 2000
|