rlQAgentOptions

Create options for Q-learning agent

Syntax

opt = rlQAgentOptions
opt = rlQAgentOptions(Name,Value)

Description

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

example

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

Examples

collapse all

Create an rlQAgentOptions object that specifies the agent sample time.

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

  rlQAgentOptions 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.

PropertyDescription
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 rlQAgentOptions object. For example, set the probability threshold to 0.9.

opt = rlQAgentOptions;
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

Q-learning agent options, returned as an rlQAgentOptions object. The object properties are described in Name-Value Pair Arguments.

Introduced in R2019a