This project is a collection of optimization algorithms.
Project description
This package is a collection of optimization algorithms. The aim is high diversity of optimizers and eased of use.
For documentation, Visit this.
Usage
from bejoor.genetic import BaseGeneticAlgorithm
def func(sol):
return abs( (sol[0]**sol[3] + sol[1]**sol[3] - sol[2]**sol[3]))
solution_vector = [{"type": "integer", "lower_bound": 1, "upper_bound": 500}] * 3 + \
[{"type": "integer", "lower_bound": 2, "upper_bound": 100}] + \
[{"type": "float", "lower_bound": 0, "upper_bound": 1}] * 2 + \
[{"type": "string", "possible_values": ["option1", "option2", "option3"]}]
bga = BaseGeneticAlgorithm(objective_function=func, solution_vector_size=7,
solution_vector=solution_vector, optimization_side="min", target_objective_upper_bound=5,
crossover_probability=0.9, mutation_probability=0.1,
elitism_rate=0.05, selection_strategy="roulette",
crossover_type="one-point", population_size=500, epochs=200)
bga.run()
print(bga.best_solution)
print(bga.best_objective_value)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bejoor-0.1.1.tar.gz
(18.7 kB
view details)
Built Distribution
bejoor-0.1.1-py3-none-any.whl
(35.5 kB
view details)
File details
Details for the file bejoor-0.1.1.tar.gz
.
File metadata
- Download URL: bejoor-0.1.1.tar.gz
- Upload date:
- Size: 18.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb03ab8be33eb9d24b8c0b0fe94f707f8ad2ef2b012ba77a233290ef54804682 |
|
MD5 | 1d02bc0de23f620654f8f6e197233d88 |
|
BLAKE2b-256 | 678ad6d73b3622cee167d19a2489262463e1217cbca1ed288bc33b76e2f520f6 |
File details
Details for the file bejoor-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: bejoor-0.1.1-py3-none-any.whl
- Upload date:
- Size: 35.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97ab954b799214badc3fc6f439bfa48ba459b9419d3507004fb770f3b91e84fc |
|
MD5 | 453ed226997c9e3642be8772786522cd |
|
BLAKE2b-256 | d2206d193d8a048d78acb8a3cecbbb5235671e7e9b42fa07bc8e77b92ebc8ea6 |