This project is a collection of optimization algorithms.
Project description
This project is a collection of optimization algorithms.
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.0.7.tar.gz
(7.4 kB
view details)
Built Distribution
bejoor-0.0.7-py3-none-any.whl
(11.7 kB
view details)
File details
Details for the file bejoor-0.0.7.tar.gz
.
File metadata
- Download URL: bejoor-0.0.7.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9de60649ec4a85caa6be7066c36c290c009b92d2352ff7b504dd4ae519ec1d52 |
|
MD5 | 6f52d1a0b24e3242f0429dc5759f6e17 |
|
BLAKE2b-256 | 9b0f50174b47c2d70de005f66b3e429c17d9e4ca8c895c1b54b448f4be8493fa |
File details
Details for the file bejoor-0.0.7-py3-none-any.whl
.
File metadata
- Download URL: bejoor-0.0.7-py3-none-any.whl
- Upload date:
- Size: 11.7 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 | 3ba6c440240a34b922a54e99182a2981c01decee2ae734fd61c8efe88f9ea564 |
|
MD5 | 0f25f483110408e171e35756b8b95a36 |
|
BLAKE2b-256 | 2c8cbf56f12794c8f4df207baa3555f39b879b505ccc6cb7019c23d9e439e67c |