Skip to content

Commit

Permalink
Update ensemble_problems.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaibhavdixit02 authored Dec 12, 2023
1 parent 9fdb9c8 commit 5fe6a2a
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/ensemble/ensemble_problems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,6 @@ function SciMLBase.EnsembleProblem(prob::AbstractSciMLProblem, u0s::Vector{Vecto
return SciMLBase.EnsembleProblem(prob; prob_func, kwargs...)
end

#only makes sense for OptimizationProblem, might make sense for IntervalNonlinearProblem
function SciMLBase.EnsembleProblem(prob::OptimizationProblem, trajectories::Int; kwargs...)
if prob.lb !== nothing && prob.ub !== nothing
u0s = QuasiMonteCarlo.sample(trajectories, prob.lb, prob.ub, QuasiMonteCarlo.LatinHypercubeSample())
prob_func = (prob, i, repeat = nothing) -> remake(prob, u0 = u0s[:, i])
else
error("EnsembleProblem with `trajectories` as second argument requires lower and upper bounds to be defined in the `OptimizationProblem`.")
end
return SciMLBase.EnsembleProblem(prob; prob_func, kwargs...)
end

struct WeightedEnsembleProblem{T1 <: AbstractEnsembleProblem, T2 <: AbstractVector} <:
AbstractEnsembleProblem
ensembleprob::T1
Expand Down

0 comments on commit 5fe6a2a

Please sign in to comment.