[Stable]

The fields of an object can be viewed by printing the object. Each field has a corresponding function of the same name to access and modify it's value.

cores(m, text)

parafile(m, text)

walltime(m, text)

executed(m, text)

Arguments

m

An nm object.

text

Optional character for replacing field. If present function will modify field (of same name as function) otherwise will return value of field (of same name as function).

Details

Easiest way to see all fields of an object is to type the object into the console and hit enter. This will display the value of each field. some fields like cmd are glue fields. In these cases inserting expressions inside braces in text will evaluate the expression

The fundamental structure of all these functions is the same:

To access the value of a field: m %>% fieldname() or equivalently fieldname(m)

To modify the value of a field: m <- m %>% fieldname("newvalue")

Examples


# create example object m1 from package demo files
exdir <- system.file("extdata", "examples", "theopp", package = "NMproject")
m1 <- new_nm(run_id = "m1", 
             based_on = file.path(exdir, "Models", "ADVAN2.mod"),
             data_path = file.path(exdir, "SourceData", "THEOPP.csv"))

m1 <- m1 %>% cmd("execute -parafile={parafile} {ctl_name} -dir={run_dir} -nodes={cores}")

m1 <- m1 %>% cores(8) %>% parafile("mpilinux8.pnm")

cmd(m1)
#> [1] "execute -parafile=mpilinux8.pnm runm1.mod -dir=m1 -nodes=8"
cores(m1)
#> [1] 8