Learn R Programming

ReinforcementLearning (version 1.0.5)

computePolicy: Computes the reinforcement learning policy

Description

Computes reinforcement learning policy from a given state-action table Q. The policy is the decision-making function of the agent and defines the learning agent's behavior at a given time.

Usage

computePolicy(x)

Arguments

x

Variable which encodes the behavior of the agent. This can be either a matrix, data.frame or an rl object.

Value

Returns the learned policy.

See Also

ReinforcementLearning

Examples

Run this code
# NOT RUN {
# Create exemplary state-action table (Q) with 2 actions and 3 states
Q <- data.frame("up" = c(-1, 0, 1), "down" = c(-1, 1, 0))

# Show best possible action in each state
computePolicy(Q)

# }

Run the code above in your browser using DataLab