AgentProperties() is a helper function to construct instances of
AgentProperties objects. This function initializes an agent's
properties, including body mass, movement parameters, and interactions with
environmental drivers.
Usage
AgentProperties(
species_id = NA_character_,
initial_mass = NULL,
speeds = list(),
cost_par_draws = list(),
start_point = sf::st_point(),
end_point = sf::st_point(),
mortality_thresh = NULL,
energy_to_mass = NULL,
move_influences = list(),
state_influences = list(),
age = NULL,
sex = c("f", "m"),
...,
species = NULL,
model_config = NULL
)Arguments
- species_id
character, the identifier code for the agent's species.
- initial_mass
<units>object, the agent's body mass at the start of the simulation.- speeds
a named list, defining movement speed properties for the agent. Each element specifies the agent's average speed for a given movement state (e.g. flying, swimming, etc). List elements must be of type
<units>.- cost_par_draws
a named list bla
- start_point, end_point
objects of class
XY, the spatial coordinates of the agent at the start and end of the simulation, respectively.- mortality_thresh
<units>object, the threshold body mass below which the agent is assumed to die.- energy_to_mass
a
<units>object, providing the agent's energy-to-bodymass conversion rate (e.g. g/kJ).- move_influences
a named list, defining whether the agent is influenced by model drivers. Each element corresponds to a
driver_id(which must be defined in the model's Driver object) and contains a single-rowdata.framewith columns:p: numeric, providing the probability that the agent is influenced by the named driver.infl: logical, whether the agent is influenced by the driver. It should be determined via a Bernoulli trial with probabilityp.
- state_influences
a named list, defining whether agent states are influenced by model drivers. Each element, named after a
driver_id, contains adata.framewith columns:state_id: character string, the unique identifier of an agent's state.p: numeric, the probability that the agent'sstate_idis influenced by the driver.infl: logical, whether the agent'sstate_idis influenced by the driver. It should be determined via a Bernoulli trial with probabilityp.ext:<units>value, the extent of the influence on the agent'sstate_id.
- age
<units>object, the age of the agent at the start of the simulation (currently unused).- sex
character, the sex of the agent, where
"f"denotes female and"m"denotes male (currently unused).- ...
reserved for future extensions (currently ignored).
- species
a <Species> object, If not
NULL(default), it is used to populate the slots of the returned<AgentProperties>object, overriding the above function arguments.- model_config
a ModelConfig object, used alongside Species to populate the returned
<AgentProperties>object.
Value
an object of class AgentProperties
Details
If species (and model_config) are specified, all other arguments are
ignored. The AgentProperties object is then populated using the
provided <Species> and <ModelConfig> objects. Specifically:
@initial_massis sampled fromSpecies@body_mass_distr@speedsare generated based onSpecies@behaviour_profile@mortality_threshis sampled fromSpecies@mortality_thresh_distr@start_pointand@end_pointare defined fromModelConfig@start_sitesandModelConfig@end_sites. In cases where these slots are empty, the agent's start/end locations are randomly assigned within the AOC area based on slotModelConfig@aoc_bbox.@move_influencesandstate_influencesare generated fromSpecies@driver_responses.
