runEpisode
R2026bSyntax
Description
Use runEpisode to simulate an environment with a policy or
agent for a whole episode. The function can execute a callback to process (and, if needed,
learn from) the experience at every step of the episode.
runs a single simulation of the environment output = runEpisode(env,agent)env against the agent
agent. During the simulation, the policy of the agent is evaluated
to produce actions but, by default, learnable parameters are not updated. However, you can
use a callback to process the experience, and, if needed, update parameters, at every step
of the episode.
specifies nondefault simulation options using one or more name-value arguments.output = runEpisode(___,Name=Value)
Examples
Input Arguments
Name-Value Arguments
Output Arguments
Tips
You can speed up episode simulation by using parallel computing. To do so, use the
setupfunction and set theUseParallelargument to"on"or"auto". For more information, see theUseParallelproperty ofrlTrainingOptions.setup(env,UseParallel="auto")
Version History
Introduced in R2022a