When make_model
has arguments, these can be passed using ...
.
These will be passed directly to make_model
except for any arguments
named in vary_along
. These arguments should be lists and a separate
model will be created for each combination of elements in these lists. For
example, if vary_along = c("n", "p")
, then we can pass
n=as.list(c(50, 100, 150))
and p=as.list(c(10, 100))
and 6
models will be created, one for each pair of n
and p
. For each
pair (n,p), a distinct extension is added to the end of the model name. This
extension is generated using a hash function so that different values of the
vary_along parameters will lead to different model name extensions. This
ensures that if one later decides to add more values of the vary_along
parameters, this will not lead to pre-existing files being overwritten
(unless the same values of the vary_along combination are used again.
If object
is a directory name, the function returns a reference or
list of references to the model(s) generated. If object
is a
Simulation
, then function returns the same Simulation
object
but with references added to the new models created. These changes to the
Simulation
object are saved to file.
make_model
is called generating an object of class
Model
, called model
, which is saved to
dir/name/model.Rdata
(where name
is the name attribute of
model
). This file also contains the random number generator state and
other information such as the function make_model
itself and the date
when model
was created.