simulate_non_independence2: Internal to simulate_schedule

View source: R/simulate_non_independence2.R

simulate_non_independence2R Documentation

Internal to simulate_schedule

Description

sim = "non-independent"

Usage

simulate_non_independence2(
  n_groups = 4,
  n_animals = 16,
  n_splits = NA,
  time_to_leave = 5,
  time_to_return = 2,
  travel_time = c(0.01, 2),
  sampling_duration = 7
)

Arguments

n_groups

the number of social groups and/or distinct patches in the population

n_splits

the number of subgroups that groups will splinter into when they leave home. If NA, the number of subgroups is dependent on the number of animals in a group. now collapse instances where sub_ids are together – usually at home, but not always then remove duplicates initiate groups and hold them in reserve need to create vector column to see which groups are where split vector_i into a list of groups present make a mbrs_list that has length n vectors and populate it with members from holding look ahead to idx_i+1, the next time interval number_of_current_locations <- the number of rows in which vector occurs at present time_interval number_of_destinations <- the number of rows in which vector/mbrs_list have to go next if number of current locations is > 1 and number of destinations == 1, send all mbrs_list to the single destination's holding at next time interval condition 2 if number of current locations == 1 and number of destinations > 1, do multinomial draw to determine how many to send to each destination sample mbrs_list and send animals to destinations holding at next time interval condition 3 else if number of current locations > 1 and == number of destinations if n_curr_locs > 1 and n_next_locs != 1 and n_next_locs != n_curr_locs, subgroups split appropriately but due to sampling some sub groups ended at the same location after travelling separately, this handles the extra travelling state on the way home as well need a condition handler for the last idx

time_to_leave

the average number of days spent at home prior to leaving

time_to_return

the average number of days spent away from home prior to returning

travel_time

a list of two values in terms of days. These are the limits for draws from a uniform distribution governing how long it will take to get from one group to another.

sampling_duration

the number of days to simulate.


gavincotterill/modulr documentation built on Nov. 30, 2022, 11:15 p.m.