xiaomingfu2013 / delayssatoolkit.jl Goto Github PK
View Code? Open in Web Editor NEWDelaySSAToolkit.jl: a tool in Julia for stochastic simulation with delays
License: MIT License
DelaySSAToolkit.jl: a tool in Julia for stochastic simulation with delays
License: MIT License
Is there any way to access problem parameters from the integrator interface? Currently delay_trigger
functions have to be of the form (integrator, rng) -> ...
and integrator.p
does not seem to store these parameters. This would be useful if the waiting time (or the waiting time distribution) is treated as another parameter of the model.
@JuliaRegistrator register
At the moment this package does not work with StaticArrays:
using Catalyst
using StaticArrays
using DelaySSAToolkit
using DifferentialEquations
rn = @reaction_network begin
1, 0 --> A
end
delay_trigger_affect! = function (integrator, rng)
append!(integrator.de_chan[1], 10)
end
u0 = @SVector [ 0 ]
tspan = (0., 100.)
delay_trigger = Dict(1=>delay_trigger_affect!)
delay_complete = Dict(1=>[1=>-1])
delay_interrupt = Dict()
delayjumpset = DelayJumpSet(delay_trigger, delay_complete, delay_interrupt)
dprob = DiscreteProblem(rn, u0, tspan)
jsys = convert(JumpSystem, rn)
djprob = DelayJumpProblem(jsys, dprob, DelayRejection(), delayjumpset, [[]])
solve(djprob, SSAStepper())
gives the following error:
setindex!(::SVector{1, Int64}, value, ::Int) is not defined.
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:33
[2] setindex!(a::SVector{1, Int64}, value::Int64, i::Int64)
@ StaticArrays ~/.julia/packages/StaticArrays/tBRNS/src/indexing.jl:3
[3] execute_delay_complete!
@ ~/.julia/packages/DelaySSAToolkit/d6UCB/src/delayaggregator/delayssajump.jl:248 [inlined]
(...)
Changing @SVector
to @MVector
or dropping it fixes the issue. In contrast, DiffEqJump works with no issues:
rn = @reaction_network begin
1, 0 --> A
0.1, A --> 0
end
u0 = @SVector [ 0 ]
tspan = (0., 100.)
dprob = DiscreteProblem(rn, u0, tspan)
jsys = convert(JumpSystem, rn)
jprob = JumpProblem(jsys, dprob, Direct())
solve(jprob, SSAStepper())
Running long SSA simulations with dynamic arrays uses a lot of allocations, hence being able to use StaticArrays would be great here!
This issue is used to trigger TagBot; feel free to unsubscribe.
If you haven't already, you should update your TagBot.yml
to include issue comment triggers.
Please see this post on Discourse for instructions and more details.
If you'd like for me to do this for you, comment TagBot fix
on this issue.
I'll open a PR within a few hours, please be patient!
DiffEqJump.jl was changed to JumpProcesses.jl with a new major so you should update this but will not get a CompatHelper PR.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.