The transition towards sustainable pig production systems is receiving increasing attention nowadays. Pig behaviour plays a central role in sustainability, as it is an important indicator for pig welfare and can also affect other sustainability issues. Understanding behaviour and related welfare consequences requires to understand motivations underlying behaviour. The two aims of this thesis were: 1) to assess the use of agent-based modelling for understanding pig behaviour and underlying motivation, and 2) to apply agent-based modelling for increasing our understanding of pig behaviour, and related animal welfare and productivity performance. We first explored the use of agent-based modelling with tail biting behaviour in pigs as a case study. An agent-based model was developed to understand the causation of tail biting behaviour. Subsequently, we developed a mechanistic and dynamic simulation model to gain more understanding of feeding behaviour and internal (physiological) factors. The model integrates knowledge from physiology and ethology, and combines growth with a behavioural decision model based on motivation. This model included motivations underlying feeding behaviour and various feeding patterns of an individually housed growing pig. To deepen our understanding of mechanisms underlying feeding patterns of pigs within 24 hours, hormonal circadian rhythms were included in the model in a follow-up study. The circadian rhythms of cortisol and melatonin explained the alternans pattern, a small peak of feed intake at the beginning of the day and a larger peak at the end of the day, of feeding in pigs. Next, an agent-based model of feeding and social interaction in commercially group-housed pigs was developed to deepen our understanding of the complex interaction between internal physiological factors and external social factors. Social factors (e.g. competition level and social facilitation) and behavioural strategies (e.g. avoidance and approach) affected social interactions among pigs and feeding behaviour. The causation of variation among pigs was further explored in this model. Pig characteristics were important in various feeding, social interaction and growth patterns in pigs. In general, agent-based modelling proved to be a useful method to understand animal behaviour and underlying motivations. It contributed to further understanding of tail biting, feeding and social behaviour in pigs. Furthermore, agent-based modelling showed to be a novel method to find and assess behaviours as welfare indicators, and to contribute to understanding trade-offs and synergies between sustainability issues, such as animal welfare and productivity. Contents Chapter 1 General introduction Chapter 2 Agent-based modelling in applied ethology: An exploratory case study of behavioural dynamics in tail biting in pigs Chapter 3 Understanding feeding patterns in growing pigs by modelling growth and motivation Chapter 4 The importance of hormonal circadian rhythms in daily feeding patterns: An illustration in simulated pigs Cha...