Code Monkey home page Code Monkey logo

Comments (6)

renkekuhlmann avatar renkekuhlmann commented on June 23, 2024 1

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.

MartinBonde avatar MartinBonde commented on June 23, 2024 1

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.

renkekuhlmann avatar renkekuhlmann commented on June 23, 2024

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.

MartinBonde avatar MartinBonde commented on June 23, 2024

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.

renkekuhlmann avatar renkekuhlmann commented on June 23, 2024

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.

renkekuhlmann avatar renkekuhlmann commented on June 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.