generatePolicyBlock
Generate Simulink block that evaluates policy of an agent or policy object
Since R2022b
Syntax
Description
This function generates a Simulink® Policy evaluation block from an agent or policy object. It also creates a data file which stores policy information. The generated policy block loads this data file to properly initialize itself prior to simulation. You can use the block to simulate the policy and generate code for deployment purposes.
For more information on policies and value functions, see Create Actors, Critics, and Policy Objects.
generatePolicyBlock( creates a block
that evaluates the policy of the specified agent using the default block name, policy
name, and data file name.agent)
For agents with a stochastic actor (PG, PPO, SAC, TRPO, AC), the action returned by
the generated policy function depends on the value of the
UseExplorationPolicy property of the agent. By default,
UseExplorationPolicy is false and the generated
action is deterministic. If UseExplorationPolicy is
true, the generated action is stochastic.
generatePolicyBlock(___,MATFileName=
specifies the file name of the data file.dataFileName)
Examples
Input Arguments
Version History
Introduced in R2022b
See Also
Functions
Objects
rlMaxQPolicy|rlEpsilonGreedyPolicy|rlAdditiveNoisePolicy|rlDeterministicActorPolicy|rlStochasticActorPolicy|rlHybridStochasticActorPolicy|dlnetwork

