Modelling Flocks of Birds and Colonies of Ants from the Bottom Up