Comments (9)
Any solution is correct. 0 is just the least worst option, and most often the one the user intended.
from gams.jl.
I still doubt that 0 is "the correct answer", but
Getting NaN solutions is going to cause no-end of issues.
is a very good point. I will change the behaviour to return 0 with the next release. Thanks a lot for pointing this out!
from gams.jl.
Thanks for your quick responses and for fixing the bug.
from gams.jl.
Just chiming in here: I don't know about the GAMS issue, but please talk to me if you have development plans for SDDiP odow/SDDP.jl#246!
from gams.jl.
Thanks very much for reporting! I can confirm that the used GAMS savepoint option only includes the symbols that are present in the model, which results in the incorrect behaviour reported by you.
from gams.jl.
This has been fixed with GAMS.jl v0.1.6. The output of the above program will be:
8-element Array{Float64,1}:
NaN
NaN
1.0
0.0
0.0
0.0
0.0
NaN
I thought about using missing instead of NaN
, but that resulted in errors with MathOptInterface. missing
would have been nice, but NaN
works as well. Thanks again for reporting the issue!
from gams.jl.
Isn't the correct answer 0, not NaN?
from gams.jl.
Good question. I have thought about this for a while and I think that missing
or NaN
is best here as it indicates the value could have been set to anything since it wasn't part of the optimization. If I set it to something, e.g. 0, this is unclear to the user. But I am happy to hear your thoughts about it. Is there any convention in MathOptInterface to set the value to 0 in this case?
from gams.jl.
I think the convention in most (every?) solver is that unspecified variables default to 0. That's what pure-Gurobi does, so it makes sense that is what GAMS-Gurobi should do:
using JuMP, Gurobi
approx_model = Model(Gurobi.Optimizer)
@variables(approx_model, begin
θ <= 100
x[1:8]
end)
@objective(approx_model, Max, θ)
@constraint(approx_model, θ - 0.65 * x[3] + x[4] - x[5] + x[6] + x[7] <= 36)
optimize!(approx_model)
julia> value.(x)
8-element Array{Float64,1}:
0.0
0.0
98.46153846153845
0.0
0.0
0.0
0.0
0.0
For SDDP, we take the solution to the Lagrangian dual, and use the optimal x
as an input to a different LP. Getting NaN
solutions is going to cause no-end of issues.
from gams.jl.
Related Issues (20)
- Alternative License File HOT 1
- Constraint Conflict Resolution or .gms file HOT 1
- Add support of JuMP variable/constraint names on GAMS level HOT 6
- HoldFixed causes value(<fixed_variable>) to return 0.0 HOT 3
- JuMP.direct_model does not work with GAMS.Optimizer() HOT 3
- ANTIGONE parameter file HOT 2
- ANTIGONE parameter file HOT 1
- MathOptInterface deprecated with some newer Julia packages HOT 3
- Update to MOI 1.11 HOT 1
- Add support of attribute RelativeGap (and maybe others) HOT 2
- Add an external option file HOT 2
- GeneratedConstraintName() for Non linear constraints HOT 4
- Unable to Pass 'Equilibrium' Keyword to Solver in GAMS.jl for Equilibrium Problem HOT 3
- Support MOI.ScalarNonlinearFunction HOT 3
- Parenthesis sometimes missing HOT 6
- User Model Type not used HOT 2
- vscode: GAMS executable not found! HOT 3
- GAMS doesn't recognize "acos" HOT 2
- slow on iterative solves HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gams.jl.