sympatric_speciation.jl 521 Bytes
Newer Older
Victor's avatar
Victor committed
1
2
3
4
5
using ABMEv,UnPack,Plots

myspace = (RealSpace{1,Float64}(),)
σ_b = .9;
σ_d = .7;
Victor's avatar
Victor committed
6
K0 = 1000
Victor's avatar
Victor committed
7
8
9
10
11
b(X,t) = 1.
d(X,Y,t) = gaussian(X[1],Y[1],σ_d)/K0 / gaussian(X[1],0.,σ_b)
D = (1e-2,)
mu = [.1]
NMax = 2000
Victor's avatar
Victor committed
12
tend = 1500
Victor's avatar
Victor committed
13
p = Dict{String,Any}();@pack! p = D,mu,NMax
14
myagents = [Agent(myspace,(1e-2 * randn(Float64),)) for i in 1:K0]
Victor's avatar
Victor committed
15
w0 = World(myagents,myspace,p,0.)
16
@time sim = run!(w0,Gillepsie(),tend,b,d, dt_saving = 10)
Victor's avatar
Victor committed
17

Victor's avatar
Victor committed
18

Victor's avatar
Victor committed
19
20
21
22
Plots.plot(sim,
        ylabel = "Adaptive trait",
        ylims = (-1,1),
        markersize = 2.)