EpsilonGreedy: Epsilon-Greedy Action

Description Usage Arguments Value See Also Examples

View source: R/utils.R

Description

EpsilonGreedy() is a utility function that performs "epsilon-greedy" actions.

Usage

1
EpsilonGreedy(values, epsilon = 0.1)

Arguments

values

a numeric vector or matrix for values of actions. For numeric vector, it is values of all actions; for numeric matrix, each row is a set of values.

epsilon

a numeric value between 0 and 1. It is the probability of choosing uniformly random actions instead of greedy actions.

Value

an integer vector for chosen action indexes

See Also

Other value-based action functions: Gibbs(), Greedy(), Random()

Examples

1
2
EpsilonGreedy(c(2, 1, 3, 7, 5))
EpsilonGreedy(matrix(c(1, 2, 2, 1), 2, 2, byrow = TRUE), epsilon = 0.2)

XiaoqiLu/PhD-Thesis documentation built on March 1, 2021, 10:49 a.m.