Comments (6)
Yeah, there is currently no feature to look up the autogenerated names. I agree that it would be useful to use the JuMP variable names on the GAMS level. I'll look into it. Thanks for the feature request.
from gams.jl.
Looks great! I did not realize there was an issue with naming restrictions when I opened the issue, but this seems like a good solution. I look forward to trying it.
from gams.jl.
I added writing the variable and constraint (only linear and quadratic) names that the user passes to the generated GAMS model with v0.3.0 - along with some other updates. Note however, that GAMS is very restrictive when it comes to variable naming and that something like x[1,2]
or β
is not allowed in GAMS source. Therefore, forbidden characters are replaced by _
. I can then happen that the name is invalid because it will start with _
, e.g. if you are using unicode symbols. In that case GAMS.jl should fall back to generic names. I hope this solution is fine for debugging. The generated files were never meant to be beautiful 😉
Version 0.3.0 should be available in a moment.
from gams.jl.
Thanks! That should work except for the issue with not just illegal characters, but also case insensitivity of GAMS. Would it be possible to access some mapping (e.g. a dict) between the two? The users can easily do a search and replace of any error message or LST file if needed.
from gams.jl.
Right, I forgot about this. I guess I should revert back to the generated names then, because otherwise the possibility of provoking GAMS compilation errors is too high. Instead, I will introduce Attributes in order to get the mapping, e.g.:
MOI.get(model, GAMS.GeneratedVariableName(), x[1,1])
MOI.get(model, GAMS.OriginalVariableName("x1"))
from gams.jl.
Okay, done with the latest commit, see https://github.com/GAMS-dev/gams.jl#gams-names-vs-jump-names. Version 0.3.1 will be available soon.
from gams.jl.
Related Issues (20)
- Alternative License File HOT 1
- Constraint Conflict Resolution or .gms file HOT 1
- 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
- Question: using PATH through GAMS HOT 6
- Add support of attribute RelativeGap (and maybe others) HOT 2
- Add an external option file HOT 2
- GeneratedConstraintName() for Non linear constraints HOT 4
- is it possible to access dual/marginal variables HOT 2
- [FR] Accessing GDX files from Julia HOT 7
- Input data rounded? HOT 3
- Variable index allocation problem for silent variables HOT 9
- 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.