Skip to content

Commit

Permalink
adds supports_variablerates trait.
Browse files Browse the repository at this point in the history
  • Loading branch information
gzagatti committed Dec 11, 2022
1 parent b87e00e commit 27707e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/aggregators/aggregators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ needs_vartojumps_map(aggregator::AbstractAggregatorAlgorithm) = false
needs_vartojumps_map(aggregator::RSSA) = true
needs_vartojumps_map(aggregator::RSSACR) = true

# true if aggregator supports variable rates
supports_variablerates(aggregator::AbstractAggregatorAlgorithm) = false
supports_variablerates(aggregator::Coevolve) = true

is_spatial(aggregator::AbstractAggregatorAlgorithm) = false
is_spatial(aggregator::NSM) = true
is_spatial(aggregator::DirectCRDirect) = true
2 changes: 1 addition & 1 deletion src/problem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ function JumpProblem(prob, aggregator::AbstractAggregatorAlgorithm, jumps::JumpS
cont_agg = JumpSet().variable_jumps
disc_agg = nothing
constant_jump_callback = CallbackSet()
elseif typeof(aggregator) <: Coevolve
elseif supports_variablerates(aggregator)
# Coevolve handles all types of jumps together
variable_jumps = VariableRateJump[]
if (length(jumps.constant_jumps) == 0)
Expand Down

0 comments on commit 27707e6

Please sign in to comment.