The problem of action selection has two components: What is selected? How is it selected? To understand what is selected, it is necessary to distinguish between behavioural and mechanistic levels of description. Animals do not choose between behaviours per se; rather, behaviour reflects interactions among brains, bodies, and environments. To understand what guides selection, it is useful to take a normative perspective that evaluates behaviour in terms of a fitness metric. This perspective, rooted in behavioural ecology, can be especially useful for understanding apparently irrational choice behaviour. This paper describes a series of models that use artificial life techniques to address the above issues. We show that successful action selection can arise from the joint activity of parallel, loosely coupled sensorimotor processes. We define a class of artificial life models that help bridge the ecological approaches of normative modelling and agent-based or individual-based modelling. Finally, we show how an instance of apparently suboptimal decision making (the matching law) can be accounted for by adaptation to competitive foraging environments.