Skip to contents

The JSON config file should have 8 entries:

  • stochastic: a boolean value

  • theta: matrix (row major)

  • wf: vector

  • H: vector

  • SIR: matrix (row major)

  • b: scalar

  • c: scalar

  • gamma: scalar

For interpretation of the entries, please read setup_humans_SIR.

Usage

get_config_humans_SIR(path)

Arguments

path

a file path to a JSON file

Value

a named list

Examples

# to see an example of proper JSON input, run the following
library(jsonlite)
n <- 6 # number of human population strata
p <- 5 # number of patches
theta <- matrix(rexp(n*p), nrow = n, ncol = p)
theta <- theta / rowSums(theta)
H <- rep(10, n)
SIR <- matrix(0, nrow = n, ncol = 3)
SIR[, 1] <- H
par <- list(
 "stochastic" = FALSE,
 "theta" = theta,
 "wf" = rep(1, n),
 "H" = H,
 "SIR" = SIR,
 "b" = 0.55,
 "c" = 0.15,
 "gamma" = 1/7
)
toJSON(par, pretty = TRUE)
#> {
#>   "stochastic": [false],
#>   "theta": [
#>     [0.1675, 0.2697, 0.2, 0.2614, 0.1014],
#>     [0.0778, 0.5656, 0.1881, 0.1361, 0.0325],
#>     [0.019, 0.2514, 0.1755, 0.3766, 0.1775],
#>     [0.1063, 0.064, 0.6656, 0.0711, 0.0931],
#>     [0.2622, 0.0796, 0.0912, 0.4596, 0.1074],
#>     [0.1893, 0.1131, 0.0709, 0.1661, 0.4606]
#>   ],
#>   "wf": [1, 1, 1, 1, 1, 1],
#>   "H": [10, 10, 10, 10, 10, 10],
#>   "SIR": [
#>     [10, 0, 0],
#>     [10, 0, 0],
#>     [10, 0, 0],
#>     [10, 0, 0],
#>     [10, 0, 0],
#>     [10, 0, 0]
#>   ],
#>   "b": [0.55],
#>   "c": [0.15],
#>   "gamma": [0.1429]
#> }