Skip to main content

ENOPPY: A Python Library for Engineering Optimization Problems

Project description

ENOPPY


GitHub release Wheel PyPI version PyPI - Python Version PyPI - Status PyPI - Downloads Downloads Tests & Publishes to PyPI GitHub Release Date Documentation Status Chat Average time to resolve an issue Percentage of issues still open GitHub contributors GitTutorial DOI License: GPL v3

ENOPPY (ENgineering Optimization Problems in PYthon) is the largest python library for real-world engineering optimization problems. Contains all real-world engineering problems from CEC competitions and research papers.

  • Free software: GNU General Public License (GPL) V3 license
  • Total problems: > 50 problems
  • Documentation: https://enoppy.readthedocs.io/en/latest/
  • Python versions: 3.7.x, 3.8.x, 3.9.x, 3.10.x, 3.11.x
  • Dependencies: numpy, scipy, matplotlib

Installation

Install with pip

Install the current PyPI release:

$ pip install enoppy==0.1.0

Install directly from source code

$ git clone https://github.com/thieu1995/enoppy.git
$ cd enoppy
$ python setup.py install

Lib's structure

docs
examples
enoppy
    paper_based
        pdo_2022.py
        rwco_2020.py
    problem_based
        chemical.py
        mechanism.py
    utils
        validator.py
        visualize.py
    __init__.py
    engineer.py
README.md
setup.py

Usage

After installation, you can import ENOPPY as any other Python module:

$ python
>>> import enoppy
>>> enoppy.__version__

Let's go through some examples.

Examples

How to get the problem and use it

from enoppy.paper_based.moeosma_2023 import SpeedReducerProblem
# SRP = SpeedReducerProblem
# SP = SpringProblem
# HTBP = HydrostaticThrustBearingProblem
# VPP = VibratingPlatformProblem
# CSP = CarSideImpactProblem
# WRMP = WaterResourceManagementProblem
# BCP = BulkCarriersProblem
# MPBPP = MultiProductBatchPlantProblem

srp_prob = SpeedReducerProblem()
print("Lower bound for this problem: ", srp_prob.lb)
print("Upper bound for this problem: ", srp_prob.ub)
x0 = srp_prob.create_solution()
print("Get the objective values of x0: ", srp_prob.get_objs(x0))
print("Get the constraint values of x0: ", srp_prob.get_cons(x0))
print("Evaluate with default penalty function: ", srp_prob.evaluate(x0))

Design my own penalty function:

import numpy as np
from enoppy.paper_based.moeosma_2023 import HTBP
# HTBP = HydrostaticThrustBearingProblem

def penalty_func(list_objectives, list_constraints):
    list_constraints[list_constraints < 0] = 0
    return np.sum(list_objectives) + 1e5 * np.sum(list_constraints**2) 

htbp_prob = HTBP(f_penalty=penalty_func)
print("Lower bound for this problem: ", htbp_prob.lb)
print("Upper bound for this problem: ", htbp_prob.ub)
x0 = htbp_prob.create_solution()
print("Get the objective values of x0: ", htbp_prob.get_objs(x0))
print("Get the constraint values of x0: ", htbp_prob.get_cons(x0))
print("Evaluate with default penalty function: ", htbp_prob.evaluate(x0))

For more usage examples please look at examples folder.

Get helps (questions, problems)

Want to have an instant assistant? Join our telegram community at link We share lots of information, questions, and answers there. You will get more support and knowledge there.

Cite Us

If you are using enoppy in your project, we would appreciate citations:

@software{nguyen_van_thieu_2023_7953207,
  author       = {Nguyen Van Thieu},
  title        = {ENOPPY: A Python Library for Engineering Optimization Problems},
  month        = may,
  year         = 2023,
  publisher    = {Zenodo},
  doi          = {10.5281/zenodo.7953206},
  url          = {https://github.com/thieu1995/enoppy}
}

References

paper_based

  • ihaoavoa_2022: Xiao, Y., Guo, Y., Cui, H., Wang, Y., Li, J., & Zhang, Y. (2022). IHAOAVOA: An improved hybrid aquila optimizer and African vultures optimization algorithm for global optimization problems. Mathematical Biosciences and Engineering, 19(11), 10963-11017.

  • moeosma_2023: Luo, Q., Yin, S., Zhou, G., Meng, W., Zhao, Y., & Zhou, Y. (2023). Multi-objective equilibrium optimizer slime mould algorithm and its application in solving engineering problems. Structural and Multidisciplinary Optimization, 66(5), 114.

  • pdo_2022: Ezugwu, A. E., Agushaka, J. O., Abualigah, L., Mirjalili, S., & Gandomi, A. H. (2022). Prairie dog optimization algorithm. Neural Computing and Applications, 34(22), 20017-20065.

  • rwco_2020: Kumar, A., Wu, G., Ali, M. Z., Mallipeddi, R., Suganthan, P. N., & Das, S. (2020). A test-suite of non-convex constrained optimization problems from the real-world and some baseline results. Swarm and Evolutionary Computation, 56, 100693.

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

enoppy-0.1.1.tar.gz (43.3 kB view details)

Uploaded Source

Built Distribution

enoppy-0.1.1-py3-none-any.whl (41.8 kB view details)

Uploaded Python 3

File details

Details for the file enoppy-0.1.1.tar.gz.

File metadata

  • Download URL: enoppy-0.1.1.tar.gz
  • Upload date:
  • Size: 43.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for enoppy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b72152755d5ae5032394bfdfbcff4b0926e4c21fce4ecd3454e25017a1cafbeb
MD5 c697bbd2f794b6e843f109f74fbdfb3f
BLAKE2b-256 3d1cb7ab7867b3c019260d6da05c99d94e7bb065745ad5017786b304fff2a16f

See more details on using hashes here.

File details

Details for the file enoppy-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: enoppy-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 41.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for enoppy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b3d66709bde98552f50d0944b63dd39fa025df7c1857c051b3d277854d7e9050
MD5 6514c090fb94426bbdc74726e92972ba
BLAKE2b-256 c7bc2d5156377280df1b0178e52b3ae615b565949ec63705ba289bf2977f546f

See more details on using hashes here.

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