Main Content

Environments

Model the dynamics and output of a reinforcement learning environment

In a reinforcement learning scenario, the environment models the world with which the agent interacts.

Reinforcement Learning Toolbox™ provides predefined objects that implement different benchmark environments. You can also create your own environments using custom functions for the environment dynamics, modifying an existing environment template class, or using a Simulink® model.

For an introduction to reinforcement learning environments, see Reinforcement Learning Environments.

Functions

expand all

rlFiniteSetSpecCreate specifications object for a finite-set action or observation channel (Since R2019a)
rlNumericSpecCreate specifications object for a numeric action or observation channel (Since R2019a)
getActionInfoObtain action data specifications from reinforcement learning environment, agent, or experience buffer (Since R2019a)
getObservationInfoObtain observation data specifications from reinforcement learning environment, agent, or experience buffer (Since R2019a)
validateEnvironmentValidate custom reinforcement learning environment (Since R2019a)
bus2RLSpecCreate reinforcement learning data specifications for elements of a Simulink bus (Since R2019a)
createGridWorldCreate a two-dimensional grid world for reinforcement learning (Since R2019a)
createMDPCreate Markov decision process model (Since R2019a)
rlMDPEnvCreate Markov decision process environment for reinforcement learning (Since R2019a)
rlPredefinedEnvCreate a predefined reinforcement learning environment (Since R2019a)
generateRewardFunctionGenerate a reward function from control specifications to train a reinforcement learning agent (Since R2021b)
exteriorPenaltyExterior penalty value for a point with respect to a bounded region (Since R2021b)
hyperbolicPenaltyHyperbolic penalty value for a point with respect to a bounded region (Since R2021b)
barrierPenaltyLogarithmic barrier penalty value for a point with respect to a bounded region (Since R2021b)
rlFunctionEnvCreate custom reinforcement learning environment using your reset and step functions (Since R2019a)
rlMultiAgentFunctionEnvCreate custom multiagent reinforcement learning environment (Since R2023b)
rlTurnBasedFunctionEnvCreate custom turn-based multiagent reinforcement learning environment (Since R2023b)
rlCreateEnvTemplateCreate custom reinforcement learning environment template (Since R2019a)
rlSimulinkEnvCreate environment object from a Simulink model already containing agent and environment (Since R2019a)
createIntegratedEnvCreate environment object from a Simulink environment model that does not contain an agent block (Since R2019a)
SimulinkEnvWithAgentReinforcement learning environment with a dynamic model implemented in Simulink (Since R2019a)
bus2RLSpecCreate reinforcement learning data specifications for elements of a Simulink bus (Since R2019a)
validateEnvironmentValidate custom reinforcement learning environment (Since R2019a)
rlNeuralNetworkEnvironmentEnvironment model with deep neural network transition models (Since R2022a)
rlContinuousDeterministicTransitionFunctionDeterministic transition function approximator object for neural network-based environment (Since R2022a)
rlContinuousGaussianTransitionFunctionStochastic Gaussian transition function approximator object for neural network-based environment (Since R2022a)
rlContinuousDeterministicRewardFunctionDeterministic reward function approximator object for neural network-based environment (Since R2022a)
rlContinuousGaussianRewardFunctionStochastic Gaussian reward function approximator object for neural network-based environment (Since R2022a)
rlIsDoneFunctionIs-done function approximator object for neural network-based environment (Since R2022a)
predictPredict next observation, next reward, or episode termination given observation and action input data (Since R2022a)
evaluateEvaluate function approximator object given observation (or observation-action) input data (Since R2022a)
accelerateOption to accelerate computation of gradient for approximator object based on neural network (Since R2022a)
resetReset environment, agent, experience buffer, or policy object (Since R2022a)
setupSet up reinforcement learning environment or initialize data logger object (Since R2022a)
cleanupClean up reinforcement learning environment or data logger object (Since R2022a)

Blocks

RL AgentReinforcement learning agent (Since R2019a)

Topics

Introduction to Reinforcement Learning Environments

Grid World Environments

Predefined Control System Environments

Custom MATLAB Environments

Custom Simulink Environments

Load Environments in Reinforcement Learning Designer