Dynamics of density- and frequency-dependent selection.