The particle swarm algorithm contains elements which map fairly strongly to the foraging problem in behavioural ecology. In this paper, we show how some simple adaptions to the standard algorithm can make it well suited for the foraging problem. We propose two approaches to model foraging behaviour: the first uses a standard particle swarm algorithm, with the particles just slowing down in the proximity of food; the second approach modifies the basic algorithm in order to make the particles actually stop on the food source and remain there to eat. The results show that the changes convert the standard algorithm into one which produces qualitatively realistic behaviour for a simplified model act animals and their foraging environment. This work introduces a new way to look at the particle swarm algorithm, i.e. using it as a simulation tool in the biological field of behavioural ecology. To our knowledge, this is the first time particle swarm algorithms have been applied to problems in b...