Commit f80c1a7b authored by Victor's avatar Victor
Browse files

updates on docs

parent 634e4b31
Pipeline #78035 failed with stage
in 19 minutes and 49 seconds
......@@ -38,11 +38,11 @@ gplot(g, collect(1:nodes), collect(1:nodes))
## Defining competition processes
We propose that any individual have a constant birth rate, and competes with all the individuals present in the same patch. Assume there are ``N_t`` individuals at time ``t``.
Let ``i \in \{ 1,2,\dots,N_t\}``. ``x_{i,t} \in \{1,2,\dots,9\}`` denotes the position of the ``i``-th individual at time ``t``.
Let ``i \in \{ 1,2,\dots,N_t\}``. ``x_{i} \in \{1,2,\dots,9\}`` denotes the position of the ``i``-th individual.
The competition pressure experienced by individual ``i`` is such that
```math
d(x_{i,t}) = \sum_j^{N(t)} \delta(x_{i,t}-x_{j,t})
d(x_{i},t) = \sum_j^{N(t)} \delta(x_{i}-x_{j})
```
where ``\delta`` is the dirac function.
......
......@@ -16,7 +16,7 @@ A particular event, birth or death, is chosen at random with a probability equal
### Time steps
An event is exponentiallly distributed in time, with parameter ``\lambda = U(t)``. This makes events memoryless, meaning that the probability of having a birth or death event is always the same, no matter when (``P(X > s_t | X > t) = P(X > s) ``.
!!! tip "Inversion method"
<!-- !!! tip "Inversion method"
Let ``B(t) = \sum_i b_i(t)`` and  ``D(t) = \sum_i d_i(t)``. Let ``T_b, T_d`` the time for a birth or death event to occur. Then we have ``P(T_b < T_d) = \frac{B(t)}{B(t) + D(t)}`` (competing exponentials).
Let ``U`` be an ``\mathcal{U}_{(0,1)}``-distributed random variable and ``F \colon \R \to [0,1]`` be a distribution function. Then we have
......@@ -29,7 +29,7 @@ An event is exponentiallly distributed in time, with parameter ``\lambda = U(t)`
```math
dt(\omega) = -\frac{\log(U(\omega))}{R(t)} \iff X(\omega) = \exp(-U(t)dt(\omega))
```
``` -->
```@autodocs
Modules = [ABMEv]
......
......@@ -91,3 +91,14 @@ function get_xarray(world::World,geotrait::Bool=false)
return xarray
end
@deprecate get_xarray(world,geotrait=false) get_x(world,Colon())
"""
function give_birth(mum_idx::Int,w::World)
Copies agent within index `mum_idx`, and increment it by dx.
Return new agent (offspring).
"""
function give_birth(mum_idx::Int,w::World)
new_a = copyxt(w[mum_idx])
increment_x!(new_a,space(w),parameters(w),time(w))
return new_a
end
......@@ -5,15 +5,6 @@ $(TYPEDEF)
"""
struct Gillepsie <: AbstractAlg end
export Gillepsie
"""
function give_birth(a::Agent,t,p::Dict)
Used for Gillepsie setting
"""
function give_birth(mum_idx::Int,w::World)
new_a = copyxt(w[mum_idx])
increment_x!(new_a,space(w),parameters(w),time(w))
return new_a
end
function updateBirthEvent!(w::World,::Gillepsie,mum_idx::Int,b,d)
# updating competition only the two columns corresponding to agent idx
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment