@@ -202,24 +202,24 @@ mutable struct GroupStoppingCriterionState{TCriteriaStates<:Tuple} <: StoppingCr
202202end
203203
204204function initialize_state (
205- p :: Problem ,
206- a :: Algorithm ,
205+ problem :: Problem ,
206+ algorithm :: Algorithm ,
207207 sc:: Union{StopWhenAll,StopWhenAny} ;
208208 kwargs... ,
209209)
210210 return GroupStoppingCriterionState ([
211- initialize_state (p, a , sc_i; kwargs) for sc_i in sc. criteria
211+ initialize_state (problem, algorithm , sc_i; kwargs) for sc_i in sc. criteria
212212 ])
213213end
214214function initialize_state! (
215215 scs:: GroupStoppingCriterionState ,
216- p :: Problem ,
217- a :: Algorithm ,
216+ problem :: Problem ,
217+ algorithm :: Algorithm ,
218218 sc:: Union{StopWhenAll,StopWhenAny} ;
219219 kwargs... ,
220220)
221221 for (scs_i, sc_i) in zip (scs. criteria_states, sc. criteria)
222- initialize_state! (scs_i, p, a , sc_i; kwargs... )
222+ initialize_state! (scs_i, problem, algorithm , sc_i; kwargs... )
223223 end
224224 scs. at_iteration = - 1
225225 return scs
@@ -259,29 +259,29 @@ function Base.summary(io::IO, sc::StopWhenAll, scs::GroupStoppingCriterionState)
259259end
260260# Meta functors
261261function (scs:: GroupStoppingCriterionState )(
262- p :: Problem ,
263- a :: Algorithm ,
264- s :: State ,
262+ problem :: Problem ,
263+ algorithm :: Algorithm ,
264+ state :: State ,
265265 sc:: StopWhenAll ,
266266)
267- k = get_iteration (s )
267+ k = get_iteration (state )
268268 (k == 0 ) && (scs. at_iteration = - 1 ) # reset on init
269- if all (st -> st[2 ](p, a, s , st[1 ]), zip (sc. criteria, scs. criteria_states))
269+ if all (st -> st[2 ](problem, algorithm, state , st[1 ]), zip (sc. criteria, scs. criteria_states))
270270 scs. at_iteration = k
271271 return true
272272 end
273273 return false
274274end
275275
276276function (scs:: GroupStoppingCriterionState )(
277- p :: Problem ,
278- a :: Algorithm ,
279- s :: State ,
277+ problem :: Problem ,
278+ algorithm :: Algorithm ,
279+ state :: State ,
280280 sc:: StopWhenAny ,
281281)
282- k = get_iteration (s )
282+ k = get_iteration (state )
283283 (k == 0 ) && (c. at_iteration = - 1 ) # reset on init
284- if any (st -> st[2 ](p, a, s , st[1 ]), zip (sc. criteria, scs. criteria_states))
284+ if any (st -> st[2 ](problem, algorithm, state , st[1 ]), zip (sc. criteria, scs. criteria_states))
285285 c. at_iteration = k
286286 return true
287287 end
@@ -344,10 +344,10 @@ end
344344function (scs:: DefaultStoppingCriterionState )(
345345 :: Problem ,
346346 :: Algorithm ,
347- s :: State ,
347+ state :: State ,
348348 sc:: StopAfterIteration ,
349349)
350- k = get_iteration (s )
350+ k = get_iteration (state )
351351 (k == 0 ) && (scs. at_iteration = - 1 )
352352 if k >= sc. max_iterations
353353 scs. at_iteration = k
@@ -434,8 +434,8 @@ function initialize_state!(
434434 return scs
435435end
436436
437- function (scs:: StopAfterTimePeriodState )(:: Problem , :: Algorithm , s :: State , sc:: StopAfter )
438- k = get_iteration (s )
437+ function (scs:: StopAfterTimePeriodState )(:: Problem , :: Algorithm , state :: State , sc:: StopAfter )
438+ k = get_iteration (state )
439439 if value (scs. start) == 0 || k <= 0 # (re)start timer
440440 scs. at_iteration = - 1
441441 scs. start = Nanosecond (time_ns ())
0 commit comments