Skip to content

Commit

Permalink
Merge pull request #181 from isaacsas/jset_kwargs
Browse files Browse the repository at this point in the history
add kwarg-based JumpSet constructor
  • Loading branch information
isaacsas authored May 20, 2021
2 parents 6e6ce59 + 1ecbc2f commit b03a5aa
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 b03a5aa

Please sign in to comment.