To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 56d815ba authored by Victor's avatar Victor
Browse files

v3.2 , updated consistently the package so that mutations can, if mu[i] =...

v3.2 , updated consistently the package so that mutations can, if mu[i] = ndmis(space[i]) happen on every component of the high dimensional space. This is done in a performant way that has been benmarked.
parent c8b74e4d
Pipeline #87378 failed with stage
in 16 minutes and 18 seconds
name = "ABMEv"
uuid = "837ac870-fb52-4b0c-9a0e-030f2f36f5ed"
authors = ["Victor Boussange "]
version = "3.1.0"
version = "3.2.0"
[deps]
Arpack = "7d9fca2a-8960-54d3-9f78-7d1dccf2cb97"
......
......@@ -36,7 +36,7 @@ mu = [.1]
NMax = 10000
tend = 1.5
p = Dict{String,Any}();@pack! p = D,mu,NMax
myagents = [Agent(myspace,(1,),ancestors=true,rates=true) for i in 1:K0]
myagents = [Agent(myspace,[1],ancestors=true,rates=true) for i in 1:K0]
w0 = World(myagents,myspace,p,0.)
w1 = copy(w0)
@info "Running simulation with Gillepsie algorithm"
......
......@@ -18,7 +18,7 @@ NMax = 10000
tend = 1.5
p = Dict{String,Any}();@pack! p = D,mu,NMax
myagents = [Agent(myspace,(0,),ancestors=true,rates=true) for i in 1:K0]
myagents = [Agent(myspace,[0.,],ancestors=true,rates=true) for i in 1:K0]
w0 = World(myagents,myspace,p,0.)
@info "Running simulation with Gillepsie algorithm"
@time sim = run!(w0,Gillepsie(),tend,b,d)
......
......@@ -57,8 +57,8 @@ cb(w) = Dict("gamma_div" => w -> var(Float64.(get_x(w,1))))
myagents = [Agent(myspace,[0.],ancestors=true,rates=true) for i in 1:K0]
w0 = World(myagents,myspace,p,0.)
w1 = copy(w0)
cb = (names = ["gamma_div"], agg = Function[w -> var(Float64.(get_x(w,1)))])
eltype(cb.agg)
cb(w) = Dict("gamma_div" => var(Float64.(get_x(w,1))))
# eltype(cb.agg)
@time sim = run!(w1,Gillepsie(),tend,b,d,cb=cb,t_saving_cb = collect(1.0:0.1:1.5))
@test typeof(sim["gamma_div"]) <: Vector
@test get_size(sim) == length(sim["gamma_div"])
......@@ -68,5 +68,5 @@ eltype(cb.agg)
## testing plot
using Plots
plot(get_tspan(sim),sim["gamma_div"])
# using Plots
# plot(get_tspan(sim),sim["gamma_div"])
......@@ -71,11 +71,11 @@ a5 = Agent(myspace2,ancestors=true)
# increment test
p_myspace = Dict("D"=>[1,1,1],"mu" =>[1,1,1] )
p_myspace2 = Dict("D"=>[1,1,1],"mu" =>[1,1,1])
p_myspace2 = Dict("D"=>[1,1,[1,1]],"mu" =>[1,1,[1,1]])
old_a1 = copy(a1)
@test !prod((get_x(old_a1) . get_x(increment_x!(a1,myspace,p_myspace,0.))))
@test nancestors(increment_x!(a2,myspace,p_myspace,2.)) > 1
@test !isnothing(increment_x!(a4,myspace2,p_myspace2,2.))
@test !isnothing(increment_x!(a5,myspace2,p_myspace2,2.))
@test typeof(ABMEv._get_xinc(a2,myspace,p,0.)) == typeof(get_x(a2))
@test typeof(ABMEv._get_xinc(a2,myspace,p_myspace,0.)) == typeof(get_x(a2))
end
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