Skip to main content

`myopenopt` is a package for myopenopt.

Project description

Myopenopt is a wrapper module for openopt. It supports to call openopt using the same functions and classes as in Gurobi, a commercial mixed integer optimization solver. For more details, see the Gurobi HP http://www.gurobi.com/.

from myopenopt import *
model = Model("sample", mtype='NLP')
x1 = model.addVar(vtype="C", name="x1")
x2 = model.addVar(vtype="C", name="x2")
x3 = model.addVar(vtype="C", ub=10, name="x3")
model.update()
c1 = model.addConstr(x1**2 + 2*x2**2 <= x3**2, name="C1")
c2 = model.addConstr(x3 <= 30, name="C2")
c3 = model.addConstr(quicksum([x1, x2, x3]) <= 20, name="C3" )
model.setObjective(15*x1 + 18*x2 + 30*x3, GRB.MAXIMIZE)
print(model)
model.optimize(solver="ralg")
print("Result =", model.Status)
for v in model.getVars():
    print(v.VarName, v.X)

Requirements

  • Python 3.7 and openopt, FuncDesigner

Features

  • nothing

Setup

Add compiler path(ex. C:\Anaconda3\MinGW\bin)
$ pip install openopt
$ pip install FuncDesigner
$ pip install myopenopt

History

0.0.1 (2015-5-4)

  • first release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

myopenopt-0.0.3.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

myopenopt-0.0.3-py3-none-any.whl (3.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page