6767
6868function _select_next_box (L:: Vector{Vector{_DominguezRiosBox}} , k:: Int )
6969 p = length (L)
70- if any (.! isempty .(L))
70+ @assert any (! isempty (l) for l in L)
71+ k = k % p + 1
72+ while isempty (L[k])
7173 k = k % p + 1
72- while isempty (L[k])
73- k = k % p + 1
74- end
75- i = argmax ([B. priority for B in L[k]])
7674 end
75+ i = argmax ([B. priority for B in L[k]])
7776 return i, k
7877end
7978
@@ -190,7 +189,7 @@ function minimize_multiobjective!(algorithm::DominguezRios, model::Optimizer)
190189 end
191190 i, k = _select_next_box (L, k)
192191 B = L[k][i]
193- # We're goign to scale `w` here by `scale` instead of the usual
192+ # We're going to scale `w` here by `scale` instead of the usual
194193 # `1 / max(...)`. It will show up in a few places bbelow.
195194 w = scale ./ max .(1 , B. u - yI)
196195 constraints = [
@@ -208,19 +207,18 @@ function minimize_multiobjective!(algorithm::DominguezRios, model::Optimizer)
208207 new_f = t_max + ϵ * sum (w[i] * (scalars[i] - yI[i]) for i in 1 : n)
209208 MOI. set (model. inner, MOI. ObjectiveFunction {typeof(new_f)} (), new_f)
210209 MOI. optimize! (model. inner)
211- if _is_scalar_status_optimal (model)
212- X, Y = _compute_point (model, variables, model. f)
213- obj = MOI. get (model. inner, MOI. ObjectiveValue ())
214- # We need to undo the scaling of the scalar objective. There's no
215- # need to unscale `Y` because we have evaluated this explicitly from
216- # the modified `model.f`.
217- obj /= scale
218- if (obj < 1 ) && all (yI .< B. u)
219- push! (solutions, SolutionPoint (X, Y))
220- _update! (L, Y, yI, yN)
221- else
222- deleteat! (L[k], i)
223- end
210+ @assert _is_scalar_status_optimal (model)
211+ X, Y = _compute_point (model, variables, model. f)
212+ obj = MOI. get (model. inner, MOI. ObjectiveValue ())
213+ # We need to undo the scaling of the scalar objective. There's no
214+ # need to unscale `Y` because we have evaluated this explicitly from
215+ # the modified `model.f`.
216+ obj /= scale
217+ if (obj < 1 ) && all (yI .< B. u)
218+ push! (solutions, SolutionPoint (X, Y))
219+ _update! (L, Y, yI, yN)
220+ else
221+ deleteat! (L[k], i)
224222 end
225223 MOI. delete .(model. inner, constraints)
226224 end
0 commit comments