Adaptive Switching of Variable-Fidelity Models in Population-Based Optimization