| ||||||||||||||
| ||||||||||||||
|
||||||||||||||
Reflections on Agent-Based Simulation ModellingBy Ben Wootton
I have recently implemented my first agent based simulation model, involving simulating the migration, reproduction and feeding habits of a rat population. This model involved programming the behaviours of individual rats, and placing many instances of these rats into an environment where they would compete for food. Many of the high level choices and design decisions will be applicable to anyone looking to produce a similar simulation model. For this reason, I share them here. MotivationCopying or mimicking some real life process or population in a computerised simulation is often very useful. For example, we might like to:
So, simulations are widely useful due to benefits regarding time, effort, money and safety. However, simulation modelling is still often described as a method of last resort, due to the difficulties and effort associated with sound simulation modelling. For instance, where tractable, mathematical models often allow us to reason about a system to a closer degree. Likewise, simple statistical analysis and optimisation techniques are preferable where data sets are available and search spaces are not too big. What all simulation models have in commonAll of the simulation models that I have seen take a similar form. Firstly, some parameters regarding the simulation are read, and the simulation initialised. It is common to decouple parameters such as the simulation duration from the simulation code, so that recompilations are not required for each experiment. Secondly, the simulation starts and enters into a loop until some specified end point. There are various ways of representing time. Continuous time models have some concept of time progressing according to some appropriate scale. On each time step in the rat simulation mentioned, every rat would attempt to eat, reproduce, and be given a chance to change position based on the current availability of food. Discrete event simulations reject the concept of monotonically progressing time, in favour of an event queue. There are useful benefits where time can be abstracted away, as in certain instances complicated timing issues can arise that cause subtle problems in simulation models. Thirdly, at regular time-steps, or in some instances at the end of the simulation, some simulation state is output from the simulation for further statistical analysis. Where simulation models might differFirstly, the level of aggregation is a fundamental decision. In the rat example, I chose to model individual rats that assessed their current states in time steps of one day. I might have chosen to group rats into populations with an average hunger, which may have been useful in reducing the computational time needed for this particular simulation. In this instance, the choice of a single rat as the level of aggregation was natural choice, but considering the earlier example such as the aircraft wing dynamics, designers of these simulations must decide for instance the level of detail at which to model air flow. There are anecdotal reports of simulation models that have attempted to model individual biscuits in a biscuit factory, rather than the clearly more appropriate concept of an average flow. Agent based simulationsThe kind of simulation where an individual entity is used as the building block can be referred to as agent or individual based. There are various issues with regards to these models, listed below. Firstly, will there be some concept of space in the model? Maybe this can be represented by simple 2 dimensional co-ordinates, but how should the agents move through the environment? Finding realistic models of movement through an environment obviously involves huge leaps of faith, and making implementation decisions with very little evidence which might fundamentally affect the results of the simulation. There are a whole array of other issues with spatial simulations, such as what happens at the edge of the agents world. Where possible, you should consider modelling interactions using probabilities of agent classes coming into contact, rather than attempting to model a physical terrain. Finally, agent based simulation modules are much more computationally expensive. The dimensionality of the models can very quickly explode to the extent that relatively simple simulations can take hours to run on a relatively powerful desktop PC. Verification and validationThese terms refer to two potential problems that can go wrong with a simulation. They are widely used in the literature without definition:
If a simulation is not performing in the expected way, it is often difficult to identify whether the specific problem is related to validation or verification. Further readingCraig Reynolds Individual Based Models - http://www.red3d.com/cwr/ibm.html
Submitted: 04/12/2004 Article content copyright © Ben Wootton, 2004.
|
|
|||||||||||||
All content copyright © 1998-2007, Generation5 unless otherwise noted.
- Privacy Policy - Legal - Terms of Use -