Programmatic Detection of Spatial Behaviour in an Agent-Based Model

William J Chivers, William Gladstone, Ric D Herbert


The automated detection of aspects of spatial behaviourin an agent-based model is necessary for model testingand analysis. In this paper we compare four predictors of herdingbehaviour in a model of a grazing herbivore. We find that a) the mean number of neighbours adjustedto account for population variation and b) the mean Hammingdistance between rows of the two-dimensional environment can beused to detect herding. Visual inspection of the model behaviourrevealed that herding occurs when the herbivore mobility reachesa threshold level. Using this threshold we identify a limits forthese predictors to use in the program code. These results apply only to one set of parameters and environmentsize; future research will involve a wider parameterspace.


Agent-Based Model; Herding Behaviour; Model Testing; Spatial Behaviour


F. R. Adler. Modelling the Dynamics of Life: Calculus and Probability for Life Scientists. Brooks/Cole, New York, 1998.

K. Arnold, J. Gosling, and D. Holmes. The Java Programming Language. Addison-Wesley, Reading, Massachusetts, 3rd edition, 2000.

W. J. Chivers. Generalised, parsimonious, individual-based computer models of ecological systems. PhD thesis, University of Newcastle, NSW, Australia, 2009. Thesis available at

B. Dumont and D. R. C. Hill. Spatially explicit models of group foraging by herbivores: what can agent-based models offer? Animal Research, 53:419–428, 2004.

C. Eckes, J. Triesch, and C. von der Malsburg. Analysis of cluttered scenes using an elastic matching approach for stereo images. Neural Computation, 18:1441–1471, 2006.

V. Grimm, U. Berger, D. L. DeAngelis, J. G. Polhill, J. Giske, and S. F.Railsback. The ODD protocol: A review and first update. Ecological Modelling, 221:2760–2768, 2010.

R. W. Hamming. Error detecting and error correcting codes. Bell System Technical Journal, 26(2):147–160, 1950.

D. Knuth. The Art of Computer Programming, Volume 2: Seminumerical Algorithms. Addison-Wesley, Reading, Massachusetts, 3rd edition, 1997.

S. H. Lee, H. K. Pak, and T. S. Chon. Dynamics of prey-flock escaping behavior in response to predator’s attack. Journal of Theoretical Biology, 240(2):250–259, 2006.

A. Mohan, C. Papageorgiou, and T. Poggio. Example-based object detection in images by components. IEEE Transactions on Pattern Analysis and Machine Intelligence, 23(4):349–361, 2001.

C. Papageorgiou and T. Poggio. A trainable system for object detection. International Journal of Computer Vision, 38(1):15–33, 2000.

R Core Team. R: A language and environment for statistical computing, 2013. Last accessed 20 June 2013.

S. A. Rands, R. A. Pettifor, J. M. Rowcliffe, and G. Cowlishaw. Statedependent foraging rules for social animals in selfish herds. Proceedings of the Royal Society of London, B, 271:2613–2620, 2004.

S. A. Rands, R. A. Pettifor, J. M. Rowcliffe, and G. Cowlishaw. Social foraging and dominance relationships: the effects of socially mediated interference. Journal of Behavioral Ecology and Sociobiology, 60(4):572–581, 2006.

P. Sinha. Object recognition via image invariants: a case study. Investigative Ophthalmology and Visual Science, 35:1735–1740, 1994.

R. Vabø and L. Nøttestad. An individual based model of fish school reactions: predicting antipredator behaviour as observed in nature. Fisheries Oceanography, 6(3):155–171, 1997.

A. L. Yuille. Deformable templates for face recognition. Journal of Cognitive Neuroscience, 3(1):59–70, 1991.

Full Text: PDF


  • There are currently no refbacks.

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 License.

IT in Innovation IT in Business IT in Engineering IT in Health IT in Science IT in Design IT in Fashion

IT in Industry � (2012 - ) � � ISSN (Online): 2203-1731; ISSN (Print): 2204-0595