Giter Site home page Giter Site logo

xhub / emp.jl Goto Github PK

View Code? Open in Web Editor NEW
15.0 3.0 2.0 95 KB

Extended Mathematical Programming in Julia

License: Other

Julia 100.00%
julia optimization-algorithms modeling-language game-theory risk-modelling risk-measure bilevel-optimization mpec optimization

emp.jl's Introduction

CI codecov

EMP

This package is not for public use as it needs to be updated to the latest version of JuMP/MOI.

This package enables the modeling of Extending Mathematical Programming (EMP) concepts within the JuliaOpt ecosystem. Broadly speaking, EMP enables the modeling of optimization problems with a structure that do not fit the classical minimization problem. For instance, the following problems can be modeled with EMP

  • Variational Inequalities (VI and AVI) or Complementarity Problems (LCP and NCP)
  • (Generalized) Nash Equilibrium Problem (NEP and GNEP) and MOPEC (Multiple Optimization Problems with Equilibrium Constraints)
  • Optimization Problems with Optimal Value Function (OVF) in the problem data. Examples of OVF include coherent risk measures (CVaR), convex regularizers/loss function (Huber, Hinge, l1, ...)

A problem with EMP can be solved by using model transformation to obtain a form amenable to computations by existing solvers. Currently, using the ReSHOP library is the only option to solve an optimization problem with EMP data structure.

Design

This package is designed as a thin layer over an existing modeling framework in JuliaOpt. Right now, only JuMP is supported. The idea is to use this framework to store variables and equations. The additional information to capture the EMP concept is stored in an EMP master object.

This package relies on ReSHOP.jl to export the model and the EMP information to the ReSHOP library. The latter is going to perform the necessary model transformations.

Note: This package is developed independently of the GAMS corporation

emp.jl's People

Contributors

xhub avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

lrsantos11

emp.jl's Issues

Review

General comments:

These are mainly observations looking at the examples.

  • The new version of JuMP will make this whole package much easier
    You will be able to have something like the following (just making syntax up, not an actual model)
emp = EMPModel(agent_models = n)

@variable(emp, x[i=1:n] >= 0)
@constraint(emp, [i=1:n], x[i] in AgentModel(i))
@constraint(emp, sum(x) >= 1)

for (i, agent) in enumerate(agents(emp))
    @agentobjective(agent, Min, x[i])
end

@variable(emp, y)
@constraint(emp, (x[1], y) in VariationalPair())
  • I'm not sure that there is need to support Convex going forward. The new JuMP/MOI is converging towards DCP. This removes a whole heap of the conditional code loading.
  • Have you seen https://github.com/StructJuMP/StructJuMP.jl? This also has multiple models with different scoping.
  • Have you seen https://github.com/jalving/Plasmo.jl?
  • The is the approach I would favour is almost identical to Plasmo. There are scoping issues that need to overcome, but these are just Julia problems:
agent_models = [JuMP.Model() for i in 1:2]
for agent in 1:2
    # x belongs to agent_model[i]
    @variable(agent_model[i], x >= 0)
    @objective(agent_model[i], Min, x)
end
# x is now x[2]
emp = EMPModel(agent_models)
# but we can get x[1] via agent_models[1][:x]
@empconstraint(emp, sum(m[:x] for m in agent_models) >= 1)
solve(emp)

or

agent_models = [JuMP.Model() for i in 1:2]
x = Dict{Int, JuMP.Variable}()
for i in 1:2
    x[i] = @variable(agent_model[i], lower_bound = 0)
    @objective(agent_model[i], Min, x[i])
end
# now we have x[1] and x[2]
emp = EMPModel(agent_models, solver=JAMSDSolver())
@empconstraint(emp, sum(x[i] for i in 1:2) >= 1)
solve(emp)

It's then up to EMPModel to combine the models on the back end.

Pedantic comments:

A lot of the code design stems from the limitations of the current form of JuMP and MPB. Hence the need for the MOI redesign. The new JuMP NL implementation splits out the linear constraints from the non-linear constraints which should help resolve

# TODO(xhub) fix this mess ...

I can not install it

I tried installing EMP.jl by cloning the repository and activating it. It fails when installing ReSHOP (that is also written by you) because the file libreshop.tar.xz is 0 bytes long. Then, tar fails to cope with it. Are EMP.jl and ReSHOP.jl still active? Do you have any plans to update them? If not, any suggestions of another Julia package with similar capabilities?

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.