Chapter 2. Mag 2x: Basis of Swarm Computation

Here is a first approximation to embedding the above outline of an experimental procedure in Swarm code:Swarm is implemented in the Object-Oriented Programming language Objective-C. Computation in a Swarm application takes place by having objects send messages to each other. The basic message syntax is:

  [targetObject message Arg1: var1 Arg2: var2]
Where "targetObject" is the recipient of the message, "messageArg1:Arg2:" is the message to send to that object, and "var1", "var2", etc, are arguments to pass along with the message. Objective C's messages are keyword/value oriented, which is why the message name "messageArg1:Arg2:" is interspersed with the arguments.

The whole idea of Swarm is to provide an execution context within which a large number of objects can "live their lives" and interact with one another in a distributed, concurrent manner. Furthermore, we wish to insulate the user from having to master all of the highly baroque computer-science wizardry usually required to implement such massively distributed systems of autonomous agents reliably and robustly.

In the context of the Swarm simulation system, the generic outline of an experimental procedure takes the following form:

  1. Create an artificial universe replete with space, time, and objects that can be located, within reason, to certain "points" in the overall structure of space and time within the universe., and allow these objects to determine their own behavior according to their own rules and internal state in concert with sampling the state of the world, usually only sparsely.

  2. Create a number of objects which will serve to observe, record, and analyze data produced by the behavior of the objects in the artificial universe implemented in step 1).

  3. Run the universe, moving both the simulation and observation objects forward in time under some explicit model of concurrency.

  4. Interact with the experiment via the data produced by the instrumentation objects to perform a series of controlled experimental runs of the system.

  5. Depending on what is observed in stage 4), alter the experimental or instrumental "apparatus" and go back to 3).

  6. Publish paper *including* detailed specification of the experimental set-up so that others can recreate your experiment and verify your results.