random: Random Action

Description Usage Arguments Value See Also Examples

Description

Random() is a utility function that returns randomly picked action indexes, with probabilities determined by input values.

Usage

1
Random(values)

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.

Value

an integer vector for chosen action indexes

See Also

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

Examples

1
2
Random(c(2, 1, 3, 7, 5))
Random(matrix(c(1, 2, 2, 1), 2, 2, byrow = TRUE))

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