Options for SARSA agent
For more information on SARSA agents, see SARSA Agents.
For more information on the different types of reinforcement learning agents, see Reinforcement Learning Agents.
opt = rlSARSAAgentOptions
rlSARSAAgentOptions object for use as an argument when creating a
SARSA agent using all default settings. You can modify the object properties using dot
EpsilonGreedyExploration— Options for epsilon greedy exploration
Options for epsilon greedy exploration, specified as an
EpsilonGreedyExploration object with the following numeric value
|Probability threshold to either randomly select an action or select the
action that maximizes the state-action value function. A larger value of
|Minimum value of |
Epsilon is updated using the following formula when it is greater
Epsilon = Epsilon*(1-EpsilonDecay)
To specify exploration options, use dot notation after creating the
rlSARSAAgentOptions object. For example, set the probability
opt = rlSARSAAgentOptions; opt.EpsilonGreedyExploration.Epsilon = 0.9;
SampleTime— Sample time of agent
1(default) | positive scalar
Sample time of agent, specified as a positive scalar.
Within a Simulink environment, the agent gets executed every
SampleTime seconds of simulation time.
Within a MATLAB environment, the agent gets executed every time the environment
SampleTime is the time interval between
consecutive elements in the output experience returned by
DiscountFactor— Discount factor
0.99(default) | positive scalar less than or equal to 1
Discount factor applied to future rewards during training, specified as a positive scalar less than or equal to 1.
|SARSA reinforcement learning agent|
This example shows how to create a SARSA agent option object.
rlSARSAAgentOptions object that specifies the agent sample time.
opt = rlSARSAAgentOptions('SampleTime',0.5)
opt = rlSARSAAgentOptions with properties: EpsilonGreedyExploration: [1x1 rl.option.EpsilonGreedyExploration] SampleTime: 0.5000 DiscountFactor: 0.9900
You can modify options using dot notation. For example, set the agent discount factor to
opt.DiscountFactor = 0.95;