simulate_blv_spread: Simulate spread of BLV

Description Usage Arguments Value

View source: R/simulation.R

Description

Simulate spread of BLV in a typical Japanese dairy herd.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
simulate_blv_spread(
  prepared_data,
  param,
  list_param_modif = NULL,
  save_cows = T,
  save_param = T,
  i_simulation_start = 1,
  seed = NULL,
  validate = T,
  silent = F,
  gc = T
)

Arguments

prepared_data

The result of prepare_data().

param

See param.

list_param_modif

List of lists. Parameter specified in each inner list overwrite default parameters. Each inner list is passed to param_modif of calc_param(). Specify like list(modification_for_iter1 = list(parameter_name = new_value, ...), modification_for_iter2 = list(...), ...).

save_cows

Whether to save results of simulations. "simulation000.csv" contains information of a herd at the start of a simulation and "simulationXXX.csv" contains a result of each run.

save_param

Whether to save parameters used in simulations. "param_simulation000.txt" contains values of param (after passed to process_param()) and "param_simulationXXX.txt" contains a result of calc_param() in each run. Use read_param() to read an output file.

i_simulation_start

An option to rerun a simulation from the middle of simulations. For example, you run 100 simulation, simulation 26 encounter error and stopped, and you want to run simulation 26-100 again while keeping the result from simulation 1-25. Then set i_simulation = 26.

seed

Seed for a simulation.

validate

A logical value indicates whether validate inputs (data and paramters).

silent

A logical value to control print Simulation x / x while simulation.

gc

If TRUE, a garbage collection is done after every simulation.

Value

The function invisibully returns the result of the final run of simulations. csv files storing cow data and txt files storing parameters information are written to a directory specified by param$output_dir.


fmsan51/blvibmjp documentation built on Sept. 2, 2020, 9:04 p.m.