Document: SCL: An Artificial Chemistry in Swarm

next 5.4 SCL World Window
up 5 Using SCL
gif 5.2 ParameterManager Window

5.3 WorldManager Window

World Manager Window

This is a (tailored) probeDisplay on the worldManager object. It provides ``high level'' facilities for creating and manipulating a model world (or, more precisely, a model world state), and for saving and/or reloading the world state to or from disk files.

Note that if the world state is loaded from disk then any already loaded world model will be automatically (and silently) dropped first. As with the file interface for parameters, no attempt has been made to make the world state file interface ``robust'', and any error in accessing a file will result in a fatal exception being raised and SCL will exit.

PMMLCG refers to the pseudo random number generator object used to implement the (pseudo!) stochastic effects in SCL. The WorldManager window allows the exact state of this generator to be monitored and/or modified. This permits, for example, a given world state to be reloaded and then restarted with a different initial value for the generator state, thus potentially exploring the robustness of stochastic phenomena in the model.

The worldTime records the number of full timesteps which have elapsed. It is meaningful only when a world model has been created or loaded from disk.

The WorldManager window offers two ways of creating a new model world. As with loading a model from disk, if a new model is created here then any already loaded model will be automatically (and silently) dropped first. The createDefaultWorld method provides a ``canned'' world with certain compiled-in characteristics. The createEmptyWorldWithX:Y: method allows a world of arbitrary size to be created. This will be initially ``empty'', i.e. populated exclusively with holes.

Once a world has been created (or loaded from disk) particles can be incrementally added to (or removed from) the world using the three adjust...NumberBy: methods--these accept a positive or negative integer argument, being the number of particles to add or remove respectively. Particles are added or removed at random positions with these methods. They can be added only into holes; when they are removed, they leave holes. These methods return the number of particles actually added or removed. This may generally differ from the number requested. The methods can only add new particles into existing holes--so if the world becomes full, no more can be added. Conversely, only existing particles can be removed--so once all particles of a given class have been removed no more can be taken out.

Special methods are also provided to forcibly fill the space completely with substrate, or completely empty it again (i.e. ``fill'' with holes).




next 5.4 SCL World Window
up 5 Using SCL
gif 5.2 ParameterManager Window

Document: SCL: An Artificial Chemistry in Swarm

Copyright © 1997 All Rights Reserved.
Timestamp: Tue Dec 31 19:40:38 GMT 1996

mcmullin@eeng.dcu.ie