micro-simulation time-step updater

update_agents(
  sD,
  yeartime,
  agents_in,
  social_network,
  ignore_social = F,
  cal_run = 50,
  quiet = TRUE
)

Arguments

sD

scenario dataframe

yeartime

decimal time

agents_in

input agent dataframe

social_network

artifical social network

ignore_social

option to ignore social effects. Default is FALSE.

cal_run

microcalibration run index between 1 and 100

quiet

TRUE to suppress messages

Value

updated agent dataframe

Details

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.

Examples


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