# NOT RUN {
horizon <- 100L
simulations <- 100L
bandit <- ContextualLinearBandit$new(k = 4, d = 3, sigma = 0.3)
agents <- list(Agent$new(EpsilonGreedyPolicy$new(0.1), bandit, "EGreedy"),
Agent$new(ContextualLinTSPolicyPolicy$new(0.1), bandit, "LinTSPolicy"))
simulation <- Simulator$new(agents, horizon, simulations, do_parallel = TRUE)
history <- simulation$run()
plot(history, type = "cumulative", rate = FALSE, legend_position = "topleft")
# }
Run the code above in your browser using DataLab