Skip to main content

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

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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file myopenopt-0.0.3.tar.gz.

File metadata

  • Download URL: myopenopt-0.0.3.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.7.7 Darwin/19.0.0

File hashes

Hashes for myopenopt-0.0.3.tar.gz
Algorithm Hash digest
SHA256 9e9357cb11681a9bd111b8d6d775a9ed66126c383c3a32b287e21ec336406736
MD5 ce382acc22e7f0be7f0197276633f910
BLAKE2b-256 55bb31e2e9ac58009878b6fee19d140e54727ddba1ad0af7fd33ee66e8bef679

See more details on using hashes here.

File details

Details for the file myopenopt-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: myopenopt-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.7.7 Darwin/19.0.0

File hashes

Hashes for myopenopt-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 084d8d212f84e3bbf519cf22e1099d168e41c31eec4782bca032239ea580b668
MD5 962573c1ec2ce559d6340e0037dabe6f
BLAKE2b-256 3ffd737a4fc92fc51ebd323cc0dcfab7e17f327d8eb13a4f95142f6d9f8e6486

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 files

0.0.2

1 file

0.0.1

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page