The impact of population structure on population and community dynamics