JuliaOpt / CoinOptServices.jl

Julia interface to COIN-OR Optimization Services https://projects.coin-or.org/OS
Other
16 stars 4 forks source link

broken when switching from quadratic to linear objective #26

Open mlubin opened 7 years ago

mlubin commented 7 years ago

The following test causes all sorts of mayhem after the fix in https://github.com/JuliaOpt/JuMP.jl/pull/898

using JuMP,CoinOptServices

m = Model(solver=OsilBonminSolver())
@variable(m,x >=0)
@variable(m,y >=0)

@constraint(m, x + 2*y <= 4)
@constraint(m, 2*x + y <= 4)

@objective(m,Min, x^2) # Quadratic objective function
solve(m)
@show getobjectivevalue(m)
@objective(m,Max, 3*x + 4*y)  # Change to linear objective function
solve(m)
@show getobjectivevalue(m)
tkelman commented 7 years ago

What kind of "mayhem" exactly?

mlubin commented 7 years ago
getobjectivevalue(m) = 3.0489213312228895e-9

<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="OSrL.xslt"?>
<osrl xmlns="os.optimizationservices.org"   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="os.optimizationservices.org http://www.optimizationservices.org/schemas/2.0/OSrL.xsd" >
<general>
<generalStatus type="error">
</generalStatus>
<message>syntax error, unexpected ENDOFELEMENT, expecting GREATERTHAN</message>
</general>
</osrl>

WARNING: /home/mlubin/.julia/v0.5/CoinOptServices/.osil/results.osrl is empty
WARNING: Not solved to optimality, status: Error
getobjectivevalue(m) = 3.0489213312228895e-9
mlubin commented 7 years ago

This seems like a related issue:

using JuMP, CoinOptServices
m = Model(solver=OsilBonminSolver())
@variable(m, 0 <= v <= 2)
@variable(m, 1 <= x <= 5)
@constraint(m, v >= 0.0 * x^2 + x)
@objective(m, Min, v)
status = solve(m)
println("Objective value: ", getobjectivevalue(m))

gives

<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="OSrL.xslt"?>
<osrl xmlns="os.optimizationservices.org"   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="os.optimizationservices.org http://www.optimizationservices.org/schemas/2.0/OSrL.xsd" >
<general>
<generalStatus type="error">
</generalStatus>
<message>syntax error, unexpected ENDOFELEMENT, expecting GREATERTHAN</message>
</general>
</osrl>

WARNING: /home/mlubin/.julia/v0.5/CoinOptServices/.osil/results.osrl is empty
WARNING: Not solved to optimality, status: Error
Objective value: NaN
tkelman commented 7 years ago

What does the osil file look like?

mlubin commented 7 years ago

I don't have any need for this to work, but I'll be disabling CoinOptServices in the default JuMP tests until it passes.

tkelman commented 7 years ago

Is there a way of doing that while still allowing them to run if included here?

I don't have this package installed locally at the moment. Can you gist the problemantic .osil/problem.osil files?

mlubin commented 7 years ago

Ref https://github.com/JuliaOpt/JuMP.jl/issues/901 for running JuMP's tests for this solver only