Initialise new individuals into the IBM. This function is generally not needed because it is run inside the run_farm_sim function to generate new individuals for simulations. To initialise individuals with this function, it is necessary to set the mine_output argument to output from the mine_gmatrix function. This output includes all of the information necessary to build individuals with genomes that produce traits that covary in a pre-specified way. The arguments of this function include addition information for building the individual array, which is a two-dimensional array in which each individual occupies a row, and each column specifies a character of the individual (including all genome loci). See vignettes for a more detailed explanation.
initialise_inds(
mine_output,
N = 1000,
xdim = 100,
ydim = 100,
repro = "sexual",
neutral_loci = 10,
max_age = 9,
min_age_move = 0,
max_age_move = 9,
min_age_reproduce = 0,
max_age_reproduce = 9,
min_age_feed = 0,
max_age_feed = 9,
food_consume = 0.25,
pesticide_consume = 0.1,
rand_age = FALSE,
move_distance = 1,
food_needed_surv = 0.25,
pesticide_tolerated_surv = 0.1,
food_needed_repr = 0,
pesticide_tolerated_repr = 0,
reproduction_type = "lambda",
mating_distance = 1,
lambda_value = 1,
movement_bouts = 1,
selfing = TRUE,
feed_while_moving = FALSE,
pesticide_while_moving = FALSE,
mortality_type = 0,
age_food_threshold = NA,
age_pesticide_threshold = NA,
metabolism = 0,
baseline_metabolism = 0,
min_age_metabolism = 1,
max_age_metabolism = 9,
trait_means = NULL
)A two-dimensional array of individuals for simulation
The output from mine_gmatrix
Number of individuals to be initialised
Horizontal dimensions of the landscape
Vertical dimensions of the landscape
Type of reproduction allowed: "asexual", "sexual", and "biparental". Note that if repro != "asexual", this causes a diploid genome.
The number of neutral loci individuals have (must be > 0)
The maximum age of an individual
The minimum age at which an individual can move
The maximum age at which an individual can move
The minimum age which an individual can reproduce
The maximum age which an individual can reproduce
The minimum age at which an individual feeds
The maximum age at which an individual feeds
The amount of food consumed during feeding
Amount of pesticide consumed while on a cell
Initialise individuals with a random age (TRUE/FALSE)
Maximum cells moved in one bout of movement
Food needed to survive (if over min_age_feed)
Pesticide tolerated by individual
Food needed to reproduce 1 offspring
Pesticide tolerated to allow reproduction
Poisson reproduction ("lambda") vs "food_based"
Distance in cells within which mate is available
individual value for poisson reproduction
Number of bouts of movement per time step
If sexual reproduction, is selfing allowed? (TRUE/FALSE)
Do individuals feed after each movement bout?
Individuals consume pesticide after move bout?
Type of mortality (currently only one option)
Age at which food threshold is enacted
Age at which pesticide threshold is enacted
The amount of consumed food lost each time step
A fixed baseline rate added to 'metabolism'+
The minimum age affected by metabolism
The maximum age affected by metabolism
The means of the custom pest traits
gmt <- matrix(data = 0, nrow = 2, ncol = 2);
diag(gmt) <- 1;
mg <- mine_gmatrix(gmatrix = gmt, loci = 4, layers = 2, indivs = 100,
npsize = 100, max_gen = 4, prnt_out = FALSE);
inds <- initialise_inds(mine_output = mg, N = 40, repro = "asexual");
Run the code above in your browser using DataLab