Skip to content

Commit

Permalink
Merge pull request #284 from isaacsas/jumpproblem-fix
Browse files Browse the repository at this point in the history
Spatial JumpProblem validation check fix
  • Loading branch information
isaacsas committed Jan 5, 2023
2 parents 2afd123 + 32cda2c commit e7b8752
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/problem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -184,17 +184,15 @@ function JumpProblem(prob, aggregator::AbstractAggregatorAlgorithm, jumps::JumpS
end

## Spatial jumps handling
if spatial_system !== nothing && hopping_constants !== nothing &&
!is_spatial(aggregator)
if spatial_system !== nothing && hopping_constants !== nothing
(num_crjs(jumps) == num_vrjs(jumps) == 0) ||
error("Spatial aggregators only support MassActionJumps currently.")
prob, maj = flatten(maj, prob, spatial_system, hopping_constants; kwargs...)
end

if is_spatial(aggregator)
(num_crjs(jumps) == num_vrjs(jumps) == 0) ||
error("Spatial aggregators only support MassActionJumps currently.")
kwargs = merge((; hopping_constants, spatial_system), kwargs)
if is_spatial(aggregator)
kwargs = merge((; hopping_constants, spatial_system), kwargs)
else
prob, maj = flatten(maj, prob, spatial_system, hopping_constants; kwargs...)
end
end

ndiscjumps = get_num_majumps(maj) + num_crjs(jumps)
Expand Down

0 comments on commit e7b8752

Please sign in to comment.