Technical Report CSTN-033 Tools and Techniques for Optimisation of Microscopic Artificial Life Simulation Models C.J. Scogings, K.A. Hawick and H.A. James Institute of Information & Mathematical Sciences Massey University – Albany North Shore 102-904, Auckland, New Zealand email: {c.scogings, k.a.hawick, h.a.james}@massey.ac.nz 7 April 2006 ABSTRACT We have developed a sophisticated microscopic model for studying emergent spatial patterns in a predator-prey based artificial life scenario. In this paper we describe some of the simulation optimisation tools and techniques that are necessary to support many long model runs over different parameters and starting con- ditions. We discuss how these optimisation techniques may be of general value to developers of other simula- tion codes. KEY WORDS simulation; optimisation; simulation tools; simulation visualisation. 1 Introduction We have developed a predator prey model for study- ing emergent behaviours [2] in artificial life models. Our model has been previously described in [8] and [7] and the emerging clusters formed by its “artificial ani- mals” (animats [12]) have been described in [3] and [4]. The differences and similarities between our model and other well-known models such as Tierra [13] and Avida [1] have been outlined in [5]. In brief our model consists of a “flatland” in which animal agents or ani- mats live, die, breed and interact with one another. A key feature of our model is its use of two broadly dif- ferent classes of animat - predator and prey species. A unique feature of our model is its use of prioritised rules that determine individual animat behaviours. In order to produce interesting emergent behaviours it is important for the model to be run for a significantly large number of time steps and for it to contain a signif- icant number of animats – usually a minimum of 5000 to reproduce the phenomena we discuss. At each time step, every animat needs to change its state based on the locations and state of its neighbours. It is this process of finding the nearest neighbours that dramatically in- creases the time required to perform a useful run of the model. One way to increase execution speed is to run the model in parallel and this has been reported in [9]. However a parallel supercomputer is not always avail- able and even in a parallel implementation it is useful to increase sequential efficiency as much as possible. One way of saving time was to remove the need for using the square root function when calculating distances and this is reported in [6]. The greatest gains in efficiency were achieved by modifying the way that animat agents are represented within their environment. Thus a succession of tech- niques was introduced into the model to reduce the time taken for an animat to search for its neighbours. In section 2 we summarise the core features of our animat model. The main contribution of this present paper is a discussion and performance comparison of the four main algorithmic ideas we employed to speed up model simulations. We describe these in section 3 and give some detailed performance results in section 4. In section 5 we discuss the performance gained from the