Agent properties
The Agent
structure
Agent
is the atomic structure of ABMEv.jl. It has four attributes
- the ancestors' history of traits, and the corresponding time where the traits have changed,
- a death rate and a birth rate.
mutable struct Agent{A<:Ancestors,R<:Rates,T<:Tuple,U,V} <: AbstractAgent{A,R}
# history of traits for geotraits
x_history::Array{T,1}
# birth time of ancestors
t_history::Array{U,1}
# death rate
d::V
#birth rate
b::V
end
The type Agent
has two important composite types
Ancestors{bool}
: whenbool = true
, the ancestors traits are stored,Rates{bool}
: whenbool = true
, the ratesd
andb
of agents are updated at each time step. This is needed in e.g. Gillepsie Algorithm
ABMEv.Agent
— Typemutable struct Agent{A<:ABMEv.Ancestors, R<:ABMEv.Rates, T<:Tuple, U, V} <: AbstractAgent{A<:ABMEv.Ancestors,R<:ABMEv.Rates}
ABMEv.Agent
— MethodAgent(s; ancestors, rates)
Agent(s, pos; ancestors, rates)
Initialises agent with `pos` provided
ABMEv.Agent
— MethodAgent(s; ancestors, rates)
Initialises agent with 0 values everywhere
ABMEv.get_geo
— Methodget_geo(a, t)
Returns geotrait of agent a
at time t
ABMEv.get_t
— Methodget_t(a)
Get time when agent born.
ABMEv.get_x
— Methodget_x(a, t, i)
Returns trait i
of the agent. Geotrait corresponds to dimension i=0
.
ABMEv.increment_x!
— Methodincrement_x!(a, s, p, t)
This function increments agent by random numbers specified in p ONLY FOR CONTINUOUS DOMAINS