You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`repeat` is the iteration of the repeat. At first, it is `1`, but if
29
29
`rerun` was true this will be `2`, `3`, etc. counting the number of times
30
30
problem `i` has been repeated.
31
-
- `reduction`: This function determines how to reduce the data in each batch.
32
-
Defaults to appending the `data` into `u`, initialised via `u_data`, from
33
-
the batches. `I` is a range of indices giving the trajectories corresponding
34
-
to the batches. The second part of the output determines whether the simulation
35
-
has converged. If `true`, the simulation will exit early. By default, this is
36
-
always `false`.
31
+
- `reduction`: This function is used to aggregate the results in each simulation batch. By default, it appends the `data` from the batch to `u`, which is initialized via `u_data`. The `I` is a range of indices corresponding to the trajectories for the current batch.
32
+
33
+
### Arguments:
34
+
- `u`: The solution from the current ensemble run. This is the accumulated data that gets updated in each batch.
35
+
- `data`: The results from the current batch of simulations. This is typically some data (e.g., variable values, time steps) that is merged with `u`.
36
+
- `I`: A range of indices corresponding to the simulations in the current batch. This provides the trajectory indices for the batch.
37
+
38
+
### Returns:
39
+
- `(new_data, has_converged)`: A tuple where:
40
+
- `new_data`: The updated accumulated data, typically the result of appending `data` to `u`.
41
+
- `has_converged`: A boolean indicating whether the simulation has converged and should terminate early. If `true`, the simulation will stop early. If `false`, the simulation will continue. By default, this is `false`, meaning the simulation will not stop early.
42
+
37
43
- `u_init`: The initial form of the object that gets updated in-place inside the
38
44
`reduction` function.
39
45
- `safetycopy`: Determines whether a safety `deepcopy` is called on the `prob`
Base.depwarn("This dispatch is deprecated for the standard ensemble syntax. See the Parallel
99
-
Ensembles Simulations Interface page for more details", :EnsembleProblem)
187
+
Base.depwarn("This dispatch is deprecated for the standard ensemble syntax. See the Parallel Ensembles Simulations Interface page for more details", :EnsembleProblem)
100
188
invoke(EnsembleProblem,
101
189
Tuple{Any},
102
190
prob;
103
191
prob_func = DEFAULT_VECTOR_PROB_FUNC,
104
192
kwargs...)
105
193
end
194
+
195
+
"""
196
+
$(TYPEDEF)
197
+
198
+
Main constructor for `EnsembleProblem`.
199
+
200
+
## Arguments:
201
+
202
+
- `prob`: The base problem.
203
+
- `prob_func`: Function to modify the base problem per trajectory.
204
+
- `output_func`: Function to extract output from a solution.
205
+
- `reduction`: Function to aggregate results.
206
+
- `u_init`: Initial value for aggregation.
207
+
- `safetycopy`: Whether to deepcopy the problem before modifying.
208
+
209
+
"""
106
210
functionEnsembleProblem(prob;
107
211
prob_func = DEFAULT_PROB_FUNC,
108
212
output_func = DEFAULT_OUTPUT_FUNC,
@@ -116,6 +220,98 @@ function EnsembleProblem(prob;
This dispatch is deprecated. See the Parallel Ensembles Simulations Interface page.
245
+
246
+
"""
247
+
function SciMLBase.EnsembleProblem(
248
+
prob::AbstractSciMLProblem, u0s::Vector{Vector{T}}; kwargs...) where {T}
249
+
Base.depwarn("This dispatch is deprecated for the standard ensemble syntax. See the Parallel Ensembles Simulations Interface page for more details", :EnsembleProblem)
250
+
prob_func = (prob, i, repeat =nothing) ->remake(prob, u0 = u0s[i])
0 commit comments