Code Monkey home page Code Monkey logo

delayssatoolkit.jl's Introduction

Google Scholar Badge ResearchGate Badge

delayssatoolkit.jl's People

Contributors

dependabot[bot] avatar gudongyangg avatar kaandocal avatar x-y-zhou avatar xiaomingfu2013 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

delayssatoolkit.jl's Issues

Adding model parameters to `delay_trigger`

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.

Incompatibility with StaticArrays

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!

TagBot trigger issue

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!

Update for rename of DiffEqJump

DiffEqJump.jl was changed to JumpProcesses.jl with a new major so you should update this but will not get a CompatHelper PR.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.