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

Uploaded Source

Built Distribution

bejoor-0.1.3-py3-none-any.whl (45.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bejoor-0.1.3.tar.gz
  • Upload date:
  • Size: 23.3 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.3.tar.gz
Algorithm Hash digest
SHA256 807890e1d317a330215b27d6ab2e41164d478d8b91857200e7dd35876acd948a
MD5 454991d80645b62cce72d12883743e36
BLAKE2b-256 2d663685484bba6a3bd78657aa5c38d97b92e131ccbbb461c58523e7a9778d0a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bejoor-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 45.4 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d3b2036f362e9f1eac73f4d28d0639e8ab6803408876a5c70021af43de06b7d1
MD5 c2774d14f2ebdb64f5a24197dad5a425
BLAKE2b-256 06a9025056b60a680ab6ddc8827c7f7ca9147e4cc461c50cd4d895ab2f8381b2

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