Create options for SARSA agent


opt = rlSARSAAgentOptions creates an rlSARSAAgentOptions object for use as an argument when creating a SARSA agent using all default settings. You can modify the object properties using dot notation.


opt = rlSARSAAgentOptions(Name,Value) creates an options object using the specified name-value pairs to override default property values.


collapse all

Create an rlSARSAAgentOptions object that specifies the agent sample time.

opt = rlSARSAAgentOptions('SampleTime',0.5)
opt = 

  rlSARSAAgentOptions with properties:

    EpsilonGreedyExploration: [1×1 rl.option.EpsilonGreedyExploration]
                  SampleTime: 0.5000
              DiscountFactor: 0.9900

You can modify options using dot notation. For example, set the agent discount factor to 0.95.

opt.DiscountFactor = 0.95;

Input Arguments

collapse all

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'DiscountFactor',0.95

Options for epsilon greedy exploration, specified as the comma-separated pair consisting of 'EpsilonGreedyExploration' and an EpsilonGreedyExploration object with the following numeric value properties.

EpsilonProbability threshold to either randomly select an action or select the action that maximizes the state-action value function. A larger value of Epsilon means that the agent randomly explores the action space at a higher rate.
EpsilonMinMinimum value of Epsilon
EpsilonDecayDecay rate

Epsilon is updated using the following formula when it is greater than EpsilonMin:

Epsilon = Epsilon*(1-EpsilonDecay)

To specify exploration options, use dot notation after creating the rlSARSAAgentOptions object. For example, set the probability threshold to 0.9.

opt = rlSARSAAgentOptions;
opt.EpsilonGreedyExploration.Epsilon = 0.9;

Sample time of agent, specified as the comma-separated pair consisting of 'SampleTime' and a numeric value.

Discount factor applied to future rewards during training, specified as the comma-separated pair consisting of 'DiscountFactor' and a positive numeric value less than or equal to 1.

Output Arguments

collapse all

SARSA agent options, returned as an rlSARSAAgentOptions object. The object properties are described in Name-Value Pair Arguments.

Introduced in R2019a