# Solvers using JuMP and Clp

**URL:** <https://discourse.julialang.org/t/solvers-using-jump-and-clp/60193>\
**Category:** Specific Domains\
**Created:** [April 28, 2021, 6:44pm UTC](https://discourse.julialang.org/t/solvers-using-jump-and-clp/60193 "2021-04-28T18:44:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marouane](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marouane/32/16267_2.png) [@marouane](https://discourse.julialang.org/u/marouane)\
**Post date:** [April 28, 2021, 6:44pm UTC](https://discourse.julialang.org/t/solvers-using-jump-and-clp/60193/1 "2021-04-28T18:44:51Z")

</div>

I have this function, that is written using `JuMP@0.18` and `Clp` and i`m struggling how can i update the syntax when using `JuMP@0.21` specially when it comes to the solver part:

```julia
function scan(c::Channel)
        i = 1
        init = 1
        while i > 0
            if i >= init
                @objective(m, Max, x[i])
                res = JuMP.solve(m, suppress_warnings=true)
                if res==:Optimal || res==:Unbounded
                    ub[i] = round(Int, getvalue(x[i]))
                    setobjectivesense(m, :Min)
                    res = JuMP.solve(m, suppress_warnings=true)
                    @assert res==:Optimal || res==:Unbounded
                    lb[i] = round(Int, getvalue(x[i]))

                    v[i] = lb[i]
                    init += 1
                else
                    @assert res==:Infeasible
                    i -= 1
                    continue
                end
            elseif v[i] < ub[i]
                v[i] += 1
            else
                setupperbound(x[i], Inf)
                setlowerbound(x[i], -Inf)
                init -= 1
                i -= 1
                continue
            end

            if i >= level
                put!(c, v)
                continue
            else
                setupperbound(x[i], v[i])
                setlowerbound(x[i], v[i])
                i += 1
            end
        end
        close(c)
    end

```

`x` of course is the variable .
