Git Product home page Git Product logo

thieu1995 / enoppy Goto Github PK

View Code? Open in Web Editor NEW
9.0 1.0 2.0 158 KB

ENOPPY: A Python Library for Engineering Optimization Problems

Home Page: https://enoppy.readthedocs.io

License: GNU General Public License v3.0

Python 100.00%
engineering-optimization engineering-problems mathematical-optimization real-world-optimization benchmark-problems chemical-process-problems constrained-problems livestock-feed-ration-optimization mechanical-design-problems multi-objectives-optimization-problems

enoppy's Introduction

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

Installation

Install the current PyPI release:

$ pip install enoppy

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

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

Usage

This is a minimal usage example of the enoppy library.

  1. 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))
  1. 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 examples, check out examples folder and the enoppy documentation

Get helps (questions, problems)

Acknowledgments

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},
  year         = 2023,
  publisher    = {Zenodo},
  doi          = {10.5281/zenodo.7953206},
  url          = {https://github.com/thieu1995/enoppy}
}

@article{van2023mealpy,
  title={MEALPY: An open-source library for latest meta-heuristic algorithms in Python},
  author={Van Thieu, Nguyen and Mirjalili, Seyedali},
  journal={Journal of Systems Architecture},
  year={2023},
  publisher={Elsevier},
  doi={10.1016/j.sysarc.2023.102871}
}

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.

enoppy's People

Contributors

thieu1995 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

enoppy's Issues

[BUG]:

Description of the bug

Hello again, I'm using Enoppy and the results I get when the calculation is completed do not match the results I get when I use the formula, is there something wrong with that parameter?
image
image
image
image
You see that the optimal solution according to the computer output is 18928953.71308417, but the optimal solution according to the formula should be 0.3184176.

Steps To Reproduce

You see that the optimal solution according to the computer output is 18928953.71308417, but the optimal solution according to the formula should be 0.3184176.
I found out that there is a parameter w = 1e8 in engineer.py, and this parameter has a big impact on the result of the calculation. I don't know how to adjust my code. I hope you can help me out, thank you very much!

Additional Information

No response

[BUG]:

Description of the bug

Hello, when I use enoppy and run according to one of the examples I get the following error, I don't know how to change my code to work properly, please advise me.
image
image

Steps To Reproduce

model = SMA.BaseSMA(problem_dict1,epoch=50,pop_size=30,p_t= 0.03)

TypeError: init() got multiple values for argument 'epoch'

Additional Information

No response

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.