Skip to contents

Executes an NLME simulation

Usage

simmodel(
  model,
  simParams,
  params,
  hostPlatform = NULL,
  runInBackground = FALSE,
  ...
)

Arguments

model

PK/PD model class object.

simParams

Simulation parameters. See NlmeSimulationParams. If missing, default parameters generated by NlmeSimulationParams() are used.

params

Engine parameters. See engineParams. The common parameters include: sort, ODE, rtolODE, atolODE, maxStepsODE. If missing, default parameters generated by engineParams(model) are used.

hostPlatform

Host definition for model execution. See hostParams. If missing, simple local host is used.

runInBackground

Set to TRUE to run in background and return prompt.

...

Additional class initializer arguments for NlmeSimulationParams, or arguments available inside hostParams or engineParams functions. If engineParams arguments are supplied through both params argument and additional argument (i.e., ellipsis), then the arguments in params will be ignored and only the additional arguments will be used with warning. If hostParams arguments are supplied through both hostPlatform argument and additional argument, then its slots will be overridden by additional arguments. In addition, if NlmeSimulationParams arguments are supplied through both simParams argument and additional argument, then its slots will be overridden by additional arguments.

Value

returns job properties if runInBackground is TRUE; if runInBackground is FALSE and the function is called in interactive mode, the resulted simulated tables wil be loaded and presented as a list; if runInBackground is FALSE and the function is called in non-interactive mode, the list returned will have just the full paths of the tables generated.

Examples

# \donttest{
SimTableObs <- tableParams(
  name = "SimTableObs.csv",
  timesList = "0,1,2,4,4.9,55.1,56,57,59,60",
  variablesList = "C, CObs",
  timeAfterDose = FALSE,
  forSimulation = TRUE
)

simParams <- NlmeSimulationParams(
  numReplicates = 2,
  simulationTables = SimTableObs
)
# Define the model
model <- pkmodel(
  numComp = 2,
  absorption = "Extravascular",
  ID = "Subject",
  Time = "Act_Time",
  CObs = "Conc",
  Aa = "Amount",
  data = pkData,
  modelName = "PkModel"
)
results <- simmodel(model, simParams)
#> Using localhost without parallelization.
#> 
#> NLME Job
#> 
#> Compiling 1 of 1 NLME models
#> TDL5 version: 24.9.1.1
#> 
#> Status: OK
#> License expires: 2026-04-08
#> Refresh until: 2025-05-07 20:38:27
#> Current Date: 2025-04-07
#> The model compiled
#> 
#> Trying to generate job results...
#> 
#> Copying tables SimTableObs.csv, predcheck0.csv, predcheck0_cat.csv, predcheck1.csv, predcheck1_cat.csv, predcheck1_npd.csv, predcheck2.csv, predcheck2_cat.csv, predcheck2_npd.csv, predcheck_bql.csv, predout.csv
#> 
#> Finished summarizing results. Transferring data and loading the results...
#> Done generating job results.
#> 
#> VPC/Simulation results are ready in C:/Users/jcraig/Documents/GitHub/R-RsNLME/docs/reference/PkModel
#> Loading the results
#> Loading SimTableObs.csv
#> Loading predout.csv
# with seed given additionally:
results <- simmodel(model, simParams, seed = 3527)
#> Using localhost without parallelization.
#> 
#> NLME Job
#> 
#> Compiling 1 of 1 NLME models
#> TDL5 version: 24.9.1.1
#> 
#> Status: OK
#> License expires: 2026-04-08
#> Refresh until: 2025-05-07 20:38:27
#> Current Date: 2025-04-07
#> The model compiled
#> 
#> Trying to generate job results...
#> 
#> Copying tables SimTableObs.csv, predcheck0.csv, predcheck0_cat.csv, predcheck1.csv, predcheck1_cat.csv, predcheck1_npd.csv, predcheck2.csv, predcheck2_cat.csv, predcheck2_npd.csv, predcheck_bql.csv, predout.csv
#> 
#> Finished summarizing results. Transferring data and loading the results...
#> Done generating job results.
#> 
#> VPC/Simulation results are ready in C:/Users/jcraig/Documents/GitHub/R-RsNLME/docs/reference/PkModel
#> Loading the results
#> Loading SimTableObs.csv
#> Loading predout.csv
# }