Stacktrace:
[1] Int64 at .\float.jl:709 [inlined]
[2] convert at .\number.jl:7 [inlined]
[3] push! at .\array.jl:868 [inlined]
[4] stochasticSIR(::Array{Float64,1}, ::Array{Float64,1}, ::Int64) at .\In[18]:33
[5] top-level scope at In[18]:51
This apparently means that a Float64 number is trying to be converted into an integer. I do not know where in my code that is done. How is this fixed and why is this happening?
@anon94023334 Thank you, that fixed that issue. I actually did not realize that the “33” on line [4] meant line 33 in the stochasticSIR function. I will note that for future debugging.
I have another question, but if I need to make a thread for it please just say so.
I wrote this code to be my interpretation of Stochastic SIR model (discrete state, continuous time) in Julia - epirecipes but it is not doing what I thought it would do since when I examine each array in the sirOutput tuple they do not have matching lengths nor does the data they contain make sense. At this point the issue is a fundamental problem with how my code operates and I do not know what flaw in my architecture is. Do you?
Your example code is relatively small. Have you tried stepping through it with Debugger.jl to find the point where it’s execution diverges from your expectation?
pretty much guarantees that the data\_x arrays will be of different lengths: you’re pushing to data\i in both cases, but only pushing to the others conditionally.