View source: R/func_rl_simulate_action.R
rl_action_simulate.greedy | R Documentation |
This implementation of a 'greedy' action selection policy will mean whichever action has the highest expected value will be taken.
## S3 method for class 'greedy' rl_action_simulate(policy = "greedy", values, ...)
policy |
Defines the action selection policy as "greedy"; argument included in this method to support S3 Generics. |
values |
A numeric vector containing the current value estimates of each action. |
... |
Additional arguments passed to or from other methods. |
A number representing which action will be taken.
action <- numeric(100) for (trial in seq_along(action)) { action[trial] <- rl_action_simulate( policy = "greedy", values = c(0.2, 0.25, 0.15, 0.8) ) } # All of the actions were to choose the highest value option all(action == 4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.