9898
9999# Sweeping by region.
100100struct ByRegion{Algorithm <: Sweeping } <: AI.AbstractAlgorithm
101- algorithm :: Algorithm
101+ parent :: Algorithm
102102end
103103function AI. initialize_state (
104104 problem:: AI.AbstractProblem , algorithm:: ByRegion , x
@@ -110,15 +110,15 @@ function AI.is_finished(
110110 )
111111 sweep_iteration = state. iteration. sweep
112112 region_iteration = state. iteration. region
113- return sweep_iteration ≥ maxiter (algorithm. algorithm ) &&
114- region_iteration ≥ maxiter (algorithm. algorithm . sweeps[sweep_iteration])
113+ return sweep_iteration ≥ maxiter (algorithm. parent ) &&
114+ region_iteration ≥ maxiter (algorithm. parent . sweeps[sweep_iteration])
115115end
116116function AI. increment! (
117117 problem:: AI.AbstractProblem , algorithm:: ByRegion , state:: AI.AbstractState
118118 )
119119 sweep_iteration = state. iteration. sweep
120120 region_iteration = state. iteration. region
121- if region_iteration < maxiter (algorithm. algorithm . sweeps[sweep_iteration])
121+ if region_iteration < maxiter (algorithm. parent . sweeps[sweep_iteration])
122122 region_iteration += 1
123123 else
124124 sweep_iteration += 1
@@ -128,7 +128,7 @@ function AI.increment!(
128128 return state
129129end
130130function AI. step! (problem:: AI.AbstractProblem , algorithm:: ByRegion , state:: AI.AbstractState )
131- sweep = algorithm. algorithm . sweeps[state. iteration. sweep]
131+ sweep = algorithm. parent . sweeps[state. iteration. sweep]
132132 sweep_state = AI. State (state. iterate, state. iteration. region)
133133 AI. step! (problem, sweep, sweep_state)
134134 state. iterate = sweep_state. iterate
0 commit comments