How to iterate the optimization model with the updated bounds of the variables?

Hello all,

The optimization code is given below.

x_min=1; x_max=7; y_min=2; y_max=5;
m= Model(with_optimizer(Ipopt.Optimizer))
@variable(m, x>=0)
@variable(m, y>=0)
@variable(m, z)
@variable(m, w)
@constraint(m, x_min<=x<=x_max)
@constraint(m, w == 12)
@constraint(m, w >= x_min * y + x * y_min - x_min * y_min)
@constraint(m, w >= x_max * y + x * y_max - x_max * y_max)
@constraint(m, w <= x_min * y + x * y_max - x_min * y_max)
@constraint(m, w <= x_max * y + x * y_min - x_max * y_min)
@constraint(m, z == x+y)
@objective(m, Min, z)

After the first run of the above code, the x bounds are updated as below.


The code should run for the second time with this updated bounds on x, and this process would continue until a criteria is met.

Now, can anyone please help me how I can iterate the optimization model for 3 or 4 times using while loop?

criterion = false
i = 1
while !criterion && i < max_i
    criterion = # calculate criterion
    i += 1