After disabling ProgressMeter
and Plots
and putting the test into a function like so
function test()
K = 1000
b = 1.0
d = 0.9
c = (b-d)/(2K)
dni = 0.1
N = 10
model_parameter = (
birth = b,
death = d,
competition = c,
ΞΌ = dni,
Nloci = N
)
t = 0:100
x0 = DiploidModel.generatehealthypopulation(K,N)
#execute the simulation
history = DiploidModel.rungillespie(t,x0,model_parameter)
#plot simulation
#PlotFromDicts.plotmutationloadandprevalence(history)
end
JET reports for @report_opt test()
βββββ 3 possible errors found βββββ
β @ C:\Users\Win10\Documents\GitHub\Gillespie_Algorithm-master\Examples\RandomMating.jl:30 Main.DiploidModel.rungillespie(t, x0, model_parameter)
ββ @ C:\Users\Win10\Documents\GitHub\Gillespie_Algorithm-master\DiploidModel.jl:35 Main.DiploidModel.setupparameter(model_parameter, nβ)
βββ @ C:\Users\Win10\Documents\GitHub\Gillespie_Algorithm-master\DiploidModel.jl:51 Main.DiploidModel.npropagable(n0)
ββββ @ C:\Users\Win10\Documents\GitHub\Gillespie_Algorithm-master\DiploidModel.jl:95 Main.DiploidModel.sum(Base.Generator(#3, ps))
βββββ @ reduce.jl:549 Base.#sum#262(Base.pairs(Core.NamedTuple()), #self#, a)
ββββββ @ reduce.jl:549 Base.sum(Base.identity, a)
βββββββ @ reduce.jl:520 Base.#sum#261(Base.pairs(Core.NamedTuple()), #self#, f, a)
ββββββββ @ reduce.jl:520 Base.mapreduce(f, Base.add_sum, a)
βββββββββ @ reduce.jl:294 Base.#mapreduce#258(Base.pairs(Core.NamedTuple()), #self#, f, op, itr)
ββββββββββ @ reduce.jl:294 Base.mapfoldl(f, op, itr)
βββββββββββ @ reduce.jl:162 Base.#mapfoldl#254(Base._InitialValue(), #self#, f, op, itr)
ββββββββββββ @ reduce.jl:162 Base.mapfoldl_impl(f, op, init, itr)
βββββββββββββ @ reduce.jl:44 Base.foldl_impl(opβ², nt, itrβ²)
ββββββββββββββ @ reduce.jl:49 Base.reduce_empty_iter(op, itr)
βββββββββββββββ @ reduce.jl:370 Base.reduce_empty_iter(op, itr, Base.IteratorEltype(itr))
ββββββββββββββββ @ reduce.jl:371 Base.reduce_empty(op, Base.eltype(itr))
βββββββββββββββββ @ reduce.jl:348 Base.mapreduce_empty(#3, $(QuoteNode(Base.BottomRF{typeof(Base.add_sum)}(Base.add_sum))), _)
βββββββββββββββββ runtime dispatch detected: Base.mapreduce_empty(#3, $(QuoteNode(Base.BottomRF{typeof(Base.add_sum)}(Base.add_sum)))::Base.BottomRF{typeof(Base.add_sum)}, _::Type{Pair{Main.DiploidModel.RandomIndividual{Int64}, Int64}})
ββββββββββββββββββββββββββββββββββ
ββ @ C:\Users\Win10\Documents\GitHub\Gillespie_Algorithm-master\DiploidModel.jl:35 Main.DiploidModel.Gillespie.run_gillespie!(time, nβ, Main.DiploidModel.setupparameter(model_parameter, nβ), Main.DiploidModel.execute!, Main.DiploidModel.rates!, initrates, population_history)
βββ @ C:\Users\Win10\Documents\GitHub\Gillespie_Algorithm-master\MainFunctions.jl:17 Main.DiploidModel.Gillespie.mainiteration!(population_history, initrates, nβ, Main.DiploidModel.Gillespie.convert(Main.DiploidModel.Gillespie.Float64, Base.getindex(time, 1)), time, par, execute!, rates!)
ββββ @ C:\Users\Win10\Documents\GitHub\Gillespie_Algorithm-master\MainFunctions.jl:64 ct = Main.DiploidModel.Gillespie.onestep!(n0, rates, ct, step, par, ex!, r!)
βββββ @ C:\Users\Win10\Documents\GitHub\Gillespie_Algorithm-master\MainFunctions.jl:147 Main.DiploidModel.Gillespie.iszero(i)
ββββββ @ number.jl:42 Base.zero(x)
ββββββ runtime dispatch detected: Base.zero(x::Nothing)
ββββββββββββββββββββββ
βββββ @ C:\Users\Win10\Documents\GitHub\Gillespie_Algorithm-master\MainFunctions.jl:151 ex!(i, x_0, par)
ββββββ @ C:\Users\Win10\Documents\GitHub\Gillespie_Algorithm-master\DiploidModel.jl:194 Main.DiploidModel.death!(ps, par)
βββββββ @ C:\Users\Win10\Documents\GitHub\Gillespie_Algorithm-master\DiploidModel.jl:187 Base.setindex!(ps, Main.DiploidModel.-(Base.getindex(ps, Main.DiploidModel.choosefey(ps, Base.getindex(Base.getproperty(par, :popsize), 1))), Main.DiploidModel.one(Main.DiploidModel.valtype(ps))), Main.DiploidModel.choosefey(ps, Base.getindex(Base.getproperty(par, :popsize), 1)))
ββββββββ @ dict.jl:374 Base.convert(_, key0)
ββββββββ runtime dispatch detected: Base.convert(_::Type{Main.DiploidModel.RandomIndividual{Int64}}, key0::Nothing)
βββββββββββββββββββββββ
Does this help?