Genetic diversity and resource availability