Skip to content

Commit

Permalink
Merge pull request #449 from isaacsas/document_regular_jumps
Browse files Browse the repository at this point in the history
Document regular jumps
  • Loading branch information
isaacsas authored Sep 2, 2024
2 parents 57098bc + 3ff7845 commit 42a40b0
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/jumps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,50 @@ end
"""
$(TYPEDEF)
Representation for encoding rates and multiple simultaneous jumps via τ-leaping type
methods.
### Constructors
- `RegularJump(rate, c, numjumps; mark_dist = nothing)`
## Fields
$(FIELDS)
## Examples
```julia
function rate!(out, u, p, t)
out[1] = (0.1 / 1000.0) * u[1] * u[2]
out[2] = 0.01u[2]
nothing
end
const dc = zeros(3,2)
function c(du, u, p, t, counts, mark)
mul!(du, dc, counts)
nothing
end
rj = RegularJump(rate!, c, 2)
## Notes
- `mark_dist` is not currently used or supported in τ-leaping methods.
```
"""
struct RegularJump{iip, R, C, MD}
"""
Function `rate!(rate_vals, u, p, t)` that returns the current rates, i.e.
intensities or propensities, for all possible jumps.
"""
rate::R
"""
Function `c(du, u, p, t, counts, mark)` that executes the `i`th jump `counts[i]` times,
saving the output in `c[i]`.
"""
c::C
""" Number of jumps in the system."""
numjumps::Int
""" A distribution for marks. Not currently used or supported. """
mark_dist::MD
function RegularJump{iip}(rate, c, numjumps::Int; mark_dist = nothing) where {iip}
new{iip, typeof(rate), typeof(c), typeof(mark_dist)}(rate, c, numjumps, mark_dist)
Expand Down

0 comments on commit 42a40b0

Please sign in to comment.