top of page


Updated: May 1

In the dynamic world of Reinforcement Learning (RL), the environment encompasses everything that the agent, or decision-maker, interacts with. To illustrate, consider training a dog to perform tricks. Here, the dog is the agent, while everything around it—the fluttering butterfly, the sprawling garden, and the human instructor—constitutes the environment. When the dog executes a trick, desired action, correctly and receives a treat, that treat represents a reward provided by the environment.


Types of Environments in Reinforcement Learning


1.    Deterministic and Stochastic Environments:


  • Deterministic Environments: In these settings, the same action taken in the same state always results in the same future state and reward. For example, each time a dog performs the sit action on command, it transitions from standing state (initial state) to sitting state (next state) and receives a biscuit. This predictable outcome signifies a deterministic environment.

  • Stochastic Environments: Contrasting deterministic environments, stochastic environments exhibit uncertainty. Consider the stock market, where a trader (the agent) buys shares (action) in a company. Despite repeating the exact purchase action on another day, the outcome and the rewards (financial gains or losses) differ due to market volatility. In such environments, the transition function P(s′,r∣s,a), which calculates the probability of moving to a new state s′ with reward r after taking action a, becomes crucial for navigating the uncertainties.

2.    Continuous and Episodic Environments:


  • Continuous Environments: These environments lack terminal states and persist indefinitely. The state space, which includes all possible states the agent might encounter, is infinite. A temperature monitoring system exemplifies a continuous environment, where the agent continually assesses the temperature without a definitive end.

  • Episodic Environments: In contrast, episodic environments have clear terminal states, concluding the episode. The state space, which includes all possible states the agent might encounter, is finite. An example is a maze game where a mouse (the agent) aims to find cheese while avoiding traps. The game ends when the mouse reaches either the cheese or a trap, necessitating a restart.


Understanding the type of environment is crucial in RL as it influences the design and implementation of learning algorithms. Whether navigating the predictability of deterministic settings or the unpredictability of stochastic ones, or managing the continuity of processes versus the discrete episodes, each environment type presents unique challenges and learning opportunities for an RL agent.

17 views0 comments


bottom of page