Skip to content

Commit

Permalink
add solutions getter for EnsembleSimulationSolution
Browse files Browse the repository at this point in the history
  • Loading branch information
schillic committed May 4, 2024
1 parent 06f045c commit f56b39b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/init_OrdinaryDiffEq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ end
export trajectory,
trajectories,
controls,
disturbances
disturbances,
solutions

struct SimulationSolution{TT,CT,IT}
trajectory::TT # trajectory pieces for each control cycle
Expand Down Expand Up @@ -49,6 +50,9 @@ end

Base.length(ess::EnsembleSimulationSolution) = length(ess.solutions)
Base.getindex(ess::EnsembleSimulationSolution, i) = ess.solutions[i]
function solutions(ess::EnsembleSimulationSolution, i)
return EnsembleSimulationSolution([sol[i] for sol in ess.solutions])
end
trajectory(ess::EnsembleSimulationSolution, i) = trajectory(solution(ess, i))
trajectories(ess::EnsembleSimulationSolution) = trajectory.(ess.solutions)
controls(ess::EnsembleSimulationSolution, i) = controls(solution(ess, i))
Expand Down

0 comments on commit f56b39b

Please sign in to comment.