Evolution of resistance and virulence in plant-herbivore and plant-pathogen interactions