Skip to content

Instantly share code, notes, and snippets.

@alanderos91
alanderos91 / direct.jl
Created April 4, 2018 00:47
SSAJumpAggregator Interface
# this provides only the required fields, but we could in principle add more; e.g. dependency graph
type DirectJumpAggregation{T,F1,F2,RNG} <: SSAJumpAggregator
next_jump::Int
next_jump_time::T
end_time::T
cur_rates::Vector{T}
sum_rate::T
rates::F1
affects!::F2
save_positions::Tuple{Bool,Bool}
@alanderos91
alanderos91 / reaction_network.jl
Created June 25, 2017 02:41
Implementing @reaction_network
# inside src/reactions.jl, or a separate file?
import DataStructures: OrderedDict
macro reaction_network(ex)
def_reaction_network(ex)
end
function def_reaction_network(ex::Expr)
reactions = :([])