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.6.tar.gz
(25.7 kB
view details)
Built Distribution
bejoor-0.1.6-py3-none-any.whl
(50.8 kB
view details)
File details
Details for the file bejoor-0.1.6.tar.gz
.
File metadata
- Download URL: bejoor-0.1.6.tar.gz
- Upload date:
- Size: 25.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 | 79002beb8ad0c293964b6984da408f6107e8c34ab5a232f9173b60ef7924c0aa |
|
MD5 | 894c3a5a7d820b33b00bb2523c5b8b8a |
|
BLAKE2b-256 | fa03cb106bf89da7a9c620400b18d756089c00bd4417e853e9ace4f4dd8df8b8 |
File details
Details for the file bejoor-0.1.6-py3-none-any.whl
.
File metadata
- Download URL: bejoor-0.1.6-py3-none-any.whl
- Upload date:
- Size: 50.8 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 | b51df4ec07c45076edcef3fa5ca1a4c04f8d73967c98f66bad0b4da63c37629b |
|
MD5 | a9f97c9be7eb98433bd0a0c8c14083d4 |
|
BLAKE2b-256 | 4fa623c6c0e303c747d9c90d201bbd2ad340646f21a6660f3beea82f2b4e9588 |