Skip to contents

A model that needs an externally-owned parameter injector – a registered par-loader, e.g. a package's neural-network weight loader – flags that injector's "<package>:<function>" name here. At solve setup only the loader with that name runs, so an injector never overwrites an unrelated model's par_ptr merely because it happens to be registered. The flag is stored on the ui (a sticky item, so it survives model piping) like rxForcedPars(); set it to NULL to clear.

Usage

rxParLoader(ui)

rxParLoader(ui) <- value

Arguments

ui

an rxode2 ui / model function.

value

a single loader name ("<package>:<function>"), or NULL.

Value

the getter returns the name (or NULL); the setter returns the ui.

Author

Matthew L. Fidler

Examples

# \donttest{
mod <- function() {
  ini({
    k <- 0.1
  })
  model({
    d/dt(A) <- -k * A
  })
}
u <- rxode2(mod)
#>  
#>  
#> ℹ parameter labels from comments are typically ignored in non-interactive mode
#> ℹ Need to run with the source intact to parse comments
rxParLoader(u) <- "myPkg:myLoader"
rxParLoader(u)
#> [1] "myPkg:myLoader"
rxParLoader(u) <- NULL
# }