An Environment Model for Nonstationary Reinforcement Learning