Skip to content

Commit

Permalink
add kwarg-based JumpSet constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacsas committed May 20, 2021
1 parent 6e6ce59 commit 1ecbc2f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/jumps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ JumpSet(jump::ConstantRateJump) = JumpSet((),(jump,),nothing,nothing)
JumpSet(jump::VariableRateJump) = JumpSet((jump,),(),nothing,nothing)
JumpSet(jump::RegularJump) = JumpSet((),(),jump,nothing)
JumpSet(jump::MassActionJump) = JumpSet((),(),nothing,jump)
JumpSet() = JumpSet((),(),nothing,nothing)
function JumpSet(; variable_jumps=(), constant_jumps=(),
regular_jumps=nothing, massaction_jumps=nothing)
JumpSet(variable_jumps, constant_jumps, regular_jumps, massaction_jumps)
end
JumpSet(jb::Nothing) = JumpSet()

# For Varargs, use recursion to make it type-stable
Expand Down

0 comments on commit 1ecbc2f

Please sign in to comment.