Skip to main content

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


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.2.tar.gz (20.7 kB view details)

Uploaded Source

Built Distribution

bejoor-0.1.2-py3-none-any.whl (39.8 kB view details)

Uploaded Python 3

File details

Details for the file bejoor-0.1.2.tar.gz.

File metadata

  • Download URL: bejoor-0.1.2.tar.gz
  • Upload date:
  • Size: 20.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for bejoor-0.1.2.tar.gz
Algorithm Hash digest
SHA256 450b872c5c0bc591e673998fef2ed4d339d78c76c20d6aaf14075e6eef1c0dcf
MD5 3f8655606fabeaa9d494bcec1a07ad50
BLAKE2b-256 399a7c1e531e5422a499b288eed3d597f0b19f112910b393f92f5773a004bd6c

See more details on using hashes here.

File details

Details for the file bejoor-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: bejoor-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 39.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for bejoor-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 33325fc810b616544f3b70e577199c64c28f74753ded7c1c8103453a25a34813
MD5 0362faafef182db78fa3c1a34be99d7a
BLAKE2b-256 8eb80a2c39cfef2f156245779d779105d55928472c02a4201384732f75ff7c72

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