Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

examples/tsp.jl is not tested #699

Closed
diam opened this issue Mar 10, 2016 · 2 comments
Closed

examples/tsp.jl is not tested #699

diam opened this issue Mar 10, 2016 · 2 comments

Comments

@diam
Copy link

diam commented Mar 10, 2016

Bonjour,
Some months ago, I've succesfully tested tsp.jl with julia-0.3.1 and cplex or glpk (although the example is provide for gurobi).
I'm now testing the new tsp.jl exemple with the last JuMP version and julia-0.4.0 but get some error.
I saw #684, but it seems to be fixed!

Are code in the examples directory supposed to be maintained with each JuMP versions?

-- Maurice

----
Inside subtour callback
Current tour starting at city 1:
[1,2,3,1]Adding subtour elimination cut
----
ERROR: LoadError: MethodError: `isless` has no method matching isless(::JuMP.GenericAffExpr{Float64,JuMP.Variable}, ::Int64)
Closest candidates are:
  isless(!Matched::AbstractFloat, ::Real)
  isless(!Matched::ForwardDiff.ForwardDiffNumber{N,T<:Real,C}, ::Real)
  isless(!Matched::Real, ::Real)
  ...
 in subtour at /..../run_tsp_cplex_distrib_20160310.jl:212
 in lazycallback at /.../pkgs/v0.4/JuMP/src/callbacks.jl:65
...
mlubin added a commit that referenced this issue Mar 10, 2016
@mlubin
Copy link
Member

mlubin commented Mar 10, 2016

Thanks for catching this, I've fixed the example. I'll leave this issue open until we're running tsp.jl as part of the test suite.

@diam
Copy link
Author

diam commented Mar 10, 2016

Thank you very much: it works (with Pkg.checkout("JuMP")).

Also, adding lines like these following ones help me switching from one solver to another one
(I'm interested if there is a better Julia way to do this).

solver = "glpk"
    if length(ARGS) > 0
        solver = lowercase(ARGS[1])
    end
    if solver == "cplex"
        using CPLEX
        getModel() = Model(solver=CplexSolver())
    elseif solver == "gurobi"
        using Gurobi
        getModel() = Model(solver=GurobiSolver())
    else # "glpk" par défaut même si solver incorrect ou inconnu
        using GLPKMathProgInterface
        getModel() = Model(solver=GLPKSolverMIP())
    end
    print("\nLoading $(solver) solver\n")

@mlubin mlubin changed the title examples/tsp.jl and isless() error examples/tsp.jl is not tested May 19, 2016
@odow odow added the examples label Nov 10, 2018
@odow odow mentioned this issue Dec 30, 2018
21 tasks
@odow odow closed this as completed in #1712 Jan 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants