update_agents.Rdmicro-simulation time-step updater
update_agents(
sD,
yeartime,
agents_in,
social_network,
ignore_social = F,
cal_run = 50,
quiet = TRUE
)updated agent dataframe
The workhorse ABM function.Within a scenario, does a single month update of the agent characteristics. A random sample of agents evaluates their economic and social utilities. If these exceed their individual threshold an optimal PV_BESS system is adopted.
agents_in <- initialise_agents(sD,2015,100)
#> Joining with `by = join_by(q6)`
#> Joining with `by = join_by(qc2)`
#> Joining with `by = join_by(q1)`
#> Joining with `by = join_by(serial)`
#> Joining with `by = join_by(qh)`
#> Joining with `by = join_by(serial)`
social_network <- make_artificial_society(hp_society_oo %>% dplyr::filter(serial %in% agents_in$serial),homophily)
#> Error in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/home/runner/work/_temp/Library/igraph/libs/igraph.so':
#> libglpk.so.40: cannot open shared object file: No such file or directory
agents_1 <- update_agents(sD,2026+1/6,agents_in,social_network,cal_run=10,quiet=FALSE)
#> [1] "23 upgrades rejected"
#> Error in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/home/runner/work/_temp/Library/igraph/libs/igraph.so':
#> libglpk.so.40: cannot open shared object file: No such file or directory
agents_2 <- update_agents(sD,2026+1/3,agents_1,social_network,cal_run=10,quiet=FALSE)
#> Error: object 'agents_1' not found