Generate the preparatory files required for simulation.

run_flfll(
facts_file,
output_path = tempfile(),
log_path = output_path,
n_burn = NULL,
n_mcmc = NULL,
n_weeks_files = 10000,
n_patients_files = 10000,
n_mcmc_files = 0,
n_mcmc_thin = NULL,
flfll_seed = NULL,
flfll_offset = NULL,
verbose = FALSE
)

## Arguments

facts_file Character, name of a FACTS file. Usually has a *.facts file extension. Character, directory path to the files to generate. Character, path to the log file generated by FLFLL. Number of burn-in iterations for the MCMC. Number of MCMC iterations used in inference. Number of weeks*.csv files to save in output_path. Number of patients*.csv files to save in output_path. Number of mcmc*.csv files to save in output_path. Number of thinning iterations for the MCMC. Positive integer, random number generator seed for FLFLL. This seed is only used for stochastic preprocessing steps for generating the *.param files. It is not the random number generator seed for the actual trial simulations. To set the trial simulation seed, use the seed argument of run_facts(), run_engine(), or one of the specific run_engine*() functions. Integer, offset for the random number generator. Logical, whether to print progress information to the R console.

## Value

Character, the value of output_path. output_path is the directory path to the files generated by run_flfll().

## Details

For advanced control over trial simulations, you must first call run_flfll() and then call one of the engine functions such as run_engine_contin(). run_flfll() generates the preparatory *.param files that the run_engine_*() functions understand. You will pass these *.param files or their parent directory to param_files argument of run_engine_contin() etc.

get_facts_file_example(), run_engine(), run_engine_contin()

## Examples

# Can only run if system dependencies are configured:
if (file.exists(Sys.getenv("RFACTS_PATHS"))) {
facts_file <- get_facts_file_example("contin.facts") # example FACTS file
out <- run_flfll(facts_file, verbose = FALSE) # Generate param files.
# Run the simulations.
run_engine(
facts_file,
param_files = out,
n_sims = 1,
verbose = FALSE
)