-
Notifications
You must be signed in to change notification settings - Fork 2
EpiModelHIV ‐ code conventions
Adrien Le Guillou edited this page Dec 13, 2024
·
4 revisions
Work In Progress
new_module <- function(dat, at) {
##Inputs
# Attributes
an.attribute <- get_attr(dat, "an.attribute")
# Parameters
a.param <- get_param(dat, "a.param")
## Process
an.attribute <- an.attribute + a.param
## Output
# Attributes
dat <- set_attr(dat, "an.attribute", an.attribute)
# Epi Trackers
dat <- set_epi(dat, "high.attributes", at, an.attribute > 10)
return(dat)
}
- parameters are
lower.dot.case
- attributes are
lower.dot.case
- variables in a module are
lower_snake_case
- functions are
lower_snake_case
Try to follow the below example:
new disease xyz
-
xyz
: 0-1; presence of the disease -
xyz.tx: 0-1; presence of treatment for
xyz` -
xyz.dx: 0-1;
xyz` diagnosed -
xyz.sympt: 0-1;
xyz` with symptoms -
xyz.count: 0-Inf; number of time infected by
xyz` -
xyz.tst.last
: time step; last timexyz
was testd -
xyz.dx.last
: time step; last timexyz
was diagnosed -
xyz.stage
: 0-N; stage ofxyz
-
xyz.prob
: [0, 1]; probability of gettingxyz
-
xyz.tx.int
: 0-N; duration ofxyz
treatment in timestep -
xyz.sympt.prob
: [0, 1]; probability of havingxyz
symptoms