knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
total_time <- 10 init_pop <- tibble::tibble( id = c(1:5), x = runif(5, 0, 1), y = runif(5, 0, 1) ) init_env <- tibble::tibble( weather = 'rain', temperature = 15, ) agent_task <- create_agent_task({ print(glue::glue("hello, I'm agent {self$id}")) }) referee_task <- create_referee_task({ print("hello, I'm the referee") }) referee <- referee() %>% set_task(referee_task) sim <- agents_from_param_table(init_pop) %>% set_task(agent_task) %>% agent_sim(time_total = total_time, environment = init_env, referee = referee) %>% run_sim() sim %>% parse_history('agents')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.