Commit 2f7404f0 authored by Victor's avatar Victor
Browse files

minor updates

parent d86fe5df
Pipeline #93014 failed with stage
in 19 minutes and 35 seconds
......@@ -10,9 +10,9 @@ $(TYPEDEF)
"""
mutable struct Agent{A<:Ancestors,R<:Rates,T<:Tuple,U,V} <: AbstractAgent{A,R}
# history of traits for geotraits
x_history::Array{Any,1}
x_history::Vector
# birth time of ancestors
t_history::Array{U,1}
t_history::Vector{U}
# death rate
d::V
#birth rate
......
......@@ -53,6 +53,7 @@ $(TYPEDEF)
A real space with dimension N and type T
"""
struct RealSpace{N,T} <: AbstractStatSpace{N,T,IsFinite{false}} end
RealSpace(N) = RealSpace{N,Float64}()
"""
$(TYPEDEF)
A natural space with dimension N and type T
......
......@@ -63,10 +63,10 @@ function run!(w::World{A,S,T},alg::L,tend::Number,b,d;
end
"""
function _correct_timedep!(p::Dict)
function _check_timedep(b,d)
checks time dependency of birth and death functions,
and overloads the function if not provided
checks number of arguments of functions,
and throws error if problem
"""
function _check_timedep(b,d)
if numargs(b) < 2
......
# using Test
# using Revise
# using ABMEv
# using UnPack
#
# b(X) = gaussian(X[1],0.,sigma_K)
# d(X,Y) = gaussian(X[1],Y[1],sigma_a)/K0
# p = Dict{String,Any}();@pack! p = d,b
# X = [.5]; Y = [.6];t = 0.
# _correct_timedep(p)
# @testset "Utils" begin
# @test numargs(ABMEv.d) == 3
# @test numargs(ABMEv.b) == 2
# ABMEv.b(X,t) == b(X)
# end
b(X,t) = gaussian(X[1],0.,sigma_K)
d(X,Y,t) = gaussian(X[1],Y[1],sigma_a)/K0
p = Dict{String,Any}();@pack! p = d,b
@testset "Utils" begin
@test numargs(d) == 3
@test numargs(b) == 2
end
Supports Markdown
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