All Projects → GAMS-dev → gams.jl

GAMS-dev / gams.jl

Licence: MIT license
A MathOptInterface Optimizer to solve JuMP models using GAMS

Programming Languages

julia
2034 projects
GAMS
12 projects

Projects that are alternatives of or similar to gams.jl

Cvxpy
A Python-embedded modeling language for convex optimization problems.
Stars: ✭ 3,645 (+13400%)
Mutual labels:  optimization, modeling-language
LBFGS-Lite
LBFGS-Lite: A header-only L-BFGS unconstrained optimizer.
Stars: ✭ 98 (+262.96%)
Mutual labels:  optimization
MathOptSetDistances.jl
Distances to sets for MathOptInterface
Stars: ✭ 24 (-11.11%)
Mutual labels:  jump
hopperOptimizations
A mod that optimizes hoppers and their interactions with entities and inventories. It drastically reduces hopper lag without changing any behavior.
Stars: ✭ 65 (+140.74%)
Mutual labels:  optimization
nestml
A domain specific language to describe neuron models in NEST
Stars: ✭ 31 (+14.81%)
Mutual labels:  modeling-language
IterativeLQR.jl
A Julia package for constrained iterative LQR (iLQR)
Stars: ✭ 15 (-44.44%)
Mutual labels:  optimization
kn
Alternative to cd. Navigate by typing abbreviations of paths.
Stars: ✭ 68 (+151.85%)
Mutual labels:  jump
optimum
🏎️ Accelerate training and inference of 🤗 Transformers with easy to use hardware optimization tools
Stars: ✭ 567 (+2000%)
Mutual labels:  optimization
decrypticon
Java-layer Android Malware Simplifier
Stars: ✭ 17 (-37.04%)
Mutual labels:  optimization
genx
Genx provides modular building blocks to run simulations of optimization and search problems using Genetic Algorithms
Stars: ✭ 31 (+14.81%)
Mutual labels:  optimization
Optimization
A set of lightweight header-only template functions implementing commonly-used optimization methods on Riemannian manifolds and convex spaces.
Stars: ✭ 66 (+144.44%)
Mutual labels:  optimization
JumpJump
微信小游戏 跳一跳 kotlin PC破解
Stars: ✭ 70 (+159.26%)
Mutual labels:  jump
ProxSDP.jl
Semidefinite programming optimization solver
Stars: ✭ 69 (+155.56%)
Mutual labels:  optimization
ThingML
The ThingML modelling language
Stars: ✭ 91 (+237.04%)
Mutual labels:  modeling-language
mysql tuning-cookbook
Chef cookbook to create MySQL configuraiton files better suited for your system.
Stars: ✭ 23 (-14.81%)
Mutual labels:  optimization
z.vim
Help jumping to the most used directories in vim.
Stars: ✭ 19 (-29.63%)
Mutual labels:  jump
LaplacianOpt.jl
A Julia/JuMP Package for Maximizing Algebraic Connectivity of Undirected Weighted Graphs
Stars: ✭ 16 (-40.74%)
Mutual labels:  optimization
CSDP.jl
Julia Wrapper for CSDP (https://projects.coin-or.org/Csdp/)
Stars: ✭ 18 (-33.33%)
Mutual labels:  optimization
vrpy
A python framework for solving the VRP and its variants with column generation.
Stars: ✭ 94 (+248.15%)
Mutual labels:  optimization
StochasticOptimization.jl
Implementations of stochastic optimization algorithms and solvers
Stars: ✭ 26 (-3.7%)
Mutual labels:  optimization

GAMS.jl

GAMS.jl provides a MathOptInterface Optimizer to solve JuMP models using GAMS.

GAMS comes with dozens of supported solvers. Among them are: ALPHAECP, ANTIGONE, BARON, BONMIN, CBC, CONOPT, CPLEX, DICOPT, GLOMIQO, GUROBI, IPOPT, KNITRO, LGO, LINDO, LINDOGLOBAL, LOCALSOLVER, MINOS, MOSEK, MSNLP, NLPEC, PATH, QUADMINOS, SBB, SHOT, SCIP, SNOPT, SOPLEX, XA, XPRESS. Find a complete list here.

GAMS.jl supports the following JuMP features:

  • linear, quadratic and nonlinear (convex and non-convex) objective and constraints
  • continuous, binary, integer, semi-continuous and semi-integer variables
  • SOS1 and SOS2 sets
  • complementarity constraints

Installation

  1. Download GAMS and obtain a GAMS license. Please note that GAMS also offers a free community license.
  2. (optional) Add the GAMS system directory to the PATH variable in order to find GAMS automatically.
  3. Install GAMS.jl using the Julia package manager:
using Pkg
Pkg.add("GAMS")

Usage

Using GAMS as optimizer for your JuMP model:

using GAMS, JuMP
model = Model(GAMS.Optimizer)

GAMS System

If the GAMS system directory has been added to the PATH variable (you can check this with print(ENV["PATH"])), GAMS.jl will find it automatically. Otherwise, or if you like to switch between systems, the system directory can be specified by (one of the following):

set_optimizer_attribute(model, "SysDir", "<gams_system_dir>")
set_optimizer_attribute(model, GAMS.SysDir(), "<gams_system_dir>")

Analogously, you can specify a working directory with "WorkDir" or GAMS.WorkDir(). If no working directory has been set, GAMS.jl will create a temporary one.

If you want to use the same GAMS workspace (same system and working directory) for multiple models, you can create a GAMSWorkspace first with either of the following

ws = GAMS.GAMSWorkspace()
ws = GAMS.GAMSWorkspace("<gams_system_dir>")
ws = GAMS.GAMSWorkspace("<gams_system_dir>", "<gams_working_dir>")

and then pass it to your models:

model = Model(() -> GAMS.Optimizer(ws))

GAMS Options

GAMS command line options can be specified by

set_optimizer_attribute(model, "<option>", "<solver_name>")
set_optimizer_attribute(model, GAMS.<option>(), "<solver_name>")

where <option> is either HoldFixed, IterLim, License, LogOption, NodLim, OptCA, OptCR, ResLim, Solver, Threads, Trace, TraceOpt as well as LP, MIP, RMIP, NLP, DNLP, CNS, MINLP, RMINLP, QCP, MIQCP, RMIQCP, MCP or MPEC. Note that GAMS.ResLim() is equivalent to MOI.TimeLimitSec() and GAMS.Threads() to MOI.NumberOfThreads().

Model Type

GAMS.jl will automatically choose a GAMS model type for you. Choosing a different model type:

set_optimizer_attribute(model, GAMS.ModelType(), "<model_type>")

GAMS Solver Options

Specifying GAMS solver options:

set_optimizer_attribute(model, "<solver_option_name>", <option_value>)

Note that passing a solver option is only valid when exlicitly choosing a GAMS solver and not using the default.

Checking Solver Support

In order to check, if a GAMS solver is licensed (and supports a given GAMS model type), do

GAMS.check_solver(GAMS.GAMSWorkspace(), "<solver_name>")
GAMS.check_solver(GAMS.GAMSWorkspace(), "<solver_name>", "<model_type>")

GAMS Names vs. JuMP Names

GAMS uses generated variable and constraint names although it is possible to pass the JuMP names to the GAMS optimizer, because GAMS is more restrictive when it comes to variable and constraint naming. Use the attributes GeneratedVariableName, GeneratedConstraintName, OriginalVariableName, OriginalConstraintName to query a GAMS symbol name from a JuMP symbol and vice versa. This can help for debugging, e.g., in case of GAMS compilation errors. For example:

using GAMS

model = direct_model(GAMS.Optimizer())

@variable(model, x[1:2,1:3] >= 0)
@constraint(model, c[i = 1:2], sum(x[i,j] for j = 1:3) <= 10)

MOI.get(model, GAMS.GeneratedVariableName(), x[2,2]) # returns x4
MOI.get(model, GAMS.OriginalVariableName("x6"))      # returns x[2,3]
MOI.get(model, GAMS.OriginalVariableName("x10"))     # returns nothing

MOI.get(model, GAMS.GeneratedConstraintName(), c[2]) # returns eq2
MOI.get(model, GAMS.OriginalConstraintName("eq1"))   # returns c[1]
MOI.get(model, GAMS.OriginalConstraintName("eq10"))  # returns nothing

Note that JuMP direct-mode is used.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].