|
1 | 1 | struct SimpleTauLeaping <: DiffEqBase.DEAlgorithm end |
2 | 2 |
|
3 | | -function validate_pure_leaping_inputs(jump_prob::JumpProblem) |
4 | | - jump_prob.aggregator isa PureLeaping && |
5 | | - isempty(jump_prob.jump_callback.continuous_callbacks) && |
6 | | - isempty(jump_prob.jump_callback.discrete_callbacks) && |
7 | | - isempty(jump_prob.constant_jumps) && |
8 | | - isempty(jump_prob.variable_jumps) && |
9 | | - get_num_majumps(jump_prob.massaction_jump) == 0 && |
10 | | - jump_prob.regular_jump !== nothing |
| 3 | +function validate_pure_leaping_inputs(jump_prob::JumpProblem, alg) |
| 4 | + if !(jump_prob.aggregator isa PureLeaping) |
| 5 | + @warn "When using $alg, please pass PureLeaping() as the aggregator to the \ |
| 6 | + JumpProblem, i.e. call JumpProblem(::DiscreteProblem, PureLeaping(),...). \ |
| 7 | + Passing $(jump_prob.aggregator) is deprecated and will be removed in the next breaking release." |
| 8 | + end |
| 9 | + isempty(jump_prob.jump_callback.continuous_callbacks) && |
| 10 | + isempty(jump_prob.jump_callback.discrete_callbacks) && |
| 11 | + isempty(jump_prob.constant_jumps) && |
| 12 | + isempty(jump_prob.variable_jumps) && |
| 13 | + get_num_majumps(jump_prob.massaction_jump) == 0 && |
| 14 | + jump_prob.regular_jump !== nothing |
11 | 15 | end |
12 | 16 |
|
13 | 17 | function DiffEqBase.solve(jump_prob::JumpProblem, alg::SimpleTauLeaping; |
14 | 18 | seed = nothing, |
15 | 19 | dt = error("dt is required for SimpleTauLeaping.")) |
16 | 20 |
|
17 | | - validate_pure_leaping_inputs(jump_prob) || |
| 21 | + @show "here1" |
| 22 | + validate_pure_leaping_inputs(jump_prob, alg) || |
18 | 23 | error("SimpleTauLeaping can only be used with PureLeaping JumpProblems with only non-RegularJumps.") |
19 | 24 | prob = jump_prob.prob |
20 | 25 | rng = DEFAULT_RNG |
|
0 commit comments