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]
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:
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.
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).
Run the universe, moving both the simulation and observation objects forward in time under some explicit model of concurrency.
Interact with the experiment via the data produced by the instrumentation objects to perform a series of controlled experimental runs of the system.
Depending on what is observed in stage 4), alter the experimental or instrumental "apparatus" and go back to 3).
Publish paper *including* detailed specification of the experimental set-up so that others can recreate your experiment and verify your results.