A Stochastic Simulation for Evolution in a Changing Environment: Understanding Pyrimethamine Resistance in Plasmodium falciparum.